diff options
author | Steven Knight <knight@baldmt.com> | 2009-02-25 15:15:43 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2009-02-25 15:15:43 (GMT) |
commit | 3cc05563a7780fe442be945478c9db180e5b4ba8 (patch) | |
tree | 7452f9a4ffb7b8467fc4fc8bd6269c3950c32ce6 /src/engine/SCons/Script/SConscript.py | |
parent | 200c09f32daeffbecf33bc08f4a6807ab395b8bd (diff) | |
download | SCons-3cc05563a7780fe442be945478c9db180e5b4ba8.zip SCons-3cc05563a7780fe442be945478c9db180e5b4ba8.tar.gz SCons-3cc05563a7780fe442be945478c9db180e5b4ba8.tar.bz2 |
Issue 1059: Fix the -n option when VariantDir(duplicate=1) is used
and the variant directory doesn't already exist.
Diffstat (limited to 'src/engine/SCons/Script/SConscript.py')
-rw-r--r-- | src/engine/SCons/Script/SConscript.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index 6569c95..9a67e67 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -189,7 +189,11 @@ def _SConscript(fs, *files, **kw): # fs match so we can open the SConscript. fs.chdir(top, change_os_dir=1) if f.rexists(): - _file_ = open(f.rfile().get_abspath(), "r") + actual = f.rfile() + _file_ = open(actual.get_abspath(), "r") + elif f.srcnode().rexists(): + actual = f.srcnode().rfile() + _file_ = open(actual.get_abspath(), "r") elif f.has_src_builder(): # The SConscript file apparently exists in a source # code management system. Build it, but then clear @@ -233,8 +237,7 @@ def _SConscript(fs, *files, **kw): # interpret the stuff within the SConscript file # relative to where we are logically. fs.chdir(ldir, change_os_dir=0) - # TODO Not sure how to handle src_dir here - os.chdir(f.rfile().dir.get_abspath()) + os.chdir(actual.dir.get_abspath()) # Append the SConscript directory to the beginning # of sys.path so Python modules in the SConscript |