Bug 50816 - Delete task example does not work
Delete task example does not work
Status: RESOLVED FIXED
Product: Ant
Classification: Unclassified
Component: Documentation
1.8.2
PC Linux
: P2 normal (vote)
: 1.8.3
Assigned To: Ant Notifications List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2011-02-22 04:19 UTC by alfred.theorin
Modified: 2011-02-22 17:11 UTC (History)
0 users



Attachments

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>

to

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

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).

Peter
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!

Peter
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.