summaryrefslogtreecommitdiff
path: root/script/sconsign
diff options
context:
space:
mode:
Diffstat (limited to 'script/sconsign')
-rw-r--r--script/sconsign45
1 files changed, 38 insertions, 7 deletions
diff --git a/script/sconsign b/script/sconsign
index 775f23b..38a217a 100644
--- a/script/sconsign
+++ b/script/sconsign
@@ -2,7 +2,7 @@
#
# SCons - a Software Constructor
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 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,15 +23,15 @@
# 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/sconsign.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/script/sconsign.py rel_2.5.0:3544:95d356f188a3 2016/04/09 14:38:50 bdbaddog"
-__version__ = "2.4.1"
+__version__ = "2.5.0"
-__build__ = "rel_2.4.1:3453:73fefd3ea0b0"
+__build__ = "rel_2.5.0:3544:95d356f188a3[MODIFIED]"
__buildsys__ = "ubuntu1404-32bit"
-__date__ = "2015/11/09 03:25:05"
+__date__ = "2016/04/09 14:38:50"
__developer__ = "bdbaddog"
@@ -54,6 +54,14 @@ import sys
# followed by generic) so we pick up the right version of the build
# engine modules if they're in either directory.
+
+if sys.version_info >= (3,0,0):
+ msg = "sconsign: *** Version %s does not run under Python version %s.\n\
+Python 3 is not yet supported.\n"
+ sys.stderr.write(msg % (__version__, sys.version.split()[0]))
+ sys.exit(1)
+
+
script_dir = sys.path[0]
if script_dir in sys.path:
@@ -64,6 +72,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:
@@ -463,12 +476,22 @@ for o, a in opts:
elif o in ('-e', '--entry'):
Print_Entries.append(a)
elif o in ('-f', '--format'):
+ # Try to map the given DB format to a known module
+ # name, that we can then try to import...
Module_Map = {'dblite' : 'SCons.dblite',
'sconsign' : None}
dbm_name = Module_Map.get(a, a)
if dbm_name:
try:
- dbm = my_import(dbm_name)
+ if dbm_name != "SCons.dblite":
+ dbm = my_import(dbm_name)
+ else:
+ import SCons.dblite
+ dbm = SCons.dblite
+ # Ensure that we don't ignore corrupt DB files,
+ # this was handled by calling my_import('SCons.dblite')
+ # again in earlier versions...
+ SCons.dblite.ignore_corrupt_dbfiles = 0
except:
sys.stderr.write("sconsign: illegal file format `%s'\n" % a)
print helpstr
@@ -500,7 +523,15 @@ else:
dbm_name = whichdb.whichdb(a)
if dbm_name:
Map_Module = {'SCons.dblite' : 'dblite'}
- dbm = my_import(dbm_name)
+ if dbm_name != "SCons.dblite":
+ dbm = my_import(dbm_name)
+ else:
+ import SCons.dblite
+ dbm = SCons.dblite
+ # Ensure that we don't ignore corrupt DB files,
+ # this was handled by calling my_import('SCons.dblite')
+ # again in earlier versions...
+ SCons.dblite.ignore_corrupt_dbfiles = 0
Do_SConsignDB(Map_Module.get(dbm_name, dbm_name), dbm)(a)
else:
Do_SConsignDir(a)