Browse Source

Create parent directories for destination files if they are missing.

PR: 20840


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274695 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
a39aaa86b6
2 changed files with 15 additions and 4 deletions
  1. +9
    -4
      WHATSNEW
  2. +6
    -0
      src/main/org/apache/tools/ant/taskdefs/FixCRLF.java

+ 9
- 4
WHATSNEW View File

@@ -109,8 +109,8 @@ Fixed bugs:
* The <replacetokens> filter would throw an exception if the token's
value was an empty string. Bugzilla Report 18625.

* Perforce tasks relying on output from the server such as <p4change> and <p4label>
were hanging. Bugzilla Reports 18129 and 18956.
* Perforce tasks relying on output from the server such as <p4change>
and <p4label> were hanging. Bugzilla Reports 18129 and 18956.

* build.sh install had a problem on cygwin (with REALANTHOME).
Bugzilla Report 17257
@@ -121,7 +121,8 @@ Fixed bugs:
* file names that include spaces need to be quoted inside the @argfile
argument using forked <javac> and (all JDKS). Bugzilla Report 10499.
NB : a first correction was only introducing quotes for JDK 1.4
It has been changed to quote for all external compilers when paths contain spaces.
It has been changed to quote for all external compilers when paths
contain spaces.
Also the backslashes need to be converted to forward slashes
Bugzilla Report 17683.

@@ -168,6 +169,9 @@ Fixed bugs:
* <unzip>'s and <untar>'s nested patternsets didn't work as documented
when the pattern ended in a slash or backslash. Bugzilla Report 20969.

* <fixcrlf> will now create the parent directories for the destination
files if necessary. Bugzilla Report 20840.

Other changes:
--------------
* Six new Clearcase tasks added.
@@ -424,7 +428,8 @@ Bugzilla Report 19180.
if ejbjar has cmpversion="2.0" set
Bugzilla Reports 14707 and 14709.

* <pvcs> config attribute added to set the location of a specific PVCS .cfg file
* <pvcs> config attribute added to set the location of a specific PVCS
.cfg file
Bugzilla Report 9752

* <mapper> has an "unpackage" mapper


+ 6
- 0
src/main/org/apache/tools/ant/taskdefs/FixCRLF.java View File

@@ -580,6 +580,12 @@ public class FixCRLF extends MatchingTask {
}
} else { // destFile does not exist - write the temp file
log("destFile does not exist", Project.MSG_DEBUG);

File parent = fileUtils.getParentFile(destFile);
if (!parent.exists()) {
parent.mkdirs();
}

if (!tmpFile.renameTo(destFile)) {
throw new BuildException(
"Failed to transform " + srcFile


Loading…
Cancel
Save