From 635eed875b1b2dbb81410ffcccccc23b81c8b799 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Sun, 27 Jan 2002 11:24:56 +0000 Subject: [PATCH] Fix for previous Tasks change. git-svn-id: http://scons.tigris.org/svn/scons/trunk@225 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/Script/__init__.py | 20 ++++++++++++-------- src/engine/SCons/Taskmaster.py | 2 +- test/subdir.py | 2 ++ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index f5ddbfe7..12a22f49 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -68,12 +68,12 @@ import SCons.Script.SConscript class BuildTask(SCons.Taskmaster.Task): """An SCons build task.""" def execute(self): - if self.target.get_state() == SCons.Node.up_to_date: + if self.targets[0].get_state() == SCons.Node.up_to_date: if self.top: - print 'scons: "%s" is up to date.' % str(self.target) + print 'scons: "%s" is up to date.' % str(self.targets[0]) else: try: - self.target.build() + self.targets[0].build() except BuildError, e: sys.stderr.write("scons: *** [%s] %s\n" % (e.node, e.errstr)) if e.errstr == 'Exception': @@ -87,8 +87,7 @@ class BuildTask(SCons.Taskmaster.Task): # this method is serialized, but execute isn't: if print_tree and self.top: print - print SCons.Util.render_tree(self.target, get_children) - + print SCons.Util.render_tree(self.targets[0], get_children) def failed(self): global ignore_errors @@ -102,9 +101,14 @@ class BuildTask(SCons.Taskmaster.Task): class CleanTask(SCons.Taskmaster.Task): """An SCons clean task.""" def execute(self): - if self.target.builder: - os.unlink(self.target.path) - print "Removed " + self.target.path + if self.targets[0].builder: + os.unlink(self.targets[0].path) + print "Removed " + self.targets[0].path + try: + for t in self.targets[1:]: + os.unlink(t.path) + except IndexError: + pass # Global variables diff --git a/src/engine/SCons/Taskmaster.py b/src/engine/SCons/Taskmaster.py index aa6fe845..7ac594b4 100644 --- a/src/engine/SCons/Taskmaster.py +++ b/src/engine/SCons/Taskmaster.py @@ -131,7 +131,7 @@ class Task: pending = filter(lambda x: x.get_state() == SCons.Node.pending, nodes.keys()) tasks = {} - for t in map(lambda r: r.task, ready): + for t in map(lambda r: r.task, pending): tasks[t] = 1 self.tm.pending_remove(tasks.keys()) diff --git a/test/subdir.py b/test/subdir.py index 318cf827..26b1cc96 100644 --- a/test/subdir.py +++ b/test/subdir.py @@ -54,6 +54,8 @@ test.write(['subdir', 'f3.in'], "f3.in\n") test.write(['subdir', 'f4.in'], "f4.in\n") test.run(arguments = 'subdir') +print test.stdout() +print test.stderr() test.fail_test(test.read(['subdir', 'f1.out']) != "f1.in\n") test.fail_test(test.read(['subdir', 'f2.out']) != "f2.in\n") -- 2.26.2