Subversion Repositories gelsvn

Rev

Rev 199 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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