diff options
author | Steven Knight <knight@baldmt.com> | 2001-10-10 21:50:55 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2001-10-10 21:50:55 (GMT) |
commit | 385aabf686d687432fb81fa2e68b77e3f11f06f8 (patch) | |
tree | 319adfb4dc23d8c7b1e55fb2e691898d8b544481 /src/script | |
parent | f72203b4610a100fce3065f5c5c4c41e92fc5883 (diff) | |
download | SCons-385aabf686d687432fb81fa2e68b77e3f11f06f8.zip SCons-385aabf686d687432fb81fa2e68b77e3f11f06f8.tar.gz SCons-385aabf686d687432fb81fa2e68b77e3f11f06f8.tar.bz2 |
Add -i (ignore errors) support
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/scons.py | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/src/script/scons.py b/src/script/scons.py index cd81d49..65b9495 100644 --- a/src/script/scons.py +++ b/src/script/scons.py @@ -61,6 +61,9 @@ class BuildTask(SCons.Taskmaster.Task): except BuildError, e: sys.stderr.write("scons: *** [%s] Error %d\n" % (e.node, e.stat)) raise + + def set_state(self, state): + return self.target.set_state(state) class CleanTask(SCons.Taskmaster.Task): """An SCons clean task.""" @@ -73,21 +76,23 @@ class ScriptTaskmaster(SCons.Taskmaster.Taskmaster): """Controlling logic for tasks. This is the stock Taskmaster from the build engine, except - that we override the next_task() method to provide our - script-specific up-to-date message for command-line targets. + that we override the up_to_date() method to provide our + script-specific up-to-date message for command-line targets, + and failed to provide the ignore-errors feature. """ - def next_task(self): - t, top = SCons.Taskmaster.Taskmaster.next_node(self) - while t != None: - if not self.current(t): - return self.tasker(t) - elif top: - print 'scons: "%s" is up to date.' % t - t, top = SCons.Taskmaster.Taskmaster.next_node(self) - return None - - - + def up_to_date(self, node, top): + if top: + print 'scons: "%s" is up to date.' % node + SCons.Taskmaster.Taskmaster.up_to_date(self, node) + + def failed(self, task): + if self.ignore_errors: + SCons.Taskmaster.Taskmaster.executed(self, task) + else: + SCons.Taskmaster.Taskmaster.failed(self, task) + + ignore_errors = 0 + # Global variables default_targets = [] @@ -371,7 +376,10 @@ def options_init(): short = 'H', long = ['help-options'], help = "Print this message and exit.") - Option(func = opt_not_yet, + def opt_i(opt, arg): + ScriptTaskmaster.ignore_errors = 1 + + Option(func = opt_i, short = 'i', long = ['ignore-errors'], help = "Ignore errors from build actions.") |