Browse Source

respect failOnError when running ls checkout - Bugzilla 63071

I've decided to break backwards compatibility with the way I've
overridden runS. The "proper" way would have been to call the one-arg
version from the two-arg version so that subclasses overriding runS
would still get their method called. But I figured it to be extremely
unlikely that such subclasses exist.
master
Stefan Bodewig 6 years ago
parent
commit
9d63d7ee24
3 changed files with 26 additions and 1 deletions
  1. +11
    -0
      WHATSNEW
  2. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCCheckout.java
  3. +14
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java

+ 11
- 0
WHATSNEW View File

@@ -1,6 +1,13 @@
Changes from Ant 1.9.13 TO Ant 1.9.14
=====================================

Changes that could break older environments:
-------------------------------------------

* ClearCase#runS has been augmented by a two arg-version and the
one-arg version will no longer be called. This may affect
subclasses that have overridden runS.

Fixed bugs:
-----------

@@ -16,6 +23,10 @@ Fixed bugs:
an incorrect compression level for a zip entry. This is now fixed.
Bugzilla Report 62686

* cccheckout would ignore an error of the "ls checkout" command even
if failOnError was set to false.
Bugzilla Report 63071

Other changes:
--------------
* generatekey task now supports SubjectAlternativeName during key


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCCheckout.java View File

@@ -168,7 +168,7 @@ public class CCCheckout extends ClearCase {
// viewpath
cmdl.createArgument().setValue(getViewPath());

result = runS(cmdl);
result = runS(cmdl, getFailOnErr());

// System.out.println( "lsCheckout: " + result );



+ 14
- 0
src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java View File

@@ -144,8 +144,21 @@ public abstract class ClearCase extends Task {
* Execute the given command, and return it's output
* @param cmdline command line to execute
* @return output of the command line
* @deprecated use the two arg version instead
*/
@Deprecated
protected String runS(Commandline cmdline) {
return runS(cmdline, false);
}

/**
* Execute the given command, and return it's output
* @param cmdline command line to execute
* @param failOnError whether to fail the build if the command fails
* @return output of the command line
* @since Ant 1.9.14
*/
protected String runS(Commandline cmdline, boolean failOnError) {
String outV = "opts.cc.runS.output" + pcnt++;
ExecTask exe = new ExecTask(this);
Commandline.Argument arg = exe.createArg();
@@ -153,6 +166,7 @@ public abstract class ClearCase extends Task {
exe.setExecutable(cmdline.getExecutable());
arg.setLine(Commandline.toString(cmdline.getArguments()));
exe.setOutputproperty(outV);
exe.setFailonerror(failOnError);
exe.execute();

return getProject().getProperty(outV);


Loading…
Cancel
Save