Subversion Repositories gelsvn

Rev

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

use File::Path;

rmdirkeep("src",("CGLA"));
rmdirkeep("test",("CGLA-mat", "CGLA-vec", "CGLA-simple", "CGLA-ogl"));
rmdirkeep("apps", ());
#unlink <src/HMeshUtil/mesh_optimization.*>;

sub rmdirkeep {
   local($dir, @keeps) = @_;
   chdir($dir) || die "Cannot chdir to $dir\n";
   local(*DIR);
   opendir(DIR, ".");
   while ($f=readdir(DIR)) {
      next if ($f eq "." || $f eq ".." );
      next if ($f eq "CVS");
      next if (-f $f);
      $found = 0;
      for $keep (@keeps) {
        if ($f eq $keep) {
           $found = 1;
        }
      }
      next if ($found);
#      print "$f\n";
      rmtree($f, 1,1);
   }
   closedir(DIR);
   chdir("..");
}