Author: bodewig
Date: Fri Aug 21 04:00:33 2009
New Revision: 806414

URL: http://svn.apache.org/viewvc?rev=806414&view=rev
Log:
set default permission in zip task like the other tasks do

Modified:
    
ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Zip.java
    ant/sandbox/antlibs/compress/trunk/src/tests/antunit/zip-test.xml

Modified: 
ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Zip.java
URL: 
http://svn.apache.org/viewvc/ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Zip.java?rev=806414&r1=806413&r2=806414&view=diff
==============================================================================
--- 
ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Zip.java
 (original)
+++ 
ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Zip.java
 Fri Aug 21 04:00:33 2009
@@ -20,6 +20,7 @@
 
 import org.apache.ant.compress.util.ZipStreamFactory;
 import org.apache.commons.compress.archivers.ArchiveEntry;
+import org.apache.commons.compress.archivers.zip.UnixStat;
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
 
 /**
@@ -43,6 +44,12 @@
                     } else if (isDir
                                && r.getCollectionFlags().hasDirModeBeenSet()) {
                         ent.setUnixMode(r.getCollectionFlags().getDirMode());
+                    } else if (isDir) {
+                        ent.setUnixMode(UnixStat.DIR_FLAG
+                                        | UnixStat.DEFAULT_DIR_PERM);
+                    } else {
+                        ent.setUnixMode(UnixStat.FILE_FLAG
+                                        | UnixStat.DEFAULT_FILE_PERM);
                     }
 
                     if (r.getResourceFlags().getZipExtraFields() != null) {

Modified: ant/sandbox/antlibs/compress/trunk/src/tests/antunit/zip-test.xml
URL: 
http://svn.apache.org/viewvc/ant/sandbox/antlibs/compress/trunk/src/tests/antunit/zip-test.xml?rev=806414&r1=806413&r2=806414&view=diff
==============================================================================
--- ant/sandbox/antlibs/compress/trunk/src/tests/antunit/zip-test.xml (original)
+++ ant/sandbox/antlibs/compress/trunk/src/tests/antunit/zip-test.xml Fri Aug 
21 04:00:33 2009
@@ -28,7 +28,7 @@
     <macrodef name="checkProperties">
       <attribute name="dateTime"/>
       <!-- FIXME -->
-      <attribute name="mode" default="0"/>
+      <attribute name="mode" default="33188"/>
       <sequential>
         <au:assertTrue>
           <cond:islastmodified datetime="@{dateTime}"


Reply via email to