bodewig     2004/04/16 02:35:21

  Modified:    .        WHATSNEW
               src/main/org/apache/tools/ant/taskdefs Zip.java
  Log:
  Don't delete existing file when trying to update a read-only archive, PR: 
28419
  
  Revision  Changes    Path
  1.588     +4 -1      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.587
  retrieving revision 1.588
  diff -u -r1.587 -r1.588
  --- WHATSNEW  16 Apr 2004 08:36:00 -0000      1.587
  +++ WHATSNEW  16 Apr 2004 09:35:21 -0000      1.588
  @@ -114,7 +114,10 @@
     behaved identically.
   
   * <xslt> now sets the context classloader if you've specified a nested
  -  <classpath>.  Bugzilla report 24802.
  +  <classpath>.  Bugzilla Report 24802.
  +
  +* <zip> and friends would delete the original file when trying to update
  +  a read-only archive.  Bugzilla Report 28419.
   
   Other changes:
   --------------
  
  
  
  1.124     +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.123
  retrieving revision 1.124
  diff -u -r1.123 -r1.124
  --- Zip.java  9 Mar 2004 16:48:07 -0000       1.123
  +++ Zip.java  16 Apr 2004 09:35:21 -0000      1.124
  @@ -338,6 +338,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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to