From 17528595998088b1104e77a5fcbbedd2c3d9ab54 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Sat, 25 Jan 2003 07:07:02 +0000 Subject: [PATCH] Fix a bug when -c is used with -n. (Steve Leblanc) git-svn-id: http://scons.tigris.org/svn/scons/trunk@565 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 5 +++++ src/engine/SCons/Script/__init__.py | 5 +++-- test/option-c.py | 10 ++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 8f3d990a..49346b49 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -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 diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index 6ea9a3ed..92572668 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -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: diff --git a/test/option-c.py b/test/option-c.py index 8d7e7772..6501d757 100644 --- a/test/option-c.py +++ b/test/option-c.py @@ -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 -- 2.26.2