You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2019/11/22 21:51:03 UTC

[Bug 63956] New: with followSymlinks="false" fails to delete directory

https://bz.apache.org/bugzilla/show_bug.cgi?id=63956

            Bug ID: 63956
           Summary: <delete> with followSymlinks="false" fails to delete
                    directory
           Product: Ant
           Version: 1.10.5
          Hardware: Macintosh
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
          Assignee: notifications@ant.apache.org
          Reporter: archie@dellroad.org
  Target Milestone: ---

$ ant -version
Apache Ant(TM) version 1.10.5 compiled on July 10 2018

This task simply does not work:

    <delete dir="somedir" followSymlinks="false"/>

Example:

When I run "ant" with this "build.xml":

  <project name="ant-bug" default="test">
    <target name="test">
        <echo message="creating somedir..."/>
        <mkdir dir="somedir"/>
        <echo message="showing somedir (it should be there)..."/>
        <exec executable="/bin/ls" logError="true" failonerror="true">
            <arg value="-ld"/>
            <arg value="somedir"/>
        </exec>
        <echo message="deleting somedir..."/>
        <delete dir="somedir" followSymlinks="false"/>
        <echo message="showing somedir (it should NOT be there)..."/>
        <exec executable="/bin/ls" logError="true" failonerror="true">
            <arg value="-ld"/>
            <arg value="somedir"/>
        </exec>
    </target>
  </project>

I get this output:

Buildfile: /Users/archie/Downloads/ant-bug/build.xml

test:
     [echo] creating somedir...
    [mkdir] Created dir: /Users/archie/Downloads/ant-bug/somedir
     [echo] showing somedir (it should be there)...
     [exec] drwxr-xr-x  2 archie  staff  64 Nov 22 15:50 somedir
     [echo] deleting somedir...
     [echo] showing somedir (it should NOT be there)...
     [exec] drwxr-xr-x  2 archie  staff  64 Nov 22 15:50 somedir

BUILD SUCCESSFUL
Total time: 0 seconds

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63956] with followSymlinks="false" fails to delete directory

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63956

Gintas Grigelionis <gi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Gintas Grigelionis <gi...@apache.org> ---
The task works, but "dir" attribute gets a special treatment for the reasons
that are not (fully) documented. If you look at the source code [1], setting
almost any other attribute makes the task to ignore "dir". In this particular
case, "dir" is ignored whenever "followSymlinks" is set explicitly, either to
"true" or "false". Nonetheless, the task should emit a warning when doing so.

[1]
https://github.com/apache/ant/blob/master/src/main/org/apache/tools/ant/taskdefs/Delete.java#L629

-- 
You are receiving this mail because:
You are the assignee for the bug.