ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yves Martin <yves.mar...@elca.ch>
Subject Re: Strange behavior of 'zip'
Date Thu, 09 Dec 2004 13:57:35 GMT
Peter Reilly <peterreilly@apache.org> writes:

> I do not see the behaviour you describe:
>   <target name="test">
>     <delete file="newfile.zip" quiet="yes"/>
>     <touch file="file1"/>
>     <touch file="file2"/>
>     <touch file="file3"/>
>     <zip
>       destfile="newfile.zip"
>       whenempty="create"
>       duplicate="fail"
>       update="false">
>       <fileset dir="." includes="file3"/>
>     </zip>
>     <ac:shellscript shell="bash">
>       jar tf newfile.zip
>     </ac:shellscript>
>     <zip
>       destfile="newfile.zip"
>       whenempty="create"
>       duplicate="fail"
>       update="false">
>       <fileset dir="." includes="file1"/>
>     </zip>
>     <ac:shellscript shell="bash">
>       jar tf newfile.zip
>     </ac:shellscript>
>     <!-- I expects newfile.zip only contains file1 -->
>     <zip
>       destfile="newfile.zip"
>       whenempty="create"
>       duplicate="fail"
>       update="true">
>       <fileset dir="." includes="file2"/>
>     </zip>
>     <ac:shellscript shell="bash">
>       jar tf newfile.zip
>     </ac:shellscript>
>     <!-- I expects newfile.zip contains file1, file2 -->
>   </target>

 In fact, my test does not reproduce the issue correctly:

 Replace your first zip by:

     <zip
       destfile="newfile.zip"
       whenempty="create"
       duplicate="fail"
       update="false">
       <fileset dir="." includes="file1,file2,file3"/>
     </zip>

 So here is the issue:

 - if selected files are up-to-date in an existing zip, the file is not rebuild
   BUT it may contains unwanted files !!!

 I do not know if we can consider it a "feature" - so to document - or a bug...


 But the result is strange:

 - if the zip does not exist yet, it only contains file1,file2

 - if the zip already exists (maybe with too many files), its content is
   unchanged.

 In my case, it is really annoying: if you change excludes filters with an
 already generated zip - the contain "remains", so the result is wrong...

 Regards,
-- 
Yves Martin


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


Mime
View raw message