diff --git a/src/main/org/apache/tools/ant/Project.java b/src/main/org/apache/tools/ant/Project.java index 0b1aa2186..a00286cb8 100644 --- a/src/main/org/apache/tools/ant/Project.java +++ b/src/main/org/apache/tools/ant/Project.java @@ -241,6 +241,7 @@ public class Project { public void setBaseDir(File baseDir) { this.baseDir = baseDir; + setProperty( "basedir", baseDir.getAbsolutePath()); String msg = "Project base dir set to: " + baseDir; log(msg, MSG_INFO); } diff --git a/src/main/org/apache/tools/ant/taskdefs/Deltree.java b/src/main/org/apache/tools/ant/taskdefs/Deltree.java index 63df48085..03cb33f67 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Deltree.java +++ b/src/main/org/apache/tools/ant/taskdefs/Deltree.java @@ -96,19 +96,21 @@ public class Deltree extends Task { // 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(); } }