diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2008-09-02 14:25:56 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2008-09-02 14:25:56 +0000 |
| commit | 5e7a260ededce9a2f354d5d3337ab819dd456f8e (patch) | |
| tree | 05c1d4808062f6822fd7d99295ab0d3c9efb16a3 /buildtools | |
| parent | 34057cb60a759e59c469c46409c8eebdc27b550c (diff) | |
| download | qpid-python-5e7a260ededce9a2f354d5d3337ab819dd456f8e.tar.gz | |
QPID-1256 : Update to ensure exit is performed when required
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@691259 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'buildtools')
| -rwxr-xr-x | buildtools/buildCreator/buildCreator.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/buildtools/buildCreator/buildCreator.py b/buildtools/buildCreator/buildCreator.py index f71a3fb50b..bebe130343 100755 --- a/buildtools/buildCreator/buildCreator.py +++ b/buildtools/buildCreator/buildCreator.py @@ -171,7 +171,6 @@ def main(): checkSystemRequirements() - if (len(args) > 2): showUsage() sys.exit(1) @@ -279,7 +278,7 @@ def prepareEnvironment(env): if _rootDir == "": verbose (ROOTDIR+" value is empty. Please specify a value for "+ ROOTDIR) - doExit(0) + attemptExit(0) if (os.path.exists(_rootDir)): verbose ("Using Existing root dir: "+_rootDir) @@ -545,7 +544,7 @@ def postProcess(item, destination): if firstline.find(TAR_DATA) != -1: extractcommand=TAR_BIN+" -vxf "+root+PATH_SEP+file+" -C "+ builddir - if firstline.find(DIFF_FILE) != -1: + if firstline.find(DIFF_FILE) != -1 or firstline.find("text"): extractcommand=CP_BIN+" -r "+root+PATH_SEP+file+" "+ builddir @@ -762,7 +761,7 @@ def runScript(script): warn("Script Failed") - doExit(1) + attemptExit(1) ################################################################################ @@ -878,7 +877,7 @@ def getIncludeValue(include): else: for line in stderr: warn(line) - doExit(1) + attemptExit(1) # # Given a file name parse the XML. Any trailing '\n's that the ls command may have added are removed here. @@ -1030,7 +1029,7 @@ def runCommandShowError(command): while current != lines: log (last20[current]) current = current + 1 - doExit(1) + attemptExit(1) # # Runs the given command if showOutput is true then stdout/stderr is shown on screen @@ -1100,6 +1099,7 @@ def runCommand(command, showOutput): logWaitingDone() else: logWaitingFailed("Failed") + attemptExit(1) if not showOutput: last20[0]=index return last20 @@ -1108,7 +1108,7 @@ def runCommand(command, showOutput): except IOError: logWaitingFailed ("Error running command.") - doExit(1) + attemptExit(1) # # Runs the given command if showOutput is true then stdout/stderr is shown on screen @@ -1161,9 +1161,11 @@ def runCommandWithOutput(command): # # Check _ignoreErrors value and exit if false # -def doExit(code): +def attemptExit(code): if not _ignoreErrors: sys.exit(code) + else: + print ("Ignoring Errors") # # Check that the required binaries are present for this tool. @@ -1296,7 +1298,7 @@ def warn (string): def fatal(string): print string - doExit(1) + attemptExit(1) def log_no_newline (string): if _log: @@ -1314,4 +1316,4 @@ def debug_no_newline (string): sys.stdout.flush() if __name__ == "__main__": - main()
\ No newline at end of file + main() |
