Bug 50816 - Delete task example does not work
Summary: Delete task example does not work
Alias: None
Product: Ant
Classification: Unclassified
Component: Documentation (show other bugs)
Version: 1.8.2
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: 1.8.3
Assignee: Ant Notifications List
Depends on:
Reported: 2011-02-22 04:19 UTC by alfred.theorin
Modified: 2011-02-22 17:11 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description alfred.theorin 2011-02-22 04:19:12 UTC
The example for recursive removal of .svn-folders in manual/Tasks/delete.html does not work on my machine. The problem seems to be that the .svn-folders are not empty.

Changing it from

  <delete includeemptydirs="true">
    <fileset dir="src" includes="**/.svn" defaultexcludes="false"/>


  <delete includeemptydirs="true">
    <fileset dir="src" includes="**/.svn/" defaultexcludes="false"/>

worked for me (added trailing /).

I am pretty new to ant so I do not know if it is the example or the behavior that is wrong.
Comment 1 Peter Reilly 2011-02-22 06:09:27 UTC
I can confirm that this problem exists.
There should be no difference between "**/.svn" and "**/.svn/", 
in the example and at
one time there was not (the doc was correct).

Comment 2 Stefan Bodewig 2011-02-22 08:42:33 UTC
There is a (documented) difference between .svn and .svn/ - the later is
an implicit .svn/** .  See http://ant.apache.org/manual/dirtasks.html#patterns
the paragraph just before "Example patterns".

I don't know whether the doc has ever been cofrrect and anything changed
in <delete> but the fileset as stated in the doc doesn't match
the directories' contents and thus the directories will never be
empty.   It also shouldn't match the directories themselves since
it is a fileset and not a dirset.
Comment 3 Peter Reilly 2011-02-22 13:20:39 UTC
ah, ok.

It is a little strange.

I guess, then, that it never worked!

Comment 4 Antoine Levy-Lambert 2011-02-22 17:11:24 UTC
fixing the documentation and marking resolved. Thanks Alfred for reporting and Peter and Stefan for the comments.