Change the Building message to say Cleaning when the -c option is used.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Mon, 19 May 2003 03:01:10 +0000 (03:01 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Mon, 19 May 2003 03:01:10 +0000 (03:01 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@688 fdb21ef1-2011-0410-befe-b5e4ea1792b1

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

index df7774946be2addf6d3e64b3f87a9db791025171..1733520a67f766ceaa1a465a8aa7d1b9a6405ba0 100644 (file)
@@ -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.
index a1a54e69c6b6e9a7de32e7531a2a15beb6372f4d..c5e469aa3c2c628a922d425c5c676da6d3fddf8b 100644 (file)
@@ -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():
index 482525d3418e1e3059a4286d81bcbf058556a9b4..c149c2a5b348f367b082dd415b2af9be444f9506 100644 (file)
@@ -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
index 348c20c4e030ba77d19ed4a9fd4cedc514c29f0b..b71648d62b22b785e8bf5414c5a79f8ffbe18bbf 100644 (file)
@@ -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)