Fix a bug when -c is used with -n. (Steve Leblanc)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 25 Jan 2003 07:07:02 +0000 (07:07 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 25 Jan 2003 07:07:02 +0000 (07:07 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@565 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Script/__init__.py
test/option-c.py

index 8f3d990a74d73dd09a6e51aebabbca3f747f1d4d..49346b492136d75cf1adb5cbc08d5a4f99a1d77a 100644 (file)
@@ -42,6 +42,11 @@ RELEASE 0.11 - XXX
   - Fix adding a prefix to a file when the target isn't specified.
     (Bug reported by Esa Ilari Vuokko.)
 
+  From Steve Leblanc:
+
+  - Fix the output of -c -n when directories are involved, so it
+    matches -c.
+
   From Anthony Roach:
 
   - Use a different static object suffix (.os) when using gcc so shared
index 6ea9a3ed6f5fb6792cd029046135f84a3059399b..92572668b096b95a5070fcb5ef021504ca62c206 100644 (file)
@@ -150,12 +150,13 @@ class BuildTask(SCons.Taskmaster.Task):
 class CleanTask(SCons.Taskmaster.Task):
     """An SCons clean task."""
     def show(self):
-        if self.targets[0].has_builder() or self.targets[0].side_effect:
+        if (self.targets[0].has_builder() or self.targets[0].side_effect) \
+           and not os.path.isdir(str(self.targets[0])):
             display("Removed " + str(self.targets[0]))
         if SCons.Script.SConscript.clean_targets.has_key(str(self.targets[0])):
             files = SCons.Script.SConscript.clean_targets[str(self.targets[0])]
             for f in files:
-                SCons.Utils.fs_delete(str(f), 0)
+                SCons.Util.fs_delete(str(f), 0)
 
     def remove(self):
         if self.targets[0].has_builder() or self.targets[0].side_effect:
index 8d7e7772da257921460037a9964d080adbaf33dc..6501d757327470b7b7c5e081ca9f17054e394235 100644 (file)
@@ -186,6 +186,16 @@ expect = test.wrap_stdout("Removed %s\n" % os.path.join('subd', 'foox.in'))
 test.run(arguments = '-c subd', stdout=expect)
 test.fail_test(os.path.exists(test.workpath('foox.in')))
 
+expect = test.wrap_stdout("""Removed foo1.out
+Removed foo2.xxx
+Removed foo2.out
+Removed foo3.out
+Removed %s
+Removed %s
+Removed directory subd
+""" % (os.path.join('subd','foon.in'), os.path.join('subd', 'SConscript')))
+test.run(arguments = '-c -n .', stdout=expect)
+
 expect = test.wrap_stdout("""Removed foo1.out
 Removed foo2.out
 Removed foo3.out