From 78989ebb445af2c6462ae2bf05ffd588d76610e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 26 Jul 2014 16:31:27 +0200 Subject: Imported Upstream version 2.3.2 --- src/script/scons.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'src/script/scons.py') diff --git a/src/script/scons.py b/src/script/scons.py index 87919a1..b2823b6 100644 --- a/src/script/scons.py +++ b/src/script/scons.py @@ -2,7 +2,7 @@ # # SCons - a Software Constructor # -# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation +# Copyright (c) 2001 - 2014 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -23,21 +23,22 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "src/script/scons.py 2014/03/02 14:18:15 garyo" +__revision__ = "src/script/scons.py 2014/07/05 09:42:21 garyo" -__version__ = "2.3.1" +__version__ = "2.3.2" __build__ = "" __buildsys__ = "lubuntu" -__date__ = "2014/03/02 14:18:15" +__date__ = "2014/07/05 09:42:21" __developer__ = "garyo" import os import sys + ############################################################################## # BEGIN STANDARD SCons SCRIPT HEADER # @@ -72,6 +73,11 @@ libs = [] if "SCONS_LIB_DIR" in os.environ: libs.append(os.environ["SCONS_LIB_DIR"]) +# - running from source takes priority (since 2.3.2), excluding SCONS_LIB_DIR settings +script_path = os.path.abspath(os.path.dirname(__file__)) +source_path = os.path.join(script_path, '..', 'engine') +libs.append(source_path) + local_version = 'scons-local-' + __version__ local = 'scons-local' if script_dir: @@ -85,6 +91,8 @@ scons_version = 'scons-%s' % __version__ # preferred order of scons lookup paths prefs = [] + +# - running from egg check try: import pkg_resources except ImportError: @@ -181,12 +189,11 @@ if __name__ == "__main__": 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 libs: + print " %s" % path + raise + # this does all the work, and calls sys.exit # with the proper exit status when done. SCons.Script.main() -- cgit v1.2.3