Subversion Repositories gelsvn

Rev

Rev 141 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
141 bj 1
use File::Path;
2
 
3
rmdirkeep("src",("CGLA"));
4
rmdirkeep("test",("CGLA-mat", "CGLA-vec", "CGLA-simple", "CGLA-ogl"));
5
rmdirkeep("apps", ());
6
#unlink <src/HMeshUtil/mesh_optimization.*>;
7
 
8
sub rmdirkeep {
9
   local($dir, @keeps) = @_;
10
   chdir($dir) || die "Cannot chdir to $dir\n";
11
   local(*DIR);
12
   opendir(DIR, ".");
13
   while ($f=readdir(DIR)) {
14
      next if ($f eq "." || $f eq ".." );
15
      next if ($f eq "CVS");
16
      next if (-f $f);
17
      $found = 0;
18
      for $keep (@keeps) {
19
        if ($f eq $keep) {
20
           $found = 1;
21
        }
22
      }
23
      next if ($found);
24
#      print "$f\n";
25
      rmtree($f, 1,1);
26
   }
27
   closedir(DIR);
28
   chdir("..");
29
}