diff options
author | Steven Knight <knight@baldmt.com> | 2003-03-30 16:55:46 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-03-30 16:55:46 (GMT) |
commit | 786aa89ee387927f0ef142f3328b3c0eebb1da5a (patch) | |
tree | 8e8f86ec954f00dfba25179cb0257db9369c3b66 /src/engine/SCons/Script/SConscript.py | |
parent | d3ce17c54525be85011f667f584611cc02ee9a11 (diff) | |
download | SCons-786aa89ee387927f0ef142f3328b3c0eebb1da5a.zip SCons-786aa89ee387927f0ef142f3328b3c0eebb1da5a.tar.gz SCons-786aa89ee387927f0ef142f3328b3c0eebb1da5a.tar.bz2 |
Fix a bug when BuildDir(duplicate=0) is used with multiple SConscript files. (Charles Crain)
Diffstat (limited to 'src/engine/SCons/Script/SConscript.py')
-rw-r--r-- | src/engine/SCons/Script/SConscript.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index df86853..c0d82ce 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -191,7 +191,6 @@ def SConscript(*ls, **kw): results = [] for fn in files: stack.append(Frame(exports)) - old_dir = None old_sys_path = sys.path try: if fn == "-": @@ -202,7 +201,6 @@ def SConscript(*ls, **kw): else: f = default_fs.File(str(fn)) _file_ = None - old_dir = default_fs.getcwd() # Change directory to the top of the source # tree to make sure the os's cwd and the cwd of @@ -242,6 +240,7 @@ def SConscript(*ls, **kw): # default_fs.chdir(), because we still need to # interpret the stuff within the SConscript file # relative to where we are logically. + default_fs.chdir(ldir, change_os_dir=0) os.chdir(f.rfile().dir.abspath) # Append the SConscript directory to the beginning @@ -263,15 +262,14 @@ def SConscript(*ls, **kw): finally: sys.path = old_sys_path frame = stack.pop() - default_fs.chdir(frame.prev_dir) - if old_dir: - try: - default_fs.chdir(old_dir, change_os_dir=sconscript_chdir) - except OSError: - # There was no local directory, so chdir to the - # Repository directory. Like above, we do this - # directly. - os.chdir(old_dir.rdir().abspath) + try: + default_fs.chdir(frame.prev_dir, change_os_dir=sconscript_chdir) + except OSError: + # There was no local directory, so chdir to the + # Repository directory. Like above, we do this + # directly. + default_fs.chdir(frame.prev_dir, change_os_dir=0) + os.chdir(frame.prev_dir.rdir().abspath) results.append(frame.retval) |