From 6df4538ad9367891aeddde4b58d4c92b6a00f4d7 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Sun, 5 Jan 2003 13:11:27 +0000 Subject: [PATCH] Fix problems returning the appropriate exit status on build errors. git-svn-id: http://scons.tigris.org/svn/scons/trunk@534 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- etc/TestSCons.py | 2 +- src/CHANGES.txt | 3 +++ src/engine/SCons/Script/__init__.py | 1 + test/sconsign.py | 4 ++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/etc/TestSCons.py b/etc/TestSCons.py index c97fd482..4b392d47 100644 --- a/etc/TestSCons.py +++ b/etc/TestSCons.py @@ -34,7 +34,7 @@ if os.name == 'posix': def _failed(self, status = 0): if self.status is None: return None - if os.WIFSIGNALED(status): + if os.WIFSIGNALED(self.status): return None return _status(self) != status def _status(self): diff --git a/src/CHANGES.txt b/src/CHANGES.txt index b9c63242..7cb4eb92 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -28,6 +28,9 @@ RELEASE 0.10 - XXX - Don't create duplicate source files in a BuildDir when the -n option is used. + - Fix SCons not exiting with the appropriate status on build errors + (and probably in other situations). + From Steve Leblanc: - Add a Clean() method to support removing user-specified targets diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index 093b82ce..93f4795e 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -88,6 +88,7 @@ class BuildTask(SCons.Taskmaster.Task): print "Command execution time: %f seconds"%(finish_time-start_time) def do_failed(self): + global exit_status if ignore_errors: SCons.Taskmaster.Task.executed(self) elif keep_going_on_error: diff --git a/test/sconsign.py b/test/sconsign.py index 6d88f797..3841ff56 100644 --- a/test/sconsign.py +++ b/test/sconsign.py @@ -90,10 +90,10 @@ scons: warning: Ignoring corrupt .sconsign file: sub1..sconsign stdout = test.wrap_stdout('build1\("sub1/foo.out", "foo.in"\)\n') test.write(sub1__sconsign, 'not:a:sconsign:file') -test.run(arguments = '.', stderr=stderr, stdout=stdout, status=2) +test.run(arguments = '.', stderr=stderr, stdout=stdout) test.write(sub1__sconsign, '\0\0\0\0\0\0\0\0\0\0\0\0\0\0') -test.run(arguments = '.', stderr=stderr, stdout=stdout, status=2) +test.run(arguments = '.', stderr=stderr, stdout=stdout) test.pass_test() -- 2.26.2