summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2009-12-05 02:39:27 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2009-12-05 02:39:27 (GMT)
commit37689e305adae32d009ae3a5802015e35fe31668 (patch)
tree187d65ca657c533e56625daffc8154dddccd9408 /src/engine
parent3bbb6edb17c8c7133cb15fc3ac7a7d5556daf005 (diff)
downloadSCons-37689e305adae32d009ae3a5802015e35fe31668.zip
SCons-37689e305adae32d009ae3a5802015e35fe31668.tar.gz
SCons-37689e305adae32d009ae3a5802015e35fe31668.tar.bz2
Integrate patch from issue #2436: fix regression from r3691 which stopped printing "Entering Directory" with -C/-u.
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/Script/Main.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py
index dd4f519..082de34 100644
--- a/src/engine/SCons/Script/Main.py
+++ b/src/engine/SCons/Script/Main.py
@@ -806,16 +806,13 @@ def _main(parser):
# want to start everything, which means first handling any relevant
# options that might cause us to chdir somewhere (-C, -D, -U, -u).
if options.directory:
- cdir = _create_path(options.directory)
- try:
- os.chdir(cdir)
- except OSError:
- sys.stderr.write("Could not change directory to %s\n" % cdir)
+ script_dir = os.path.abspath(_create_path(options.directory))
+ else:
+ script_dir = os.getcwd()
target_top = None
if options.climb_up:
target_top = '.' # directory to prepend to targets
- script_dir = os.getcwd() # location of script
while script_dir and not _SConstruct_exists(script_dir,
options.repository,
options.file):
@@ -824,9 +821,13 @@ def _main(parser):
target_top = os.path.join(last_part, target_top)
else:
script_dir = ''
- if script_dir and script_dir != os.getcwd():
- display("scons: Entering directory `%s'" % script_dir)
+
+ if script_dir and script_dir != os.getcwd():
+ display("scons: Entering directory `%s'" % script_dir)
+ try:
os.chdir(script_dir)
+ except OSError:
+ sys.stderr.write("Could not change directory to %s\n" % script_dir)
# Now that we're in the top-level SConstruct directory, go ahead
# and initialize the FS object that represents the file system,