Commits

Anonymous committed 951d88f

Change the double quotes around an up-to-date target to be like Make.

  • Participants
  • Parent commits 46e4d32

Comments (0)

Files changed (30)

     def up_to_date(self, options = None, arguments = None, **kw):
         s = ""
         for arg in string.split(arguments):
-            s = s + 'scons: "%s" is up to date.\n' % arg
+            s = s + "scons: `%s' is up to date.\n" % arg
             if options:
                 arguments = options + " " + arguments
         kw['arguments'] = arguments
 
 aegis = whereis('aegis')
 
-spe = None
+sp = []
+spe = []
 if aegis:
+    sp = os.popen("aesub '$sp' 2>/dev/null", "r").read()[:-1]
+    sp = string.split(sp, os.pathsep)
     spe = os.popen("aesub '$spe' 2>/dev/null", "r").read()[:-1]
     spe = string.split(spe, os.pathsep)
 
 os.environ['SCONS_VERSION'] = version
 
 old_pythonpath = os.environ.get('PYTHONPATH')
-os.environ['PYTHONPATH'] = pythonpath_dir + \
-                           os.pathsep + \
-                           os.path.join(cwd, 'build', 'etc') + \
-                           os.pathsep + \
-                           os.path.join(cwd, 'etc')
+
+pythonpaths = [ pythonpath_dir ]
+for p in sp:
+    pythonpaths.append(os.path.join(p, 'build', 'etc'))
+    pythonpaths.append(os.path.join(p, 'etc'))
+os.environ['PYTHONPATH'] = string.join(pythonpaths, os.pathsep)
+
 if old_pythonpath:
     os.environ['PYTHONPATH'] = os.environ['PYTHONPATH'] + \
                                os.pathsep + \
   - Make the Script.Options() subclass match the underlying base class
     implementation.
 
+  - When reporting a target is up to date, quote the target like make
+    (backquote-quote) instead of with double quotes.
+
   From Steve Leblanc:
 
   - Don't update the .sconsign files when run with -n.

src/engine/SCons/Script/__init__.py

         target = self.targets[0]
         if target.get_state() == SCons.Node.up_to_date:
             if self.top and target.has_builder():
-                display('scons: "%s" is up to date.' % str(target))
+                display("scons: `%s' is up to date." % str(target))
         elif target.has_builder() and not hasattr(target.builder, 'status'):
             if print_time:
                 start_time = time.time()
     test.run(program = bar52, stdout = " b2.for\n")
 
 test.run(chdir='work1', arguments='. ../build', stdout=test.wrap_stdout("""\
-scons: "." is up to date.
-scons: "%s" is up to date.
+scons: `.' is up to date.
+scons: `%s' is up to date.
 """ % test.workpath('build')))
 
 import os
                                  stdout = "f4.c 2\n")
 
 test.run(chdir='work1', arguments='../build/var5', stdout=test.wrap_stdout("""\
-scons: "%s" is up to date.
+scons: `%s' is up to date.
 """ % test.workpath('build', 'var5')))
 
 #
 """)
 
 test.run(chdir='work3',
-         stdout=test.wrap_stdout('scons: "." is up to date.\n'),
+         stdout=test.wrap_stdout("scons: `.' is up to date.\n"),
          stderr="""\
 existing.h:/* a header file */
 non_existing.h:

test/Configure.py

      Exit(1)
 """ % (lib,lib))
 
-    required_stdout = test.wrap_stdout(build_str='scons: "." is up to date.\n',
+    required_stdout = test.wrap_stdout(build_str="scons: `.' is up to date.\n",
                                        read_str=
     """Checking for main(); in library %s (header math.h) ... ok
 Checking for main(); in library None (header math.h) ... ok
      Exit(1)
 """)
 
-    required_stdout = test.wrap_stdout(build_str='scons: "." is up to date.\n',
+    required_stdout = test.wrap_stdout(build_str="scons: `.' is up to date.\n",
                                        read_str=
     """Checking for C header no_std_c_header.h ... failed
 Checking for main in library no_c_library_SAFFDG ... failed
 
 test 4
 
-""", build_str = 'scons: "." is up to date.\n')
+""", build_str = "scons: `.' is up to date.\n")
 
 test.run(arguments = ".", stdout = expect)
 

test/ParseConfig.py

 ['xxx']
 ['-X']
 ['abc']
-""", build_str = 'scons: "." is up to date.\n')
+""", build_str = "scons: `.' is up to date.\n")
 
 test.run(arguments = ".", stdout = good_stdout)
 
 '.lib'
 '.a'
 '.lib'
-""", build_str = 'scons: "." is up to date.\n')
+""", build_str = "scons: `.' is up to date.\n")
 
 test.run(arguments = ".", stdout = expect)
 

test/Repository/option-n.py

 #
 expect = test.wrap_stdout("""\
 Local copy of aaa.out from %s
-scons: "aaa.out" is up to date.
+scons: `aaa.out' is up to date.
 """ % repository_aaa_out)
 
 test.run(chdir = 'work',

test/SConscript.py

 
 test.run(arguments = ".",
          stdout = test.wrap_stdout(read_str = 'SConstruct %s\nSConscript %s\n' % (wpath, wpath),
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 # Test exporting all global variables as a list of keys:
 test.write("SConstruct", """

test/SConstruct.py

 
 test.run(arguments = ".",
          stdout = test.wrap_stdout(read_str = 'sconstruct %s\n' % wpath,
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 
 test.write('Sconstruct', """
 
 test.run(arguments = ".",
          stdout = test.wrap_stdout(read_str = 'Sconstruct %s\n' % wpath,
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 test.write('SConstruct', """
 import os
 
 test.run(arguments = ".",
          stdout = test.wrap_stdout(read_str = 'SConstruct %s\n' % wpath,
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 test.pass_test()
 """)
 
 # Execute a subsidiary SConscript just to make sure we can
-# get at the SCanners keyword from there.
+# get at the Scanner keyword from there.
 
 test.write('SConstruct', """
 SConscript('SConscript')
 
 test.fail_test(test.read('bar') != "yyy 2\nbar.in 1 line 2\nbar.in 1 line 3\nzzz 2\n")
 
-test.run(arguments = 'foo',
-         stdout=test.wrap_stdout('scons: "foo" is up to date.\n'))
+test.up_to_date(arguments = 'foo')
 
 test.pass_test()

test/SetBuildSignatureType.py

          stderr=warning%16)
 
 test.run(arguments='foo.out.out',
-         stdout=test.wrap_stdout('scons: "foo.out.out" is up to date.\n'),
+         stdout=test.wrap_stdout("scons: `foo.out.out' is up to date.\n"),
          stderr=warning%16)
 
 test.write('SConstruct', """
 test.run(arguments='foo.out.out',
          stdout=test.wrap_stdout("""\
 copy2("foo.out", "foo.in")
-scons: "foo.out.out" is up to date.
+scons: `foo.out.out' is up to date.
 """),
          stderr=warning%17)
 

test/SetContentSignatureType.py

 
 test.run(arguments = 'f1.out f2.out f3.out f4.out',
          stdout = test.wrap_stdout("""\
-scons: "f1.out" is up to date.
+scons: `f1.out' is up to date.
 build("f2.out", "f2.in")
-scons: "f3.out" is up to date.
+scons: `f3.out' is up to date.
 build("f4.out", "f4.in")
 """),
          stderr = warning%11)
 test.run(arguments = 'f1.out f2.out f3.out f4.out',
          stdout = test.wrap_stdout("""\
 build("f1.out", "f1.in")
-scons: "f2.out" is up to date.
+scons: `f2.out' is up to date.
 build("f3.out", "f3.in")
-scons: "f4.out" is up to date.
+scons: `f4.out' is up to date.
 """),
          stderr = warning%11)
 
 
 test.run(arguments = 'f1.out f2.out f3.out f4.out',
          stdout = test.wrap_stdout("""\
-scons: "f1.out" is up to date.
+scons: `f1.out' is up to date.
 build("f2.out", "f2.in")
-scons: "f3.out" is up to date.
+scons: `f3.out' is up to date.
 build("f4.out", "f4.in")
 """),
          stderr = warning%11)
           os.path.getmtime(test.workpath('f3.in'))+10))
 
 test.run(arguments = 'f1.out f2.out f3.out f4.out',
-         stdout = test.wrap_stdout('scons: "f1.out" is up to date.\nscons: "f2.out" is up to date.\nscons: "f3.out" is up to date.\nscons: "f4.out" is up to date.\n'),
+         stdout = test.wrap_stdout("""\
+scons: `f1.out' is up to date.
+scons: `f2.out' is up to date.
+scons: `f3.out' is up to date.
+scons: `f4.out' is up to date.
+"""),
          stderr = warning%11)
 
 test.write('SConstruct', """
 env.B(target = 'f4.out', source = 'f4.in')
 """)
 
-test.run(arguments = 'f1.out f2.out f3.out f4.out',
-         stdout = test.wrap_stdout("""\
-scons: "f1.out" is up to date.
-scons: "f2.out" is up to date.
-scons: "f3.out" is up to date.
-scons: "f4.out" is up to date.
-"""))
+test.up_to_date(arguments = 'f1.out f2.out f3.out f4.out')
 
 test.pass_test()
 

test/SourceSignatures.py

 
 test.run(arguments = 'f1.out f2.out f3.out f4.out',
          stdout = test.wrap_stdout("""\
-scons: "f1.out" is up to date.
+scons: `f1.out' is up to date.
 build("f2.out", "f2.in")
-scons: "f3.out" is up to date.
+scons: `f3.out' is up to date.
 build("f4.out", "f4.in")
 """))
 
 test.run(arguments = 'f1.out f2.out f3.out f4.out',
          stdout = test.wrap_stdout("""\
 build("f1.out", "f1.in")
-scons: "f2.out" is up to date.
+scons: `f2.out' is up to date.
 build("f3.out", "f3.in")
-scons: "f4.out" is up to date.
+scons: `f4.out' is up to date.
 """))
 
 test.write('SConstruct', """
 
 test.run(arguments = 'f1.out f2.out f3.out f4.out',
          stdout = test.wrap_stdout("""\
-scons: "f1.out" is up to date.
+scons: `f1.out' is up to date.
 build("f2.out", "f2.in")
-scons: "f3.out" is up to date.
+scons: `f3.out' is up to date.
 build("f4.out", "f4.in")
 """))
 
          (os.path.getatime(test.workpath('f3.in')),
           os.path.getmtime(test.workpath('f3.in'))+10))
 
-test.run(arguments = 'f1.out f2.out f3.out f4.out',
-         stdout = test.wrap_stdout('scons: "f1.out" is up to date.\nscons: "f2.out" is up to date.\nscons: "f3.out" is up to date.\nscons: "f4.out" is up to date.\n'))
+test.up_to_date(arguments = 'f1.out f2.out f3.out f4.out')
 
 test.write('SConstruct', """
 def build(env, target, source):
 env.B(target = 'f4.out', source = 'f4.in')
 """)
 
-test.run(arguments = 'f1.out f2.out f3.out f4.out',
-         stdout = test.wrap_stdout("""\
-scons: "f1.out" is up to date.
-scons: "f2.out" is up to date.
-scons: "f3.out" is up to date.
-scons: "f4.out" is up to date.
-"""))
+test.up_to_date(arguments = 'f1.out f2.out f3.out f4.out')
 
 test.pass_test()
 
 
 test.run(arguments = ".",
          stdout = test.wrap_stdout(read_str = expect,
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 test.pass_test()

test/TargetSignatures.py

 copy1("foo.out.out", "foo.out")
 """))
 
-test.run(arguments='foo.out.out',
-         stdout=test.wrap_stdout('scons: "foo.out.out" is up to date.\n'))
+test.up_to_date(arguments='foo.out.out')
 
 test.write('SConstruct', """
 env = Environment()
 test.run(arguments='foo.out.out',
          stdout=test.wrap_stdout("""\
 copy2("foo.out", "foo.in")
-scons: "foo.out.out" is up to date.
+scons: `foo.out.out' is up to date.
 """))
 
 test.write('SConstruct', """
 
 test.run(arguments = ".",
          stdout = test.wrap_stdout(read_str = string.join(expect, "\n") + "\n",
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 os.environ['PATH'] = string.join(pathdirs_1243, os.pathsep)
 
 
 test.run(arguments = ".",
          stdout = test.wrap_stdout(read_str = string.join(expect, "\n") + "\n",
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 test.pass_test()

test/chained-build.py

 test.run(arguments="--max-drift=0 -f SConstruct2 foo.out",
          stdout = test.wrap_stdout('build("foo.out", "foo.mid")\n'))
 
-test.run(arguments="--max-drift=0 -f SConstruct1 foo.mid",
-         stdout = test.wrap_stdout('scons: "foo.mid" is up to date.\n'))
-test.run(arguments="--max-drift=0 -f SConstruct2 foo.out",
-         stdout = test.wrap_stdout('scons: "foo.out" is up to date.\n'))
+test.up_to_date(options="--max-drift=0 -f SConstruct1", arguments="foo.mid")
+test.up_to_date(options="--max-drift=0 -f SConstruct2", arguments="foo.out")
 
 test.write('foo.in', "foo.in 2")
 
 test.run(arguments="--max-drift=0 -f SConstruct2 foo.out",
          stdout = test.wrap_stdout('build("foo.out", "foo.mid")\n'))
 
-test.run(arguments="--max-drift=0 -f SConstruct1 foo.mid",
-         stdout = test.wrap_stdout('scons: "foo.mid" is up to date.\n'))
-test.run(arguments="--max-drift=0 -f SConstruct2 foo.out",
-         stdout = test.wrap_stdout('scons: "foo.out" is up to date.\n'))
+test.up_to_date(options="--max-drift=0 -f SConstruct1", arguments="foo.mid")
+test.up_to_date(options="--max-drift=0 -f SConstruct2", arguments="foo.out")
 
 test.pass_test()
 test.run(arguments='foo.out exit.out', stderr=stderr, status=2)
 
 test.run(arguments='foo.out exit.out', stderr=stderr, status=2)
-assert string.find(test.stdout(), 'scons: "foo.out" is up to date.') != -1, test.stdout()
+assert string.find(test.stdout(), "scons: `foo.out' is up to date.") != -1, test.stdout()
 
 
 
 
 """
 
-expected_output = test.wrap_stdout('scons: "." is up to date.\n') + \
+expected_output = test.wrap_stdout("scons: `.' is up to date.\n") + \
 """running x3('no kwd args', kwd=None)
 running x3(5, kwd='bar')
 running x2(12)

test/option--C.py

 
 test.run(arguments = '-C sub .',
 	 stdout = test.wrap_stdout(read_str = '%s\n' % wpath,
-	                           build_str = 'scons: "." is up to date.\n'))
+	                           build_str = "scons: `.' is up to date.\n"))
 
 test.run(arguments = '-C sub -C dir .',
 	 stdout = test.wrap_stdout(read_str = '%s\n' % wpath_sub,
-	                           build_str = 'scons: "." is up to date.\n'))
+	                           build_str = "scons: `.' is up to date.\n"))
 
 test.run(arguments = ".",
 	 stdout = test.wrap_stdout(read_str = 'SConstruct %s\n' % wpath,
-	                           build_str = 'scons: "." is up to date.\n'))
+	                           build_str = "scons: `.' is up to date.\n"))
 
 test.run(arguments = '--directory=sub/dir .',
 	 stdout = test.wrap_stdout(read_str = '%s\n' % wpath_sub,
-	                           build_str = 'scons: "." is up to date.\n'))
+	                           build_str = "scons: `.' is up to date.\n"))
 
 test.run(arguments = '-C %s -C %s .' % (wpath_sub_dir, wpath_sub),
 	 stdout = test.wrap_stdout(read_str = '%s\n' % wpath,
-	                           build_str = 'scons: "." is up to date.\n'))
+	                           build_str = "scons: `.' is up to date.\n"))
 
 test.pass_test()
  

test/option--I.py

 
 test.run(arguments = '-I sub1 -I sub2 .',
          stdout = test.wrap_stdout(read_str = 'sub1/foo\nsub2/bar\n',
-	                           build_str = 'scons: "." is up to date.\n'))
+	                           build_str = "scons: `.' is up to date.\n"))
 
 test.run(arguments = '--include-dir=sub2 --include-dir=sub1 .',
 	 stdout = test.wrap_stdout(read_str = 'sub2/foo\nsub2/bar\n',
-	                           build_str = 'scons: "." is up to date.\n'))
+	                           build_str = "scons: `.' is up to date.\n"))
 
 test.pass_test()
  

test/option--debug.py

 test.run(arguments = "--debug=includes .")
 test.run(arguments = "--debug=includes foo.c")
 
-tree = """scons: \".\" is up to date.
+tree = """scons: `.' is up to date.
 
 +-.
   +-SConstruct

test/option--max-drift.py

 
 test.run(arguments = 'f1.out f2.out',
          stdout = test.wrap_stdout(
-"""scons: "f1.out" is up to date.
+"""scons: `f1.out' is up to date.
 %s build.py f2.out f2.in
 """ % python))
 
 atime = os.path.getatime(test.workpath('f1.in'))
 mtime = os.path.getmtime(test.workpath('f1.in'))
 
-test.run(arguments = '--max-drift=0 f1.out f2.out',
-         stdout = test.wrap_stdout(
-"""scons: "f1.out" is up to date.
-scons: "f2.out" is up to date.
-"""))
+test.up_to_date(options='--max-drift=0', arguments='f1.out f2.out')
 
 test.write('f1.in', "f1.in delta\n")
 os.utime(test.workpath('f1.in'), (atime,mtime))
 
-test.run(arguments = '--max-drift=0 f1.out f2.out',
-         stdout = test.wrap_stdout(
-"""scons: "f1.out" is up to date.
-scons: "f2.out" is up to date.
-"""))
+test.up_to_date(options='--max-drift=0', arguments='f1.out f2.out')
 
 test.run(arguments = '--max-drift=-1 f1.out f2.out',
          stdout = test.wrap_stdout(
 """%s build.py f1.out f1.in
-scons: "f2.out" is up to date.
+scons: `f2.out' is up to date.
 """ % python))
 
 # Test that Set/GetOption('max_drift') works:
 
 test.run(arguments = '-f SConscript .',
          stdout = test.wrap_stdout(read_str = 'SConscript %s\n' % wpath,
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 test.run(arguments = '-f %s .' % subdir_BuildThis,
          stdout = test.wrap_stdout(read_str = 'subdir/BuildThis %s\n' % wpath,
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 test.run(arguments = '--file=SConscript .',
          stdout = test.wrap_stdout(read_str = 'SConscript %s\n' % wpath,
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 test.run(arguments = '--file=%s .' % subdir_BuildThis,
          stdout = test.wrap_stdout(read_str = 'subdir/BuildThis %s\n' % wpath,
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 test.run(arguments = '--makefile=SConscript .',
          stdout = test.wrap_stdout(read_str = 'SConscript %s\n' % wpath,
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 test.run(arguments = '--makefile=%s .' % subdir_BuildThis,
          stdout = test.wrap_stdout(read_str = 'subdir/BuildThis %s\n' % wpath,
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 test.run(arguments = '--sconstruct=SConscript .',
          stdout = test.wrap_stdout(read_str = 'SConscript %s\n' % wpath,
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 test.run(arguments = '--sconstruct=%s .' % subdir_BuildThis,
          stdout = test.wrap_stdout(read_str = 'subdir/BuildThis %s\n' % wpath,
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 test.run(arguments = '-f - .', stdin = """
 import os
 print "STDIN " + os.getcwd()
 """,
          stdout = test.wrap_stdout(read_str = 'STDIN %s\n' % wpath,
-                                   build_str = 'scons: "." is up to date.\n'))
+                                   build_str = "scons: `.' is up to date.\n"))
 
 test.run(arguments = '-f no_such_file .',
-         stdout = test.wrap_stdout('scons: "." is up to date.\n'),
+         stdout = test.wrap_stdout("scons: `.' is up to date.\n"),
          stderr = "Ignoring missing SConscript 'no_such_file'\n")
 
 test.pass_test()
 
 # test that no error is raised, if all targets are up-to-date. In this
 # case .cache and config.log shouldn't be created
-stdout=test.wrap_stdout(build_str='scons: "." is up to date.\n',
+stdout=test.wrap_stdout(build_str="scons: `.' is up to date.\n",
                         read_str="""\
 Executing Custom Test ... ok
 """)

test/timestamp-fallback.py

 
 test.run(arguments = 'f1.out f2.out f3.out f4.out',
          stdout = test.wrap_stdout("""\
-scons: "f1.out" is up to date.
+scons: `f1.out' is up to date.
 build("f2.out", "f2.in")
-scons: "f3.out" is up to date.
+scons: `f3.out' is up to date.
 build("f4.out", "f4.in")
 """))
 
 test.run(arguments = 'f1.out f2.out f3.out f4.out',
          stdout = test.wrap_stdout("""\
 build("f1.out", "f1.in")
-scons: "f2.out" is up to date.
+scons: `f2.out' is up to date.
 build("f3.out", "f3.in")
-scons: "f4.out" is up to date.
+scons: `f4.out' is up to date.
 """))
 
 

test/up-to-date.py

 test.run(arguments = 'f1.out f3.out')
 
 test.run(arguments = 'f1.out f2.out f3.out f4.out', stdout =
-test.wrap_stdout("""scons: "f1.out" is up to date.
+test.wrap_stdout("""\
+scons: `f1.out' is up to date.
 %s build.py f2.out f2.in
-scons: "f3.out" is up to date.
+scons: `f3.out' is up to date.
 %s build.py f4.out f4.in
 """ % (python, python)))