Fix for previous Tasks change.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 27 Jan 2002 11:24:56 +0000 (11:24 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 27 Jan 2002 11:24:56 +0000 (11:24 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@225 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Script/__init__.py
src/engine/SCons/Taskmaster.py
test/subdir.py

index f5ddbfe79333429144ce896f133e85c2e004ceea..12a22f4985d4ef345652d2c33b1f9b37bee9faa8 100644 (file)
@@ -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
index aa6fe84522e082b74e30b5a7c828b7688e74cdb1..7ac594b44b3db6c65f785e2134f5137a2ac60d22 100644 (file)
@@ -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())
 
index 318cf827741d251302845427f8e83ae816b666d4..26b1cc968559d760b7356672f761793fc08540ff 100644 (file)
@@ -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")