Mercurial > cgi-bin > hgwebdir.cgi > VMS > 2__runs_and_data
diff scripts/remove_svn.pl @ 0:21573f5b2e84
initial add -- all data from Sean's machine
| author | Me@portablequad |
|---|---|
| date | Mon, 28 Nov 2011 15:37:08 -0800 |
| parents | |
| children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/scripts/remove_svn.pl Mon Nov 28 15:37:08 2011 -0800 1.3 @@ -0,0 +1,36 @@ 1.4 +#!/usr/bin/perl 1.5 + 1.6 +# recursively goes through directory tree and removes the .svn 1.7 +# dir in each, which removes the code from SVN control 1.8 + 1.9 +$dirToSearch = `pwd`; 1.10 +@foo = split("\n", $dirToSearch); 1.11 +$dirToSearch = $foo[0]; 1.12 +doDir(); 1.13 + 1.14 +# SUBROUTINEs 1.15 +#============================================================ 1.16 + 1.17 +sub doDir 1.18 + { my @fileNames; 1.19 + my $dirSearching = $dirToSearch; 1.20 + print "doing dir: $dirSearching\n"; 1.21 + 1.22 + $dired = `ls -a $dirSearching`; 1.23 + @fileNames = split("\n", $dired); 1.24 + #print "filenames: "; 1.25 + foreach $fileName (@fileNames) 1.26 + { #print " $fileName "; 1.27 + stat "$dirSearching/$fileName"; 1.28 + if( -d "$dirSearching/$fileName" ) 1.29 + { if( $fileName =~ /\.svn/ ) 1.30 + { print "found SVN: $fileName\n"; 1.31 + `rm -Rf $dirSearching/$fileName`; 1.32 + } 1.33 + elsif( !( $fileName =~ /\.|\.\./ ) ) 1.34 + { $dirToSearch = "$dirSearching/$fileName"; 1.35 + doDir(); 1.36 + } 1.37 + } 1.38 + } 1.39 + }
