Thursday, January 5, 2012

Housekeeping

Before I get down to the nitty-gritty that is the main focus of this blog, there's stuff I have to do.

First and foremost is to try to organize my life's work.  Over time, I've accumulated code - lots of it.  And over time that code has found its way onto this server or that one... onto this hardrive or that website or this USB keyfob.  I've come to the conclusion that I don't want to try to manage that crap anymore - I want my stuff around when I want it and I want it safe.  Lord knows I've already lost of a crapton of code thanks to various hard drives dying on me.  So I'm done with that.  I want it hosted somewhere where I can always get at it.

Unfortunately, that's not the hard part - thanks to Dropbox.com.

The hard part is finding it; gathering it; extracting it; deduplicating it; evaluating it; and only keeping what's useful and weeding out any proprietary information.  I only want to keep tools and techniques, not business logic.

So... when I left this one particular company, our team had all of our projects stored in a CVS repository that I maintained.  When I left, I jumped onto the CVS server and tar'd up the CVSROOT and brought that with me.  All well and good, I figured.  Now that I'm interested in organizing and evaluating all that code, I find that having it in CVS files isn't the easiest thing in the world to deal with.  I'd prefer to just do a 'cvs export' and be done with it.  Unfortunately for me, the server where the code is now is NOT one that I control and it doesn't have CVS running on it and I don't have the privs to start an instance up.  What's a poor boy to do?

Well, the answer is that you can do a 'cvs co' and tell cvs to look in a particular directory for your CVS files.  That's easy enough:

cvs -d /home/helver/repo co MyProject1

The problem, though, is that cvs expects to find a cvs server running and a lock file present in /var/lock/cvs - and because a cvs server ISN'T running, the lock file isn't present so the command fails.  Fortunately, there's a way around this and it's not particularly intuitive: use the -R switch which tells cvs to assume that the repository is read-only.

When you turn the -R switch on, cvs doesn't try to lock anything and just does what I want it to in this case - extract the latest version of the files from the rcs formatted files.

cvs -R -d /home/helver/repo co MyProject1

And yes, I know I should be using github or at the very least subversion - but that CVS repository is one that I started using almost 12 years ago and it was still CVS when I left that company.  What it is now, I'm not sure.  But I'm pretty sure that none of the code I've got is in use in its current for anymore... such is the march of time...

No comments:

Post a Comment