"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "engine/SCons/Script/SConscript.py" between
scons-3.0.1.tar.gz and scons-3.0.2.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).

SConscript.py  (scons-3.0.1):SConscript.py  (scons-3.0.2)
"""SCons.Script.SConscript """SCons.Script.SConscript
This module defines the Python API provided to SConscript and SConstruct This module defines the Python API provided to SConscript and SConstruct
files. files.
""" """
# #
# Copyright (c) 2001 - 2017 The SCons Foundation # Copyright (c) 2001 - 2018 The SCons Foundation
# #
# Permission is hereby granted, free of charge, to any person obtaining # Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the # a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including # "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, # without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to # distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to # permit persons to whom the Software is furnished to do so, subject to
# the following conditions: # the following conditions:
# #
# The above copyright notice and this permission notice shall be included # The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software. # in all copies or substantial portions of the Software.
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# 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.
__revision__ = "src/engine/SCons/Script/SConscript.py 74b2c53bc42290e911b334a6b4 4f187da698a668 2017/11/14 13:16:53 bdbaddog" __revision__ = "src/engine/SCons/Script/SConscript.py 425375072d7b582a2df0db815c 8eaeaa489468ab 2019-01-01 18:32:02 bdbaddog"
import SCons import SCons
import SCons.Action import SCons.Action
import SCons.Builder import SCons.Builder
import SCons.Defaults import SCons.Defaults
import SCons.Environment import SCons.Environment
import SCons.Errors import SCons.Errors
import SCons.Node import SCons.Node
import SCons.Node.Alias import SCons.Node.Alias
import SCons.Node.FS import SCons.Node.FS
skipping to change at line 154 skipping to change at line 154
else: else:
call_stack[-1].retval = tuple(retval) call_stack[-1].retval = tuple(retval)
stop = kw.get('stop', True) stop = kw.get('stop', True)
if stop: if stop:
raise SConscriptReturn raise SConscriptReturn
stack_bottom = '% Stack boTTom %' # hard to define a variable w/this name :) stack_bottom = '% Stack boTTom %' # hard to define a variable w/this name :)
def handle_missing_SConscript(f, must_exist=None):
"""Take appropriate action on missing file in SConscript() call.
Print a warning or raise an exception on missing file.
On first warning, print a deprecation message.
Args:
f (str): path of missing configuration file
must_exist (bool): raise exception if file does not exist
Raises:
UserError if 'must_exist' is True or if global
SCons.Script._no_missing_sconscript is True.
"""
if must_exist or (SCons.Script._no_missing_sconscript and must_exist is not
False):
msg = "Fatal: missing SConscript '%s'" % f.get_internal_path()
raise SCons.Errors.UserError(msg)
if SCons.Script._warn_missing_sconscript_deprecated:
msg = "Calling missing SConscript without error is deprecated.\n" + \
"Transition by adding must_exist=0 to SConscript calls.\n" + \
"Missing SConscript '%s'" % f.get_internal_path()
SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg)
SCons.Script._warn_missing_sconscript_deprecated = False
else:
msg = "Ignoring missing SConscript '%s'" % f.get_internal_path()
SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg)
def _SConscript(fs, *files, **kw): def _SConscript(fs, *files, **kw):
top = fs.Top top = fs.Top
sd = fs.SConstruct_dir.rdir() sd = fs.SConstruct_dir.rdir()
exports = kw.get('exports', []) exports = kw.get('exports', [])
# evaluate each SConscript file # evaluate each SConscript file
results = [] results = []
for fn in files: for fn in files:
call_stack.append(Frame(fs, exports, fn)) call_stack.append(Frame(fs, exports, fn))
old_sys_path = sys.path old_sys_path = sys.path
skipping to change at line 265 skipping to change at line 294
except SConscriptReturn: except SConscriptReturn:
pass pass
finally: finally:
if Main.print_time: if Main.print_time:
time2 = time.time() time2 = time.time()
print('SConscript:%s took %0.3f ms' % (f.get_abspat h(), (time2 - time1) * 1000.0)) print('SConscript:%s took %0.3f ms' % (f.get_abspat h(), (time2 - time1) * 1000.0))
if old_file is not None: if old_file is not None:
call_stack[-1].globals.update({__file__:old_file}) call_stack[-1].globals.update({__file__:old_file})
else: else:
SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, handle_missing_SConscript(f, kw.get('must_exist', None))
"Ignoring missing SConscript '%s'" % f.get_internal
_path())
finally: finally:
SCons.Script.sconscript_reading = SCons.Script.sconscript_reading - 1 SCons.Script.sconscript_reading = SCons.Script.sconscript_reading - 1
sys.path = old_sys_path sys.path = old_sys_path
frame = call_stack.pop() frame = call_stack.pop()
try: try:
fs.chdir(frame.prev_dir, change_os_dir=sconscript_chdir) fs.chdir(frame.prev_dir, change_os_dir=sconscript_chdir)
except OSError: except OSError:
# There was no local directory, so chdir to the # There was no local directory, so chdir to the
# Repository directory. Like above, we do this # Repository directory. Like above, we do this
skipping to change at line 524 skipping to change at line 552
globals.update(exports) globals.update(exports)
else: else:
if v in exports: if v in exports:
globals[v] = exports[v] globals[v] = exports[v]
else: else:
globals[v] = global_exports[v] globals[v] = global_exports[v]
except KeyError as x: except KeyError as x:
raise SCons.Errors.UserError("Import of non-existent variable '%s'"% x) raise SCons.Errors.UserError("Import of non-existent variable '%s'"% x)
def SConscript(self, *ls, **kw): def SConscript(self, *ls, **kw):
"""Execute SCons configuration files.
Parameters:
*ls (str or list): configuration file(s) to execute.
Keyword arguments:
dirs (list): execute SConscript in each listed directory.
name (str): execute script 'name' (used only with 'dirs').
exports (list or dict): locally export variables the
called script(s) can import.
variant_dir (str): mirror sources needed for the build in
a variant directory to allow building in it.
duplicate (bool): physically duplicate sources instead of just
adjusting paths of derived files (used only with 'variant_dir')
(default is True).
must_exist (bool): fail if a requested script is missing
(default is False, default is deprecated).
Returns:
list of variables returned by the called script
Raises:
UserError: a script is not found and such exceptions are enabled.
"""
if 'build_dir' in kw: if 'build_dir' in kw:
msg = """The build_dir keyword has been deprecated; use the variant_ dir keyword instead.""" msg = """The build_dir keyword has been deprecated; use the variant_ dir keyword instead."""
SCons.Warnings.warn(SCons.Warnings.DeprecatedBuildDirWarning, msg) SCons.Warnings.warn(SCons.Warnings.DeprecatedBuildDirWarning, msg)
def subst_element(x, subst=self.subst): def subst_element(x, subst=self.subst):
if SCons.Util.is_List(x): if SCons.Util.is_List(x):
x = list(map(subst, x)) x = list(map(subst, x))
else: else:
x = subst(x) x = subst(x)
return x return x
ls = list(map(subst_element, ls)) ls = list(map(subst_element, ls))
 End of changes. 5 change blocks. 
5 lines changed or deleted 58 lines changed or added

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