Author: mbenson Date: Fri May 12 12:31:56 2006 New Revision: 405846 URL: http://svn.apache.org/viewcvs?rev=405846&view=rev Log: check file equality before deleting dest file in case of case-insensitive system case changing renames. Bugzilla 37701; submitted by Anthony Goubard.
Modified: ant/core/trunk/CONTRIBUTORS ant/core/trunk/WHATSNEW ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Move.java Modified: ant/core/trunk/CONTRIBUTORS URL: http://svn.apache.org/viewcvs/ant/core/trunk/CONTRIBUTORS?rev=405846&r1=405845&r2=405846&view=diff ============================================================================== Binary files - no diff available. Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewcvs/ant/core/trunk/WHATSNEW?rev=405846&r1=405845&r2=405846&view=diff ============================================================================== --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Fri May 12 12:31:56 2006 @@ -218,6 +218,10 @@ * <unzip> and <untar> now correctly merge multiple nested patternsets. Bugzilla Report 38973. +* On case-insensitive filesystems, a <move> to change filename case + erroneously deleted the "destination" file before attempting to rename + the source file. Bugzilla 37701. + Other changes: -------------- * took in bugzilla report 39320. Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Move.java URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Move.java?rev=405846&r1=405845&r2=405846&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Move.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Move.java Fri May 12 12:31:56 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 The Apache Software Foundation + * Copyright 2000-2006 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -373,7 +373,8 @@ if (parent != null && !parent.exists()) { parent.mkdirs(); } - if (destFile.isFile() && !destFile.delete()) { + if (destFile.isFile() && !destFile.equals(sourceFile) + && !destFile.delete()) { throw new BuildException("Unable to remove existing " + "file " + destFile); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]