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 2008/03/06 20:04:43 UTC

DO NOT REPLY [Bug 44549] New: Delete with an empty includesfile deletes all files

https://issues.apache.org/bugzilla/show_bug.cgi?id=44549

           Summary: Delete with an empty includesfile deletes all files
           Product: Ant
           Version: 1.7.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: critical
          Priority: P3
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: andy.kriger@gmail.com


If you use a delete task with a fileset using an empty includesfile, Ant
deletes all files in the given directory.

<target name="deleteTest">
   <delete>
      <fileset dir="c:\temp" includesfile="c:\temp\empty.txt"/>
   </delete>
</target>

In the above target, empty.txt has no patterns in it and all files in c:\temp
are  deleted.

The Ant docs state that 'all files are included when [includes is] omitted'. In
this case, since an includesfile is used, the expectation is that only patterns
in the includesfile will be applied. Since there are no patterns in the file,
nothing should be applied. The default behavior for includes should be treated
as a separate case. 

For the sake of the user's data, greedy delete is a bad idea.
I've marked this critical because of the unexpected data loss.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 44549] Delete with an empty includesfile deletes all files

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





--- Comment #1 from Inta <in...@hotmail.com>  2008-12-13 17:29:44 PST ---
Created an attachment (id=23016)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23016)
The patch avoids the inclusion of implicit files that leads to the loss of
unexpected files

Attached is a possible patch to the bug.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 44549] Delete with an empty includesfile deletes all files

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


andy kriger <an...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andy.kriger@gmail.com




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.