ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant Project.java
Date Wed, 04 Jul 2001 14:40:30 GMT
bodewig     01/07/04 07:40:29

  Modified:    .        WHATSNEW
               src/main/org/apache/tools/ant Project.java
  Log:
  delete existing target files before copying - this avoids overwriting
  symlinks and is consistent with Unix's cp(1).
  
  PR: 624
  Submitted by:	ederksen@arrow.lz.att.com (Enno Derksen)
  
  Revision  Changes    Path
  1.118     +3 -0      jakarta-ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
  retrieving revision 1.117
  retrieving revision 1.118
  diff -u -r1.117 -r1.118
  --- WHATSNEW	2001/07/04 10:33:23	1.117
  +++ WHATSNEW	2001/07/04 14:40:25	1.118
  @@ -139,6 +139,9 @@
   * <jjtree>'s uptodate test works even if outputdirectory is not the
     parent dir of target
   
  +* <copy> will remove target file (if it exists) before writing to it -
  +  this avoids problems with links on filesystems that support them.
  +
   Changes from Ant 1.2 to Ant 1.3
   ===========================================
   
  
  
  
  1.60      +6 -1      jakarta-ant/src/main/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- Project.java	2001/06/26 13:42:11	1.59
  +++ Project.java	2001/07/04 14:40:28	1.60
  @@ -752,8 +752,13 @@
                            boolean overwrite, boolean preserveLastModified)
           throws IOException {
           
  -        if (overwrite ||
  +        if (overwrite || !destFile.exists() ||
               destFile.lastModified() < sourceFile.lastModified()) {
  +
  +            if (destFile.exists()) {
  +                destFile.delete();
  +            }
  +
               log("Copy: " + sourceFile.getAbsolutePath() + " -> "
                       + destFile.getAbsolutePath(), MSG_VERBOSE);
   
  
  
  

Mime
View raw message