DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=38918>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ· INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38918 Summary: Add 'real' overwrite support to Zip-based tasks Product: Ant Version: 1.6.5 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P3 Component: Core tasks AssignedTo: dev@ant.apache.org ReportedBy: [EMAIL PROTECTED] When dealing with duplicated zipentries, Zip checks modification times before overwriting the zipentry. If you specify duplicate="add", zipentries will be overwriten only if the present zipentry is older than the one you're trying to add. In some situations it would be nice to override this behaviour and force zip to overwrite zipentries even if the file you're adding is older than the zipentry in the zip file. The following patch should do the trick (please shout if there is a better way of submitting patch suggestions): Index: src/main/org/apache/tools/ant/taskdefs/Zip.java =================================================================== --- src/main/org/apache/tools/ant/taskdefs/Zip.java (revision 384498) +++ src/main/org/apache/tools/ant/taskdefs/Zip.java (working copy) @@ -1130,11 +1130,15 @@ resources = selectFileResources(resources); } - newerResources[i] = - ResourceUtils.selectOutOfDateSources(this, + if(duplicate.equals("overwrite")){ + newerResources[i] = resources; + } else { + newerResources[i] = + ResourceUtils.selectOutOfDateSources(this, resources, myMapper, getZipScanner()); + } needsUpdate = needsUpdate || (newerResources[i].length > 0); if (needsUpdate && !doUpdate) { @@ -1647,7 +1651,7 @@ * @see EnumeratedAttribute#getValues() */ public String[] getValues() { - return new String[] {"add", "preserve", "fail"}; + return new String[] {"add", "preserve", "fail", "overwrite"}; } } -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]