Click to See Complete Forum and Search --> : Script kiddie needed


John E
June 10th, 2008, 12:06 PM
I hope this is the right forum for a question like this....

Some time ago I joined an open-source project at SourceForge. I used a CVS client called TortoiseCVS to check out all the source files (which are mostly C and C++).

I haven't been involved in the project for a while but recently, I needed to update my local copy. Unfortunately, the CVS root repository has changed.

AFAICT, TortoiseCVS has no ability to change the location of a project's CVS root. The only way I could do this would be to look in every CVS folder on my system and replace the file called 'root' (which contains a URL to the CVS root). Unfortunately, there are hundreds of these files.

I'm looking for either a batch file or script (that I could run from a command line) which would recurse through all the folders on my hard drive and change the contents of every file it finds called 'root'. It's a long time since I used batch files (and I've never used scripts at all) and yet I've got a gut feeling that this is the kind of thing that could be achieved in a few simple lines, if a suitable batch or scripting language was used.

Can anyone start me off in the right direction?

PeejAvery
June 10th, 2008, 12:33 PM
Since you have a background in C++, why don't you just write a small program which can recursively search the local drive? Then you can use a simple regular expression to replace the URL.

John E
June 10th, 2008, 12:41 PM
Yeah, I suppose I'm just being lazy really :D

The truth is that it's a very long time since I had anything to do with batch files or console applications or anything along those lines.

If no-one comes up with a quick solution, I guess it'll be time to dig out those old DOS programming books. :(

PeejAvery
June 10th, 2008, 01:45 PM
Well, we would have to do the same thing. It sounds to me like VBScript would be your best option, unless you aren't on a Windows platform.

Are these CVS folders all over your hard disk? If so, then you will have to employ recursion. If not, you can just do a simple directory listing, and edit the file within.