Other Entries

Log

Changing CVS Root on an Existing Module

If you’re like me, you use CVS for version control. If you’re even more like me, you’ve got the repository set up on your home machine, which accesses the internet via a cable modem. And of course, every once in a great while, your IP address changes, which wreaks havoc on your checked out modules. You could check the module out again with the correct CVS_ROOT environment variable, you could manually change the URL in every CVS/Root file, or you could write a perl script named updateCVS.pl and use it via find on the command line as such:

cd your/module/root/; find . -name 'Root' -exec perl updateCVS.pl {} \;
#!/usr/bin/perl -w

my $file = shift;
my $content = "";
open (FILE, $file) || die "Can't open $file: $!\n";
while (<FILE>)
  {
  s/OLD\.URL/NEW\.URL/g;
  $content .= "$_";
  }
close(FILE);
open (FILE, ">$file") || die "Can't open $file: $!\n";
print FILE $content;
close(FILE);

01/06/05 11:36AM Geekiness

Comments

Allen:

schweet! worked like a charm ;)

05/25/05 2:34PM

TK Harris:

or:
find . -name ‘Root’ -exec perl -pi -e ‘s/OLD.URL/NEW.URL/’ {} \;

05/01/07 12:11AM

Add a Comment

Have something to say about what I wrote here? Let’s hear it!

The Rules

Personal Information




Remember Information


Comment Preview

 

 

Recently Played on iTunes

  1. “Heroin”
    The Velvet Underground & Nico
    The Velvet Underground
    11/17/08 16:26
  2. “All Tomorrow's Parties”
    The Velvet Underground & Nico
    The Velvet Underground
    11/17/08 16:20
  3. “Run Run Run”
    The Velvet Underground & Nico
    The Velvet Underground
    11/17/08 16:16

Last 100 Songs >