ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Zip.java
Date Wed, 25 Aug 2004 14:58:10 GMT
antoine     2004/08/25 07:58:10

  Modified:    .        Tag: ANT_16_BRANCH WHATSNEW
               src/etc/testcases/taskdefs Tag: ANT_16_BRANCH zip.xml
               src/testcases/org/apache/tools/ant/taskdefs Tag:
                        ANT_16_BRANCH ZipTest.java
               src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH
                        Zip.java
  Log:
  Merge from HEAD
  Zip task would not zip filesets containing only empty dirs
  PR: 30365
  Submitted by: Matt Benson
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.503.2.130 +2 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.503.2.129
  retrieving revision 1.503.2.130
  diff -u -r1.503.2.129 -r1.503.2.130
  --- WHATSNEW	23 Aug 2004 20:30:44 -0000	1.503.2.129
  +++ WHATSNEW	25 Aug 2004 14:58:09 -0000	1.503.2.130
  @@ -34,6 +34,8 @@
   
   * FTP task, getTimeDiff method was returning wrong value. Bugzilla 30595.
   
  +* Zip task was not zipping when only empty directories were found. Bugzilla 30365.
  +
   Changes from Ant 1.6.1 to Ant 1.6.2
   ===================================
   
  
  
  
  No                   revision
  No                   revision
  1.13.2.1  +13 -0     ant/src/etc/testcases/taskdefs/zip.xml
  
  Index: zip.xml
  ===================================================================
  RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/zip.xml,v
  retrieving revision 1.13
  retrieving revision 1.13.2.1
  diff -u -r1.13 -r1.13.2.1
  --- zip.xml	4 Aug 2003 12:11:37 -0000	1.13
  +++ zip.xml	25 Aug 2004 14:58:10 -0000	1.13.2.1
  @@ -122,6 +122,18 @@
            includes="ziptest/**" filesonly="true"/>
     </target>
   
  +  <!-- Bugzilla Report 22865 -->
  +  <target name="testEmptySkip">
  +    <mkdir dir="ziptest"/>
  +    <zip destfile="test3.zip" basedir="ziptest" whenempty="skip"/>
  +  </target>
  +
  +  <!-- Bugzilla Report 30365 -->
  +  <target name="zipEmptyDir">
  +        <mkdir dir="empty/empty2"/>
  +		<zip destfile="test3.zip" basedir="empty" update="true"/>
  +  </target>
  +
     <target name="cleanup">
       <delete file="test3.zip"/>
       <delete file="test4.zip"/>
  @@ -134,5 +146,6 @@
       <delete file="zipgroupfileset.zip"/>
       <delete file="../dummyfile" />
       <delete dir="ziptest"/>
  +    <delete dir="empty"/>
     </target>
   </project>
  
  
  
  No                   revision
  No                   revision
  1.15.2.5  +13 -0     ant/src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java
  
  Index: ZipTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java,v
  retrieving revision 1.15.2.4
  retrieving revision 1.15.2.5
  diff -u -r1.15.2.4 -r1.15.2.5
  --- ZipTest.java	9 Mar 2004 17:02:02 -0000	1.15.2.4
  +++ ZipTest.java	25 Aug 2004 14:58:10 -0000	1.15.2.5
  @@ -126,4 +126,17 @@
           executeTarget("testFilesOnlyDoesntCauseRecreate");
           assertEquals(l, getProject().resolveFile("test3.zip").lastModified());
       }
  +
  +    // Bugzilla Report 22865
  +    public void testEmptySkip() {
  +        executeTarget("testEmptySkip");
  +        assertTrue("archive should get skipped",
  +                   !getProject().resolveFile("test3.zip").exists());
  +    }
  +    // Bugzilla Report 30365
  +    public void testZipEmptyDir() {
  +        executeTarget("zipEmptyDir");
  +        assertTrue("archive should be created",
  +                   getProject().resolveFile("test3.zip").exists());
  +    }
   }
  
  
  
  No                   revision
  No                   revision
  1.116.2.10 +2 -2      ant/src/main/org/apache/tools/ant/taskdefs/Zip.java
  
  Index: Zip.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Zip.java,v
  retrieving revision 1.116.2.9
  retrieving revision 1.116.2.10
  diff -u -r1.116.2.9 -r1.116.2.10
  --- Zip.java	7 Jun 2004 12:29:09 -0000	1.116.2.9
  +++ Zip.java	25 Aug 2004 14:58:10 -0000	1.116.2.10
  @@ -917,13 +917,13 @@
               Vector resources = new Vector();
               String[] directories = rs.getIncludedDirectories();
               for (int j = 0; j < directories.length; j++) {
  -                if (!"".equals(directories[0]) || !skipEmptyNames) {
  +                if (!"".equals(directories[j]) || !skipEmptyNames) {
                       resources.addElement(rs.getResource(directories[j]));
                   }
               }
               String[] files = rs.getIncludedFiles();
               for (int j = 0; j < files.length; j++) {
  -                if (!"".equals(files[0]) || !skipEmptyNames) {
  +                if (!"".equals(files[j]) || !skipEmptyNames) {
                       resources.addElement(rs.getResource(files[j]));
                   }
               }
  
  
  

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


Mime
View raw message