You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2006/11/14 23:26:39 UTC

DO NOT REPLY [Bug 40972] New: - Directory Deletion Dont Work Properly

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40972>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40972

           Summary: Directory Deletion Dont Work Properly
           Product: Ant
           Version: 1.7.0RC1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: tytios@googlemail.com


Different behaviour of the delete task in 1.6.5 and 1.7.0RC1. If the delete task 
should delete more than one directory and at least one directory does not exist
then Ant 1.7.0RC1 will not delete any directory. The task will finished
succesfully without any message. Ant 1.6.5 will delete all the directories as
expected.

Here an example:

<target name="demo">
   <delete quiet="true" includeEmptyDirs="true">
      <fileset dir="dir_doesnot_exists"/>
   </delete>
   
   <delete quiet="true" includeEmptyDirs="true">
      <fileset dir="dir_exists"/>
   </delete>
   
   <mkdir dir="dir_exists/blah"/>
   
   <delete quiet="true" includeEmptyDirs="true">
      <fileset dir="dir_exists"/>
      <fileset dir="dir_doesnot_exists"/>
   </delete>      
   

   <available file="dir_exists" type="dir" property="delete.dir.failed"/>
   <fail message="Failed to delete directory" if="delete.dir.failed"/>   
   
</target>

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 40972] - Directory Deletion Dont Work Properly

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40972>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40972


jkf@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |1.7.0




------- Additional Comments From jkf@apache.org  2006-11-24 14:03 -------
Bug fixed, added check if dir exists in the delete task before adding a fileset
to the total resource collection.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 40972] - Directory Deletion Dont Work Properly

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40972>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40972





------- Additional Comments From jkf@apache.org  2006-11-24 12:39 -------
In ant 1.7 several items were changed regarding fileset handling (now a
resource). The fileset is verified if it is a filesystemresource only, in the
course of action it now creates a directoryscanner on the nonexistent directory,
and will fail because of that.

I have modified the -debug option to get some more information for this
situation (although the way the change was made is generally applicable.)


   [delete] D:\data\eclipseworkspace\ant-trunk\tst\dir_doesnot_exists not found.
D:\data\eclipseworkspace\ant-trunk\tst\dir_doesnot_exists not found.
        at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(Abstra
ctFileSet.java:422)
        at org.apache.tools.ant.types.FileSet.size(FileSet.java:82)
        at org.apache.tools.ant.types.resources.Resources$MyCollection.<init>(Re
sources.java:74)
        at org.apache.tools.ant.types.resources.Resources.validate(Resources.jav
a:229)
        at org.apache.tools.ant.types.resources.Resources.isFilesystemOnly(Resou
rces.java:162)
        at org.apache.tools.ant.taskdefs.Delete.execute(Delete.java:583)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:105)
        at org.apache.tools.ant.Task.perform(Task.java:378)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.Main.runBuild(Main.java:698)
        at org.apache.tools.ant.Main.startAnt(Main.java:199)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:298)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

I am still searching for a good solution, but any suggestions are welcome,
especially regarding compatibility when suppressing the exception

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org