ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r437804 - in /ant/core/trunk: WHATSNEW src/etc/testcases/taskdefs/zip.xml src/main/org/apache/tools/ant/taskdefs/Zip.java src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java
Date Mon, 28 Aug 2006 19:53:35 GMT
Author: mbenson
Date: Mon Aug 28 12:53:35 2006
New Revision: 437804

URL: http://svn.apache.org/viewvc?rev=437804&view=rev
Log:
<zip filesonly="true"> included empty directories.  Bugzilla report 40258.

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/etc/testcases/taskdefs/zip.xml
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java
    ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=437804&r1=437803&r2=437804&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Mon Aug 28 12:53:35 2006
@@ -273,6 +273,8 @@
 * mixing of add and addConfigured methods in Mapper/ChainedMapper
   causes incorrect chaining. Bugzilla report 40228.
 
+* <zip filesonly="true"> included empty directories.  Bugzilla report 40258.
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/src/etc/testcases/taskdefs/zip.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/zip.xml?rev=437804&r1=437803&r2=437804&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/zip.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/zip.xml Mon Aug 28 12:53:35 2006
@@ -157,6 +157,17 @@
     </fail>
   </target>
 
+  <!-- Bugzilla Report 40258 -->
+  <target name="zipEmptyDirFilesOnly">
+    <mkdir dir="empty/empty2" />
+    <zip destfile="test3.zip" basedir="empty" update="true" filesonly="true" />
+    <fail message="archive should get skipped">
+      <condition>
+        <available file="test3.zip" />
+      </condition>
+    </fail>
+  </target>
+
   <target name="zipEmptyCreate">
     <mkdir dir="empty"/>
     <zip destfile="test3.zip" basedir="empty" whenempty="create" includes="*.xyz"/>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java?rev=437804&r1=437803&r2=437804&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java Mon Aug 28 12:53:35 2006
@@ -1269,10 +1269,12 @@
                 ((ZipScanner) rs).setEncoding(encoding);
             }
             Vector resources = new Vector();
-            String[] directories = rs.getIncludedDirectories();
-            for (int j = 0; j < directories.length; j++) {
-                if (!"".equals(directories[j]) || !skipEmptyNames) {
-                    resources.addElement(rs.getResource(directories[j]));
+            if (!doFilesonly) {
+                String[] directories = rs.getIncludedDirectories();
+                for (int j = 0; j < directories.length; j++) {
+                    if (!"".equals(directories[j]) || !skipEmptyNames) {
+                        resources.addElement(rs.getResource(directories[j]));
+                    }
                 }
             }
             String[] files = rs.getIncludedFiles();

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java?rev=437804&r1=437803&r2=437804&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java Mon Aug 28 12:53:35
2006
@@ -137,6 +137,10 @@
     public void testZipEmptyDir() {
         executeTarget("zipEmptyDir");
     }
+    // Bugzilla Report 40258
+    public void testZipEmptyDirFilesOnly() {
+        executeTarget("zipEmptyDirFilesOnly");
+    }
     public void testZipEmptyCreate() {
         expectLogContaining("zipEmptyCreate", "Note: creating empty");
     }



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


Mime
View raw message