From: mightyllamas Date: Fri, 22 Aug 2008 13:27:56 +0000 (+0000) Subject: call subst on the line passed to Environment.WhereIs X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7379398cd98d20ceac549f4583b25a18c79f162b;p=scons.git call subst on the line passed to Environment.WhereIs git-svn-id: http://scons.tigris.org/svn/scons/trunk@3295 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 82744e08..f972550e 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -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 diff --git a/test/WhereIs.py b/test/WhereIs.py index dccfefbe..a2c5b012 100644 --- a/test/WhereIs.py +++ b/test/WhereIs.py @@ -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()