Subversion Update Builder – Learning Python



Ok, so I’m back.  It’s been a while.

I’ve decided I would like to jump on the Python bandwagon.  I’ve been living the Ubuntu life for a while now, so I figured I should make myself at home…

Whenever I learn a new language, I need a pet project.  I’m not one that can learn just by doing a Hello World, so I came up with this idea.

At work, I deal mainly with kiosks in the field.  They leave the factory and exist in a Toys R’ Us, Walmart, even BMW showrooms (check my company:  http://www.realityi.com).  When they go out, they have a certain version of content on them.  By content, I mean usually .swf, .xml, etc.  These are files that can easily be updated and are in a predictable file structure (seeming as I made it).  We’ve begun to finally use version control, using subversion as our drug of choice.  After much googling, I wasn’t able to find a viable way to create an update package.  It seems that most applications of subversion are connected and can use rsync/svn checkout to get the most update to date content, but machines in my situation are either completely disconnected and updated via USB, or connected to a network but behind a hefty firewall (eg: bmw).

What I needed was a way to find what files have been added or modified between a certain revision and the current content to build an update package (no removals, tell you why in a second).

Enter: SVNUpdateBuilder

SVNUpdateBuilderI’ve taken on a small, linux-based (for now) project that does just what I need.  It uses the pysvn library, and creates a .tgz file with a directory tree of files that have been added or modified.  I’m learning how to use Python, but also Glade User Interface Builder to create a GTK application.  Check out the website for more information.

You may be asking: “Why is it a compiled python file?”  Well, I’ll tell you.  This is still my learning tool.  I have a few more items on my wishlist that I want to complete before I release it to the masses.  Like I said on the website, this isn’t a difficult project for someone more skilled than I to build, but I would like to be selfish with it until I figure I’ve learned all I care to.  Then I definitely plan to release it on Sourceforge.

You may also be asking “What about files that have been removed?”  In my line of work, with how fickle clients are, it’s better, for now, for us to leave content on the machines and just remove the link to the file in the xml (read: send a modified file).  That way, if a client wants a video relinked on a kiosk, we just have to relink it, not send it out again.  Disk space, for this current project, isn’t a concern as much as bandwidth, so we chose to leave the files out there.  Plans for this project include having output methods for bash scripts or batch files to clean up the target machine, but they haven’t been implemented yet.

So, I will continue to code…  I’ll keep you posted.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Leave a Reply


sproif.com is Digg proof thanks to caching by WP Super Cache!