You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by mb...@apache.org on 2006/08/28 21:53:35 UTC

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

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


Re: 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

Posted by Matt Benson <gu...@yahoo.com>.
Oops... didn't see the Beta1 in WHATSNEW.  Sorry!

-Matt

--- Antoine Levy-Lambert <an...@gmx.de> wrote:

> Hello Matt,
> 
> looks like nice work but ...
> 
> please inaugurate the new section of WHATSNEW.
> 
> Your change should be below :
> 
> Changes from current Ant 1.7.0Beta1 version to
> current SVN version
> 
> not below
> 
> Changes from Ant 1.6.5 to Ant 1.7.0Beta1
> 
> :-)
> 
> Regards,
> 
> Antoine
> -------- Original-Nachricht --------
> Datum: Mon, 28 Aug 2006 19:53:35 -0000
> Von: mbenson@apache.org
> An: ant-cvs@apache.org
> Betreff: 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
> 
> > 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.
> > +
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: 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

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello Matt,

looks like nice work but ...

please inaugurate the new section of WHATSNEW.

Your change should be below :

Changes from current Ant 1.7.0Beta1 version to current SVN version

not below

Changes from Ant 1.6.5 to Ant 1.7.0Beta1

:-)

Regards,

Antoine
-------- Original-Nachricht --------
Datum: Mon, 28 Aug 2006 19:53:35 -0000
Von: mbenson@apache.org
An: ant-cvs@apache.org
Betreff: 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

> 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.
> +

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