Browse Source

Bugzilla Bug 43624

symlink task failonerror="false" does not stop build from failing when 'ln' command returns non-zero

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@597455 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 17 years ago
parent
commit
00c53aef12
2 changed files with 14 additions and 1 deletions
  1. +3
    -0
      WHATSNEW
  2. +11
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java

+ 3
- 0
WHATSNEW View File

@@ -46,6 +46,9 @@ Fixed bugs:

* <symlink> task couldn't overwrite files that were in the way of the symlink.
Bugzilla report 43426.
* <symlink> task failonerror="false" does not stop build from failing when 'ln'
command returns non-zero. Bugzilla report 43624

* <touch> task couldn't differentiate between "no resources specified" and "no resources
matched." Bugzilla report 43799.


+ 11
- 1
src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java View File

@@ -443,6 +443,7 @@ public class Symlink extends DispatchTask {
*
* @param properties The properties object to be written.
* @param dir The directory for which we are writing the links.
* @throws BuildException if the property file could not be written
*/
private void writePropertyFile(Properties properties, File dir)
throws BuildException {
@@ -498,7 +499,16 @@ public class Symlink extends DispatchTask {
}
}
String[] cmd = new String[] {"ln", options, res, lnk};
Execute.runCommand(this, cmd);
try {
Execute.runCommand(this, cmd);
} catch (BuildException failedToExecute) {
if(failonerror) {
throw failedToExecute;
} else {
//log at the info level, and keep going.
log(failedToExecute.getMessage(), failedToExecute, Project.MSG_INFO);
}
}
}

/**


Loading…
Cancel
Save