1. SCons
  2. Core
  3. SCons

Commits

Steven Knight  committed 2f7b789

Add /usr/local/scons* to sys.path.

  • Participants
  • Parent commits 99fe741
  • Branches default

Comments (0)

Files changed (2)

File src/CHANGES.txt

View file
  • Ignore whitespace
 
 
 
+RELEASE 0.03 - 
+
+  From Steven Knight:
+
+  - Search both /usr/lib and /usr/local/lib for scons directories by
+    adding them both to sys.path, with whichever is in sys.prefix first.
+
+
+
 RELEASE 0.02 - Sun, 23 Dec 2001 19:05:09 -0600
 
   From Charles Crain:

File src/script/scons.py

View file
  • Ignore whitespace
     libs.extend([ os.path.join(sys.prefix, 'SCons-__VERSION__'),
                   os.path.join(sys.prefix, 'SCons') ])
 else:
-    libs.extend([ os.path.join(sys.prefix, 'lib', 'scons-__VERSION__'),
-                  os.path.join(sys.prefix, 'lib', 'scons') ])
+    _usr = os.path.join('', 'usr')
+    _usr_local = os.path.join('', 'usr', 'local')
+    if sys.prefix[-len(_usr):] == _usr:
+        prefs = [sys.prefix, os.path.join(sys.prefix, "local")]
+    elif sys.prefix[-len(_usr_local)] == _usr_local:
+        _local = os.path.join('', 'local')
+        prefs = [sys.prefix[:-len(_local)], sys.prefix]
+    else:
+        prefs = [sys.prefix]
+    libs.extend(map(lambda x: os.path.join(x, 'lib', 'scons-__VERSION__'), prefs))
+    libs.extend(map(lambda x: os.path.join(x, 'lib', 'scons'), prefs))
 
 sys.path = libs + sys.path[1:]