ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yves Martin <yves.mar...@elca.ch>
Subject Strange behavior of 'zip'
Date Thu, 09 Dec 2004 12:12:23 GMT

   Hello,

 I find the behavior of 'zip' strange when writing my build.xml. So I extracted
 a test case:

<?xml version="1.0"?>
<project name="test" default="test">

  <target name="test">
    <zip
      destfile="newfile.zip"
      whenempty="create"
      duplicate="fail"
      update="false">
      <fileset dir="." includes="file1"/>
    </zip>
    <!-- I expects newfile.zip only contains file1 -->
    <zip
      destfile="newfile.zip"
      whenempty="create"
      duplicate="fail"
      update="true">
      <fileset dir="." includes="file2"/>
    </zip>
    <!-- I expects newfile.zip contains file1, file2 -->
  </target>
</project>

  What is the problem ?  

  If newfile.zip already exists with 'file3' inside, 'file3' remains because
  'zip' seems to work in 'append' mode only. 

  And there is no way to make it create a new empty zip file if the destfile
  already exists.

  OK, I will do a 'delete' first. It is a work-around.

  But I may find it useful to document this behavior and maybe to add a flag to
  force new zip file creation.

 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