Commits

Gary Oberbrunner  committed 85a391f Merge

Merged in techtonik/scons (pull request #111, fix scons.py run from source dir)

  • Participants
  • Parent commits 4fb47de, c34352b

Comments (0)

Files changed (2)

File src/CHANGES.txt

 
                             Change Log
 
-RELEASE 2.3.1.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
+RELEASE 2.3.2.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
+  From Anatoly Techtonik:
+    - Several improvements for running scons.py from source:
+      * engine files form source directory take priority over all other
+        importable versions
+      * message about scons.py running from source is removed to fix tests
+        that were failing because of this extra line in the output
+      * error message when SCons import fails now lists lookup paths
+  From Dirk Baechle:
+    - Update XML doc editor configuration
+
+RELEASE 2.3.1
 
   From Andrew Featherstone:
     - Added support for EPUB output format to the DocBook tool.

File src/script/scons.py

 # preferred order of scons lookup paths
 prefs = []
 
+# - running from source takes priority (since 2.3.2)
+script_path = os.path.abspath(os.path.dirname(__file__))
+source_path = os.path.join(script_path, '..', 'engine')
+
+# - running from egg check
 try:
     import pkg_resources
 except ImportError:
 libs.extend([os.path.join(x, scons_version) for x in prefs])
 libs.extend([os.path.join(x, 'scons') for x in prefs])
 
-sys.path = libs + sys.path
+sys.path = [source_path] + libs + sys.path
 
 ##############################################################################
 # END STANDARD SCons SCRIPT HEADER
     try:
         import SCons.Script
     except:
-        ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'engine')
-        if os.path.exists(ROOT):
-            sys.path += [ROOT]
-            print("SCons import failed. Trying to run from source directory")
-        import SCons.Script
-  
+        print("Import failed. Unable to find SCons files in:")
+        for path in [source_path] + libs:
+          print "  %s" % path
+        raise
+
     # this does all the work, and calls sys.exit
     # with the proper exit status when done.
     SCons.Script.main()