You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by co...@locus.apache.org on 2000/02/24 02:34:46 UTC

cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Deltree.java

costin      00/02/23 17:34:45

  Modified:    src/main/org/apache/tools/ant Project.java
               src/main/org/apache/tools/ant/taskdefs Deltree.java
  Log:
  - Fixed ( workaround)  Deltree - didn't worked on taz or any machine with
  /home sym-linked.
  
  - make sure basedir is exposed as a property.
  
  Revision  Changes    Path
  1.12      +1 -0      jakarta-ant/src/main/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Project.java	2000/02/24 00:57:42	1.11
  +++ Project.java	2000/02/24 01:34:44	1.12
  @@ -241,6 +241,7 @@
   
       public void setBaseDir(File baseDir) {
           this.baseDir = baseDir;
  +	setProperty( "basedir", baseDir.getAbsolutePath());
           String msg = "Project base dir set to: " + baseDir;
           log(msg, MSG_INFO);
       }
  
  
  
  1.2       +15 -13    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Deltree.java
  
  Index: Deltree.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Deltree.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Deltree.java	2000/01/13 10:41:41	1.1
  +++ Deltree.java	2000/02/24 01:34:45	1.2
  @@ -96,19 +96,21 @@
           // check to make sure that the given dir isn't a symlink
           // the comparison of absolute path and canonical path
           // catches this
  -        
  -        if (dir.getCanonicalPath().equals(dir.getAbsolutePath())) {
  -            String[] list = dir.list();
  -            for (int i = 0; i < list.length; i++) {
  -                String s = list[i];
  -                File f = new File(dir, s);
  -                if (f.isDirectory()) {
  -                    removeDir(f);
  -                } else {
  -                    f.delete();
  -                }
  -            }
  -        }
  +	
  +	//        if (dir.getCanonicalPath().equals(dir.getAbsolutePath())) {
  +	// (costin) It will not work if /home/costin is symlink to /da0/home/costin ( taz
  +	// for example )
  +	String[] list = dir.list();
  +	for (int i = 0; i < list.length; i++) {
  +	    String s = list[i];
  +	    File f = new File(dir, s);
  +	    if (f.isDirectory()) {
  +		removeDir(f);
  +	    } else {
  +		f.delete();
  +	    }
  +	}
  +	    //        }
           dir.delete();
       }
   }