Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 70056 invoked from network); 16 Apr 2004 09:36:03 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 16 Apr 2004 09:36:03 -0000 Received: (qmail 22791 invoked by uid 500); 16 Apr 2004 09:35:34 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 22749 invoked by uid 500); 16 Apr 2004 09:35:34 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 22733 invoked by uid 500); 16 Apr 2004 09:35:34 -0000 Received: (qmail 22729 invoked from network); 16 Apr 2004 09:35:34 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 16 Apr 2004 09:35:34 -0000 Received: (qmail 70022 invoked by uid 1146); 16 Apr 2004 09:36:00 -0000 Date: 16 Apr 2004 09:36:00 -0000 Message-ID: <20040416093600.70021.qmail@minotaur.apache.org> From: bodewig@apache.org To: ant-cvs@apache.org Subject: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Zip.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N bodewig 2004/04/16 02:36:00 Modified: . Tag: ANT_16_BRANCH WHATSNEW src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH Zip.java Log: merge Revision Changes Path No revision No revision 1.503.2.71 +4 -1 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.503.2.70 retrieving revision 1.503.2.71 diff -u -r1.503.2.70 -r1.503.2.71 --- WHATSNEW 16 Apr 2004 08:36:46 -0000 1.503.2.70 +++ WHATSNEW 16 Apr 2004 09:35:59 -0000 1.503.2.71 @@ -44,7 +44,10 @@ with gcj which has been impossible in Ant < 1.6.2. * now sets the context classloader if you've specified a nested - . Bugzilla report 24802. + . Bugzilla Report 24802. + +* and friends would delete the original file when trying to update + a read-only archive. Bugzilla Report 28419. Other changes: -------------- No revision No revision 1.116.2.7 +8 -0 ant/src/main/org/apache/tools/ant/taskdefs/Zip.java Index: Zip.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Zip.java,v retrieving revision 1.116.2.6 retrieving revision 1.116.2.7 diff -u -r1.116.2.6 -r1.116.2.7 --- Zip.java 9 Mar 2004 17:01:34 -0000 1.116.2.6 +++ Zip.java 16 Apr 2004 09:35:59 -0000 1.116.2.7 @@ -312,6 +312,14 @@ + archiveType + " file to create!"); } + if (zipFile.exists() && !zipFile.isFile()) { + throw new BuildException(zipFile + " is not a file."); + } + + if (zipFile.exists() && !zipFile.canWrite()) { + throw new BuildException(zipFile + " is read-only."); + } + // Renamed version of original file, if it exists File renamedFile = null; // Whether or not an actual update is required - --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org