summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-01-27 11:24:56 (GMT)
committerSteven Knight <knight@baldmt.com>2002-01-27 11:24:56 (GMT)
commit47e39e99099af899b36634a6bf13459587f61ba1 (patch)
tree5b5e83abd7a69d3d7ed623fefae19a990aab1a58
parente9a2f2b02f67bf88917d74c9725f8d72b86b7cfc (diff)
downloadSCons-47e39e99099af899b36634a6bf13459587f61ba1.zip
SCons-47e39e99099af899b36634a6bf13459587f61ba1.tar.gz
SCons-47e39e99099af899b36634a6bf13459587f61ba1.tar.bz2
Fix for previous Tasks change.
-rw-r--r--src/engine/SCons/Script/__init__.py20
-rw-r--r--src/engine/SCons/Taskmaster.py2
-rw-r--r--test/subdir.py2
3 files changed, 15 insertions, 9 deletions
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py
index f5ddbfe..12a22f4 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 aa6fe84..7ac594b 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 318cf82..26b1cc9 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")