ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r935064 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java src/tests/antunit/taskdefs/optional/unix/symlink-test.xml
Date Fri, 16 Apr 2010 20:03:34 GMT
Author: bodewig
Date: Fri Apr 16 20:03:33 2010
New Revision: 935064

URL: http://svn.apache.org/viewvc?rev=935064&view=rev
Log:
File("foo").getParent() is null if "foo" is a symbolic link - File("./foo").getParent() is
not.  PR 49137.

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
    ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=935064&r1=935063&r2=935064&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Fri Apr 16 20:03:33 2010
@@ -86,6 +86,10 @@ Fixed bugs:
  * <jar filesetmanifest="merge"> was broken on Windows.
    Bugzilla Report 49090
 
+ * <symlink> delete failed if the link attribute was a relative path
+   to a link inside the current directory without a leading ".".
+   Bugzilla Report 49137
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java?rev=935064&r1=935063&r2=935064&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java Fri Apr
16 20:03:33 2010
@@ -184,7 +184,9 @@ public class Symlink extends DispatchTas
                 return;
             }
             log("Removing symlink: " + link);
-            SYMLINK_UTILS.deleteSymbolicLink(new File(link), this);
+            SYMLINK_UTILS.deleteSymbolicLink(FILE_UTILS
+                                             .resolveFile(new File("."), link),
+                                             this);
         } catch (FileNotFoundException fnfe) {
             handleError(fnfe.toString());
         } catch (IOException ioe) {

Modified: ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml?rev=935064&r1=935063&r2=935064&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml Fri Apr 16 20:03:33
2010
@@ -92,4 +92,18 @@
     <au:assertFileDoesntExist file="${output}/link"/>
   </target>
 
+  <target name="testDeleteLinkInSameDirAsBuildFile" depends="setUp" if="isUnix"
+          description="https://issues.apache.org/bugzilla/show_bug.cgi?id=49137">
+    <mkdir dir="${output}/Templates"/>
+    <mkdir dir="${output}/project1"/>
+    <symlink action="single" link="${output}/project1/Templates"
+             resource="../Templates"/>
+    <echo file="${output}/project1/build.xml"><![CDATA[
+<project name="project1" default="build" basedir=".">
+    <target name="build">
+        <symlink action="delete" link="Templates"/>
+    </target>
+</project>]]></echo>
+    <ant antfile="${output}/project1/build.xml"/>
+  </target>
 </project>



Mime
View raw message