Mercurial > cgi-bin > hgwebdir.cgi > VMS > 2__runs_and_data
comparison scripts/remove_svn.pl @ 13:c93fb902a754
Vthread kmeans console line exploration for backup tuning
| author | Merten Sach <msach@mailbox.tu-berlin.de> |
|---|---|
| date | Fri, 03 Feb 2012 16:52:11 +0100 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:ef6932e55579 |
|---|---|
| 1 #!/usr/bin/perl | |
| 2 | |
| 3 # recursively goes through directory tree and removes the .svn | |
| 4 # dir in each, which removes the code from SVN control | |
| 5 | |
| 6 $dirToSearch = `pwd`; | |
| 7 @foo = split("\n", $dirToSearch); | |
| 8 $dirToSearch = $foo[0]; | |
| 9 doDir(); | |
| 10 | |
| 11 # SUBROUTINEs | |
| 12 #============================================================ | |
| 13 | |
| 14 sub doDir | |
| 15 { my @fileNames; | |
| 16 my $dirSearching = $dirToSearch; | |
| 17 print "doing dir: $dirSearching\n"; | |
| 18 | |
| 19 $dired = `ls -a $dirSearching`; | |
| 20 @fileNames = split("\n", $dired); | |
| 21 #print "filenames: "; | |
| 22 foreach $fileName (@fileNames) | |
| 23 { #print " $fileName "; | |
| 24 stat "$dirSearching/$fileName"; | |
| 25 if( -d "$dirSearching/$fileName" ) | |
| 26 { if( $fileName =~ /\.svn/ ) | |
| 27 { print "found SVN: $fileName\n"; | |
| 28 `rm -Rf $dirSearching/$fileName`; | |
| 29 } | |
| 30 elsif( !( $fileName =~ /\.|\.\./ ) ) | |
| 31 { $dirToSearch = "$dirSearching/$fileName"; | |
| 32 doDir(); | |
| 33 } | |
| 34 } | |
| 35 } | |
| 36 } |
