annotate 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 |
|
| rev |
line source |
|
Me@0
|
1 #!/usr/bin/perl
|
|
Me@0
|
2
|
|
Me@0
|
3 # recursively goes through directory tree and removes the .svn
|
|
Me@0
|
4 # dir in each, which removes the code from SVN control
|
|
Me@0
|
5
|
|
Me@0
|
6 $dirToSearch = `pwd`;
|
|
Me@0
|
7 @foo = split("\n", $dirToSearch);
|
|
Me@0
|
8 $dirToSearch = $foo[0];
|
|
Me@0
|
9 doDir();
|
|
Me@0
|
10
|
|
Me@0
|
11 # SUBROUTINEs
|
|
Me@0
|
12 #============================================================
|
|
Me@0
|
13
|
|
Me@0
|
14 sub doDir
|
|
Me@0
|
15 { my @fileNames;
|
|
Me@0
|
16 my $dirSearching = $dirToSearch;
|
|
Me@0
|
17 print "doing dir: $dirSearching\n";
|
|
Me@0
|
18
|
|
Me@0
|
19 $dired = `ls -a $dirSearching`;
|
|
Me@0
|
20 @fileNames = split("\n", $dired);
|
|
Me@0
|
21 #print "filenames: ";
|
|
Me@0
|
22 foreach $fileName (@fileNames)
|
|
Me@0
|
23 { #print " $fileName ";
|
|
Me@0
|
24 stat "$dirSearching/$fileName";
|
|
Me@0
|
25 if( -d "$dirSearching/$fileName" )
|
|
Me@0
|
26 { if( $fileName =~ /\.svn/ )
|
|
Me@0
|
27 { print "found SVN: $fileName\n";
|
|
Me@0
|
28 `rm -Rf $dirSearching/$fileName`;
|
|
Me@0
|
29 }
|
|
Me@0
|
30 elsif( !( $fileName =~ /\.|\.\./ ) )
|
|
Me@0
|
31 { $dirToSearch = "$dirSearching/$fileName";
|
|
Me@0
|
32 doDir();
|
|
Me@0
|
33 }
|
|
Me@0
|
34 }
|
|
Me@0
|
35 }
|
|
Me@0
|
36 }
|