diff options
author | Steven Knight <knight@baldmt.com> | 2008-10-15 14:36:07 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2008-10-15 14:36:07 (GMT) |
commit | 594f48886dfb67c4c2d232561007583bbceb3238 (patch) | |
tree | b9d3ef546ef37acbcf5523e00ecb4931fb624f85 /src | |
parent | 96edb2c80e97965974608eb143500353425f8d8e (diff) | |
download | SCons-594f48886dfb67c4c2d232561007583bbceb3238.zip SCons-594f48886dfb67c4c2d232561007583bbceb3238.tar.gz SCons-594f48886dfb67c4c2d232561007583bbceb3238.tar.bz2 |
Fix use of VariantDir when the -n option is used and doesn't,
therefore, actually create the variant directory.
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 3 | ||||
-rw-r--r-- | src/engine/SCons/Script/SConscript.py | 15 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 516850e..8a16c8c 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -21,6 +21,9 @@ RELEASE 1.X - XXX - Support using the -f option to search for a different top-level file name when walking up with the -D, -U or -u options. + - Fix use of VariantDir when the -n option is used and doesn't, + therefore, actually create the variant directory. + RELEASE 1.1.0 - Thu, 09 Oct 2008 08:33:47 -0700 diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index 5cfde64..4119a3b 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -279,7 +279,20 @@ def _SConscript(fs, *files, **kw): fs.chdir(frame.prev_dir, change_os_dir=0) rdir = frame.prev_dir.rdir() rdir._create() # Make sure there's a directory there. - os.chdir(rdir.get_abspath()) + try: + os.chdir(rdir.get_abspath()) + except OSError, e: + # We still couldn't chdir there, so raise the error, + # but only if actions are being executed. + # + # If the -n option was used, the directory would *not* + # have been created and we should just carry on and + # let things muddle through. This isn't guaranteed + # to work if the SConscript files are reading things + # from disk (for example), but it should work well + # enough for most configurations. + if SCons.Action.execute_actions: + raise e results.append(frame.retval) |