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
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!
- Your name and email address are required, but your email will not be displayed on the site
- If you provide a URL, a link to your site will appear
- You may use the following HTML:
<strong>bold</strong><em>italic</em><a href="http://url">links</a>
- Double line breaks will be converted to paragraphs.
- As you type, you should get a nice little preview of your comment directly below the text box.
- I reserve the right to edit any comment for any reason (I’ll be reasonable).
Recently Played on iTunes
-
“Heroin”
The Velvet Underground & Nico
The Velvet Underground
11/17/08 16:26 -
“All Tomorrow's Parties”
The Velvet Underground & Nico
The Velvet Underground
11/17/08 16:20 -
“Run Run Run”
The Velvet Underground & Nico
The Velvet Underground
11/17/08 16:16
Allen:
schweet! worked like a charm ;)
05/25/05 2:34PM