From 7379398cd98d20ceac549f4583b25a18c79f162b Mon Sep 17 00:00:00 2001 From: mightyllamas Date: Fri, 22 Aug 2008 13:27:56 +0000 Subject: [PATCH] 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 --- src/engine/SCons/Environment.py | 1 + test/WhereIs.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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() -- 2.26.2