summaryrefslogtreecommitdiffstats
path: root/src/script/sconsign.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2008-09-11 13:22:12 (GMT)
committerSteven Knight <knight@baldmt.com>2008-09-11 13:22:12 (GMT)
commit9f13cdf6fcf02e50e60d278042be37c0c2b1c7cb (patch)
tree3bd982258b90c36cc852205996b2ec960df59c09 /src/script/sconsign.py
parent4519bfd9be6fcf55732666e7c541faea0a8f1533 (diff)
downloadSCons-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/sconsign.py')
-rw-r--r--src/script/sconsign.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/script/sconsign.py b/src/script/sconsign.py
index 7591069..b9629a8 100644
--- a/src/script/sconsign.py
+++ b/src/script/sconsign.py
@@ -67,9 +67,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__
@@ -138,14 +141,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'.