summaryrefslogtreecommitdiffstats
path: root/bootstrap.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-01-05 21:42:53 (GMT)
committerSteven Knight <knight@baldmt.com>2010-01-05 21:42:53 (GMT)
commita00896fb20749b297d7ec9d465c8dbbf7c3d47cd (patch)
tree358ef4cc0f45fc5add8bc46e81d2bdc74ca747f9 /bootstrap.py
parent7356c7078a1edaaccac14a050e90ec3df0daa969 (diff)
downloadSCons-a00896fb20749b297d7ec9d465c8dbbf7c3d47cd.zip
SCons-a00896fb20749b297d7ec9d465c8dbbf7c3d47cd.tar.gz
SCons-a00896fb20749b297d7ec9d465c8dbbf7c3d47cd.tar.bz2
Fix handling the -C option by recording the absolute path to
the original script directory.
Diffstat (limited to 'bootstrap.py')
-rw-r--r--bootstrap.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/bootstrap.py b/bootstrap.py
index fa73270..4dad44d 100644
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -80,18 +80,14 @@ executing it for the full build of all the packages, as specified in our
local SConstruct file.
"""
-bootstrap_dir = 'bootstrap'
try:
- script_dir = os.path.split(__file__)[0]
+ script_dir = os.path.abspath(os.path.dirname(__file__))
except NameError:
# Pre-2.3 versions of Python don't have __file__.
- script_dir = os.path.split(sys.argv[0])[0]
- if not script_dir:
- script_dir = os.getcwd()
- elif not os.path.is_abs(script_dir):
- script_dir = os.path.join(os.getcwd(), script_dir)
-if script_dir:
- bootstrap_dir = os.path.join(script_dir, bootstrap_dir)
+ script_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
+
+bootstrap_dir = os.path.join(script_dir, 'bootstrap')
+
pass_through_args = []
update_only = None
@@ -102,8 +98,7 @@ def must_copy(dst, src):
return 1
return open(dst, 'rb').read() != open(src, 'rb').read()
-search = [os.path.dirname(sys.argv[0])]
-if search[0] == '': search[0] = '.'
+search = [script_dir]
# Note: We don't use the getopt module to process the command-line
# arguments because we'd have to teach it about all of the SCons options.