From: stevenknight Date: Mon, 19 May 2003 03:01:10 +0000 (+0000) Subject: Change the Building message to say Cleaning when the -c option is used. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8fae81d52e54970f734b80b5491e5ad8198ba52d;p=scons.git Change the Building message to say Cleaning when the -c option is used. git-svn-id: http://scons.tigris.org/svn/scons/trunk@688 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index df777494..1733520a 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -90,6 +90,9 @@ RELEASE 0.14 - XXX - Optimize out calling hasattr() before accessing attributes. + - Say "Cleaning targets" (not "Building...") when the -c option is + used. + From Damyan Pepper: - Quote the "Entering directory" message like Make. diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index a1a54e69..c5e469aa 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -908,6 +908,8 @@ def _main(): calc = None task_class = BuildTask # default action is to build targets + opening_message = "Building targets ..." + closing_message = "done building targets." if options.question: task_class = QuestionTask try: @@ -923,6 +925,8 @@ def _main(): def write(self): pass calc = CleanCalculator() + opening_message = "Cleaning targets ..." + closing_message = "done cleaning targets." except AttributeError: pass @@ -946,7 +950,7 @@ def _main(): """Leave the order of dependencies alone.""" return dependencies - display("scons: Building targets ...") + display("scons: " + opening_message) taskmaster = SCons.Taskmaster.Taskmaster(nodes, task_class, calc, order) jobs = SCons.Job.Jobs(ssoptions.get('num_jobs'), taskmaster) @@ -954,7 +958,7 @@ def _main(): try: jobs.run() finally: - display("scons: done building targets.") + display("scons: " + closing_message) SCons.Sig.write() def main(): diff --git a/test/option-c.py b/test/option-c.py index 482525d3..c149c2a5 100644 --- a/test/option-c.py +++ b/test/option-c.py @@ -72,8 +72,15 @@ test.fail_test(test.read(test.workpath('foo2.xxx')) != "foo2.in\n") test.fail_test(test.read(test.workpath('foo2.out')) != "foo2.in\n") test.fail_test(test.read(test.workpath('foo3.out')) != "foo3.in\n") +def wrap_clean_stdout(string): + return "scons: Reading SConscript files ...\n" + \ + "scons: done reading SConscript files.\n" + \ + "scons: Cleaning targets ...\n" + \ + string + \ + "scons: done cleaning targets.\n" + test.run(arguments = '-c foo1.out', - stdout = test.wrap_stdout("Removed foo1.out\n")) + stdout = wrap_clean_stdout("Removed foo1.out\n")) test.fail_test(os.path.exists(test.workpath('foo1.out'))) test.fail_test(not os.path.exists(test.workpath('foo2.xxx'))) @@ -81,7 +88,7 @@ test.fail_test(not os.path.exists(test.workpath('foo2.out'))) test.fail_test(not os.path.exists(test.workpath('foo3.out'))) test.run(arguments = '--clean foo2.out foo2.xxx', - stdout = test.wrap_stdout("Removed foo2.xxx\nRemoved foo2.out\n")) + stdout = wrap_clean_stdout("Removed foo2.xxx\nRemoved foo2.out\n")) test.fail_test(os.path.exists(test.workpath('foo1.out'))) test.fail_test(os.path.exists(test.workpath('foo2.xxx'))) @@ -89,7 +96,7 @@ test.fail_test(os.path.exists(test.workpath('foo2.out'))) test.fail_test(not os.path.exists(test.workpath('foo3.out'))) test.run(arguments = '--remove foo3.out', - stdout = test.wrap_stdout("Removed foo3.out\n")) + stdout = wrap_clean_stdout("Removed foo3.out\n")) test.fail_test(os.path.exists(test.workpath('foo1.out'))) test.fail_test(os.path.exists(test.workpath('foo2.xxx'))) @@ -108,7 +115,7 @@ if hasattr(os, 'symlink'): test.fail_test(not os.path.islink(test.workpath('symlink2'))) test.run(arguments = '-c foo2.xxx', - stdout = test.wrap_stdout("Removed foo2.xxx\n")) + stdout = wrap_clean_stdout("Removed foo2.xxx\n")) test.fail_test(test.read(test.workpath('foo1.out')) != "foo1.in\n") test.fail_test(os.path.exists(test.workpath('foo2.xxx'))) @@ -127,7 +134,7 @@ if hasattr(os, 'symlink'): test.run(arguments = 'foo1.out foo2.out foo3.out') -expect = test.wrap_stdout("""Removed foo1.out +expect = wrap_clean_stdout("""Removed foo1.out Removed foo2.xxx Removed foo2.out Removed foo3.out @@ -145,7 +152,7 @@ test.fail_test(test.read(test.workpath('foo3.out')) != "foo3.in\n") test.writable('.', 0) f = open(test.workpath('foo1.out')) test.run(arguments = '-c foo1.out', - stdout = test.wrap_stdout("scons: Could not remove 'foo1.out': Permission denied\n")) + stdout = wrap_clean_stdout("scons: Could not remove 'foo1.out': Permission denied\n")) test.fail_test(not os.path.exists(test.workpath('foo1.out'))) f.close() test.writable('.', 1) @@ -172,7 +179,7 @@ test.write(['subd', 'SConscript'], """ Clean('.', 'foox.in') """) -expect = test.wrap_stdout("""Removed foo2.xxx +expect = wrap_clean_stdout("""Removed foo2.xxx Removed aux1.x Removed aux2.x """) @@ -182,11 +189,11 @@ test.fail_test(os.path.exists(test.workpath('foo2.xxx'))) test.fail_test(test.read(test.workpath('foo2.out')) != "foo2.in\n") test.fail_test(test.read(test.workpath('foo3.out')) != "foo3.in\n") -expect = test.wrap_stdout("Removed %s\n" % os.path.join('subd', 'foox.in')) +expect = wrap_clean_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 +expect = wrap_clean_stdout("""Removed foo1.out Removed foo2.xxx Removed foo2.out Removed foo3.out @@ -196,7 +203,7 @@ Removed directory subd """ % (os.path.join('subd','SConscript'), os.path.join('subd', 'foon.in'))) test.run(arguments = '-c -n .', stdout=expect) -expect = test.wrap_stdout("""Removed foo1.out +expect = wrap_clean_stdout("""Removed foo1.out Removed foo2.out Removed foo3.out Removed %s diff --git a/test/option-n.py b/test/option-n.py index 348c20c4..b71648d6 100644 --- a/test/option-n.py +++ b/test/option-n.py @@ -111,7 +111,14 @@ test.run(arguments = args) test.fail_test(not os.path.exists(test.workpath('f1.out'))) test.fail_test(not os.path.exists(test.workpath('f2.out'))) -expect = test.wrap_stdout("Removed f1.out\nRemoved f2.out\n") +def wrap_clean_stdout(string): + return "scons: Reading SConscript files ...\n" + \ + "scons: done reading SConscript files.\n" + \ + "scons: Cleaning targets ...\n" + \ + string + \ + "scons: done cleaning targets.\n" + +expect = wrap_clean_stdout("Removed f1.out\nRemoved f2.out\n") test.run(arguments = '-n -c ' + args, stdout = expect)