Browse Source

Temporary zip files used for update weren't being deleted, as doUpdate is reset during cleanUp.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271574 13f79535-47bb-0310-9956-ffa450edef68
master
Jon Skeet 23 years ago
parent
commit
7c944a3a40
1 changed files with 8 additions and 8 deletions
  1. +8
    -8
      src/main/org/apache/tools/ant/taskdefs/Zip.java

+ 8
- 8
src/main/org/apache/tools/ant/taskdefs/Zip.java View File

@@ -331,6 +331,14 @@ public class Zip extends MatchingTask {
addFiles(tmp, zOut);
}
finalizeZipOutputStream(zOut);
// If we've been successful on an update, delete the temporary file
if (doUpdate) {
if (!renamedFile.delete()) {
log ("Warning: unable to delete temporary file " +
renamedFile.getName(), Project.MSG_WARN);
}
}
success = true;
} finally {
// Close the output stream.
@@ -369,14 +377,6 @@ public class Zip extends MatchingTask {
} finally {
cleanUp();
}

// If we've been successful on an update, delete the temporary file
if (success && doUpdate) {
if (!renamedFile.delete()) {
log ("Warning: unable to delete temporary file " +
renamedFile.getName(), Project.MSG_WARN);
}
}
}

/**


Loading…
Cancel
Save