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 | |
| 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')
| -rw-r--r-- | src/CHANGES.txt | 9 | ||||
| -rw-r--r-- | src/engine/SCons/Script/SConscript.py | 9 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 161a2ef..0defff8 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -8,6 +8,15 @@ +RELEASE X.X.X - XXX + + From Steven Knight: + + - Fix the -n option when used with VariantDir(duplicate=1) + and the variant directory doesn't already exist. + + + RELEASE 1.2.0.d20090223 - Mon, 23 Feb 2009 08:41:06 -0800 From Stanislav Baranov: 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 |
