"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "SCons/Utilities/sconsign.py" between
SCons-4.3.0.tar.gz and SCons-4.4.0.tar.gz

About: SCons is a software construction tool (a Python script and a set of modules as a superior alternative to the classic "Make" build tool).

sconsign.py  (SCons-4.3.0):sconsign.py  (SCons-4.4.0)
skipping to change at line 31 skipping to change at line 31
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""Utility script to dump information from SCons signature database.""" """Utility script to dump information from SCons signature database."""
import getopt import getopt
import importlib
import os import os
import sys import sys
from dbm import whichdb from dbm import whichdb
import time import time
import pickle import pickle
import SCons.compat import SCons.compat
import SCons.SConsign import SCons.SConsign
skipping to change at line 52 skipping to change at line 53
if filename[-7:] == ".dblite": if filename[-7:] == ".dblite":
return "SCons.dblite" return "SCons.dblite"
try: try:
with open(filename + ".dblite", "rb"): with open(filename + ".dblite", "rb"):
return "SCons.dblite" return "SCons.dblite"
except IOError: except IOError:
pass pass
return whichdb(filename) return whichdb(filename)
def my_import(mname): def my_import(mname):
"""Import database module.
This was used if the module was *not* SCons.dblite, to allow
for programmatic importing. It is no longer used, in favor of
importlib.import_module, and will be removed eventually.
"""
import imp import imp
if '.' in mname: if '.' in mname:
i = mname.rfind('.') i = mname.rfind('.')
parent = my_import(mname[:i]) parent = my_import(mname[:i])
fp, pathname, description = imp.find_module(mname[i+1:], fp, pathname, description = imp.find_module(mname[i+1:], parent.__path__
parent.__path__) )
else: else:
fp, pathname, description = imp.find_module(mname) fp, pathname, description = imp.find_module(mname)
return imp.load_module(mname, fp, pathname, description) return imp.load_module(mname, fp, pathname, description)
class Flagger: class Flagger:
default_value = 1 default_value = 1
def __setitem__(self, item, value): def __setitem__(self, item, value):
self.__dict__[item] = value self.__dict__[item] = value
self.default_value = 0 self.default_value = 0
skipping to change at line 356 skipping to change at line 362
err = "sconsign: ignoring invalid .sconsign file `%s': %s\n" % ( name, e) err = "sconsign: ignoring invalid .sconsign file `%s': %s\n" % ( name, e)
sys.stderr.write(err) sys.stderr.write(err)
return return
printentries(sconsign.entries, args[0]) printentries(sconsign.entries, args[0])
except (IOError, OSError) as e: except (IOError, OSError) as e:
sys.stderr.write("sconsign: %s\n" % e) sys.stderr.write("sconsign: %s\n" % e)
return return
############################################################################## ##############################################################################
def main(): def main():
global Do_Call global Do_Call
global nodeinfo_string global nodeinfo_string
global args global args
global Verbose global Verbose
global Readable global Readable
helpstr = """\ helpstr = """\
Usage: sconsign [OPTIONS] [FILE ...] Usage: sconsign [OPTIONS] [FILE ...]
Options:
-a, --act, --action Print build action information. Options:
-c, --csig Print content signature information. -a, --act, --action Print build action information.
-d DIR, --dir=DIR Print only info about DIR. -c, --csig Print content signature information.
-e ENTRY, --entry=ENTRY Print only info about ENTRY. -d DIR, --dir=DIR Print only info about DIR.
-f FORMAT, --format=FORMAT FILE is in the specified FORMAT. -e ENTRY, --entry=ENTRY Print only info about ENTRY.
-h, --help Print this message and exit. -f FORMAT, --format=FORMAT FILE is in the specified FORMAT.
-i, --implicit Print implicit dependency information. -h, --help Print this message and exit.
-r, --readable Print timestamps in human-readable form. -i, --implicit Print implicit dependency information.
--raw Print raw Python object representations. -r, --readable Print timestamps in human-readable form.
-s, --size Print file sizes. --raw Print raw Python object representations.
-t, --timestamp Print timestamp information. -s, --size Print file sizes.
-v, --verbose Verbose, describe each field. -t, --timestamp Print timestamp information.
""" -v, --verbose Verbose, describe each field.
"""
try: try:
opts, args = getopt.getopt(sys.argv[1:], "acd:e:f:hirstv", opts, args = getopt.getopt(
['act', 'action', sys.argv[1:],
'csig', 'dir=', 'entry=', 'acd:e:f:hirstv',
'format=', 'help', 'implicit', [
'raw', 'readable', 'act',
'size', 'timestamp', 'verbose']) 'action',
'csig',
'dir=',
'entry=',
'format=',
'help',
'implicit',
'raw',
'readable',
'size',
'timestamp',
'verbose',
],
)
except getopt.GetoptError as err: except getopt.GetoptError as err:
sys.stderr.write(str(err) + '\n') sys.stderr.write(str(err) + '\n')
print(helpstr) print(helpstr)
sys.exit(2) sys.exit(2)
for o, a in opts: for o, a in opts:
if o in ('-a', '--act', '--action'): if o in ('-a', '--act', '--action'):
Print_Flags['action'] = 1 Print_Flags['action'] = 1
elif o in ('-c', '--csig'): elif o in ('-c', '--csig'):
Print_Flags['csig'] = 1 Print_Flags['csig'] = 1
skipping to change at line 408 skipping to change at line 428
elif o in ('-e', '--entry'): elif o in ('-e', '--entry'):
Print_Entries.append(a) Print_Entries.append(a)
elif o in ('-f', '--format'): elif o in ('-f', '--format'):
# Try to map the given DB format to a known module # Try to map the given DB format to a known module
# name, that we can then try to import... # name, that we can then try to import...
Module_Map = {'dblite': 'SCons.dblite', 'sconsign': None} Module_Map = {'dblite': 'SCons.dblite', 'sconsign': None}
dbm_name = Module_Map.get(a, a) dbm_name = Module_Map.get(a, a)
if dbm_name: if dbm_name:
try: try:
if dbm_name != "SCons.dblite": if dbm_name != "SCons.dblite":
dbm = my_import(dbm_name) dbm = importlib.import_module(dbm_name)
else: else:
import SCons.dblite import SCons.dblite
dbm = SCons.dblite dbm = SCons.dblite
# Ensure that we don't ignore corrupt DB files, # Ensure that we don't ignore corrupt DB files,
# this was handled by calling my_import('SCons.dblite') # this was handled by calling my_import('SCons.dblite')
# again in earlier versions... # again in earlier versions...
SCons.dblite.IGNORE_CORRUPT_DBFILES = False SCons.dblite.IGNORE_CORRUPT_DBFILES = False
except ImportError: except ImportError:
sys.stderr.write("sconsign: illegal file format `%s'\n" % a) sys.stderr.write("sconsign: illegal file format `%s'\n" % a)
skipping to change at line 451 skipping to change at line 471
for a in args: for a in args:
Do_Call(a) Do_Call(a)
else: else:
if not args: if not args:
args = [".sconsign.dblite"] args = [".sconsign.dblite"]
for a in args: for a in args:
dbm_name = my_whichdb(a) dbm_name = my_whichdb(a)
if dbm_name: if dbm_name:
Map_Module = {'SCons.dblite': 'dblite'} Map_Module = {'SCons.dblite': 'dblite'}
if dbm_name != "SCons.dblite": if dbm_name != "SCons.dblite":
dbm = my_import(dbm_name) dbm = importlib.import_module(dbm_name)
else: else:
import SCons.dblite import SCons.dblite
dbm = SCons.dblite dbm = SCons.dblite
# Ensure that we don't ignore corrupt DB files, # Ensure that we don't ignore corrupt DB files,
# this was handled by calling my_import('SCons.dblite') # this was handled by calling my_import('SCons.dblite')
# again in earlier versions... # again in earlier versions...
SCons.dblite.IGNORE_CORRUPT_DBFILES = False SCons.dblite.IGNORE_CORRUPT_DBFILES = False
Do_SConsignDB(Map_Module.get(dbm_name, dbm_name), dbm)(a) Do_SConsignDB(Map_Module.get(dbm_name, dbm_name), dbm)(a)
else: else:
 End of changes. 8 change blocks. 
26 lines changed or deleted 47 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)