diff options
author | Steven Knight <knight@baldmt.com> | 2008-09-11 13:22:12 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2008-09-11 13:22:12 (GMT) |
commit | 9f13cdf6fcf02e50e60d278042be37c0c2b1c7cb (patch) | |
tree | 3bd982258b90c36cc852205996b2ec960df59c09 /src/script/scons.py | |
parent | 4519bfd9be6fcf55732666e7c541faea0a8f1533 (diff) | |
download | SCons-9f13cdf6fcf02e50e60d278042be37c0c2b1c7cb.zip SCons-9f13cdf6fcf02e50e60d278042be37c0c2b1c7cb.tar.gz SCons-9f13cdf6fcf02e50e60d278042be37c0c2b1c7cb.tar.bz2 |
Issue 2005: Avoid an infinite loop looking for the Python library
directory. Look for a "scons-local" directory in addition to a
"scons-local-{version}" directory.
Diffstat (limited to 'src/script/scons.py')
-rw-r--r-- | src/script/scons.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/script/scons.py b/src/script/scons.py index db01549..d8ad7b2 100644 --- a/src/script/scons.py +++ b/src/script/scons.py @@ -66,9 +66,12 @@ libs = [] if os.environ.has_key("SCONS_LIB_DIR"): libs.append(os.environ["SCONS_LIB_DIR"]) -local = 'scons-local-' + __version__ +local_version = 'scons-local-' + __version__ +local = 'scons-local' if script_dir: + local_version = os.path.join(script_dir, local_version) local = os.path.join(script_dir, local) +libs.append(os.path.abspath(local_version)) libs.append(os.path.abspath(local)) scons_version = 'scons-%s' % __version__ @@ -137,14 +140,12 @@ else: except AttributeError: pass else: - while libpath: - libpath, tail = os.path.split(libpath) - if tail[:6] == "python": - break - if libpath: - # Python library is in /usr/libfoo/python*; - # check /usr/libfoo/scons*. - prefs.append(libpath) + # Split /usr/libfoo/python*/os.py to /usr/libfoo/python*. + libpath, tail = os.path.split(libpath) + # Split /usr/libfoo/python* to /usr/libfoo + libpath, tail = os.path.split(libpath) + # Check /usr/libfoo/scons*. + prefs.append(libpath) # Look first for 'scons-__version__' in all of our preference libs, # then for 'scons'. |