Subversion Repositories gelsvn

Rev

Rev 199 | 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 $f);
16
      $found = 0;
17
      for $keep (@keeps) {
18
        if ($f eq $keep) {
19
           $found = 1;
20
        }
21
      }
22
      next if ($found);
23
#      print "$f\n";
24
      rmtree($f, 1,1);
25
   }
26
   closedir(DIR);
27
   chdir("..");
28
}