call subst on the line passed to Environment.WhereIs
authormightyllamas <mightyllamas@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 22 Aug 2008 13:27:56 +0000 (13:27 +0000)
committermightyllamas <mightyllamas@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 22 Aug 2008 13:27:56 +0000 (13:27 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@3295 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Environment.py
test/WhereIs.py

index 82744e082145b65d5c95eec3c5f1b5498b439273..f972550e1ab437d7c5702d5b338141b627ebdcf6 100644 (file)
@@ -1599,6 +1599,7 @@ class Base(SubstitutionEnvironment):
                 pass
         elif SCons.Util.is_String(pathext):
             pathext = self.subst(pathext)
+        prog = self.subst(prog)
         path = SCons.Util.WhereIs(prog, path, pathext, reject)
         if path: return path
         return None
index dccfefbe378b597a6d16a96fc99c94c93b0ecd64..a2c5b012502f672f6aec85c978efdae710bcce96 100644 (file)
@@ -74,13 +74,16 @@ print env.WhereIs('xxx.exe', %s)
 print WhereIs('xxx.exe', %s)
 print WhereIs('xxx.exe', %s)
 print WhereIs('xxx.exe', %s, reject=%s)
+env.Replace( XXXNAME='xxx.exe' )
+print env.WhereIs( '$XXXNAME', %s )
 """ % (subdir_SConscript,
        repr(string.join(pathdirs_1234, os.pathsep)),
        repr(string.join(pathdirs_1243, os.pathsep)),
        repr(pathdirs_1234),
        repr(pathdirs_1243),
        repr(pathdirs_1243),
-       repr(sub4_xxx_exe)
+       repr(sub4_xxx_exe),
+       repr(string.join(pathdirs_1243, os.pathsep)),
       ))
 
 test.write(subdir_SConscript, """
@@ -109,6 +112,7 @@ expect = [ test.workpath(sub3_xxx_exe),
            test.workpath(sub3_xxx_exe),
            test.workpath(sub4_xxx_exe),
            test.workpath(sub3_xxx_exe),
+           test.workpath(sub4_xxx_exe)
          ]
 
 test.run(arguments = ".",
@@ -128,10 +132,12 @@ expect = [ test.workpath(sub4_xxx_exe),
            test.workpath(sub3_xxx_exe),
            test.workpath(sub4_xxx_exe),
            test.workpath(sub3_xxx_exe),
+           test.workpath(sub4_xxx_exe)
          ]
 
 test.run(arguments = ".",
          stdout = test.wrap_stdout(read_str = string.join(expect, "\n") + "\n",
                                    build_str = "scons: `.' is up to date.\n"))
 
+
 test.pass_test()