-Remove default arguments from the data methods. They
cast errors.
(we need to update the test case though)
lib/bb/parse/ConfHandler.py:
-Use the right dictionary
return DataDictCache(cache)
return {}
return DataDictCache(cache)
return {}
def createCopy(source):
"""Link the source set to the destination
If one does not find the value in the destination set,
def createCopy(source):
"""Link the source set to the destination
If one does not find the value in the destination set,
"""
return source.createCopy()
"""
return source.createCopy()
-def initVar(var, d = _data_dict):
"""Non-destructive var init for data structure"""
d.initVar(var)
"""Non-destructive var init for data structure"""
d.initVar(var)
-def setVar(var, value, d = _data_dict):
+def setVar(var, value, d):
"""Set a variable to a given value
Example:
"""Set a variable to a given value
Example:
-def getVar(var, d = _data_dict, exp = 0):
+def getVar(var, d, exp = 0):
"""Gets the value of a variable
Example:
"""Gets the value of a variable
Example:
"""
return d.getVar(var,exp)
"""
return d.getVar(var,exp)
-def delVar(var, d = _data_dict):
"""Removes a variable from the data set
Example:
"""Removes a variable from the data set
Example:
-def setVarFlag(var, flag, flagvalue, d = _data_dict):
+def setVarFlag(var, flag, flagvalue, d):
"""Set a flag for a given variable to a given value
Example:
"""Set a flag for a given variable to a given value
Example:
"""
d.setVarFlag(var,flag,flagvalue)
"""
d.setVarFlag(var,flag,flagvalue)
-def getVarFlag(var, flag, d = _data_dict):
+def getVarFlag(var, flag, d):
"""Gets given flag from given var
Example:
"""Gets given flag from given var
Example:
"""
return d.getVarFlag(var,flag)
"""
return d.getVarFlag(var,flag)
-def delVarFlag(var, flag, d = _data_dict):
+def delVarFlag(var, flag, d):
"""Removes a given flag from the variable's flags
Example:
"""Removes a given flag from the variable's flags
Example:
"""
d.delVarFlag(var,flag)
"""
d.delVarFlag(var,flag)
-def setVarFlags(var, flags, d = _data_dict):
+def setVarFlags(var, flags, d):
"""Set the flags for a given variable
Example:
"""Set the flags for a given variable
Example:
"""
d.setVarFlags(var,flags)
"""
d.setVarFlags(var,flags)
-def getVarFlags(var, d = _data_dict):
+def getVarFlags(var, d):
"""Gets a variable's flags
Example:
"""Gets a variable's flags
Example:
"""
return d.getVarFlags(var)
"""
return d.getVarFlags(var)
-def delVarFlags(var, d = _data_dict):
+def delVarFlags(var, d):
"""Removes a variable's flags
Example:
"""Removes a variable's flags
Example:
-def keys(d = _data_dict):
"""Return a list of keys in d
Example:
"""Return a list of keys in d
Example:
-def getData(d = _data_dict):
"""Returns the data object used"""
return d
"""Returns the data object used"""
return d
-def setData(newData, d = _data_dict):
+def setData(newData, d):
"""Sets the data object to the supplied value"""
d = newData
__expand_var_regexp__ = re.compile(r"\${[^{}]+}")
__expand_python_regexp__ = re.compile(r"\${@.+?}")
"""Sets the data object to the supplied value"""
d = newData
__expand_var_regexp__ = re.compile(r"\${[^{}]+}")
__expand_python_regexp__ = re.compile(r"\${@.+?}")
-def expand(s, d = _data_dict, varname = None):
+def expand(s, d, varname = None):
"""Variable expansion using the data store.
Example:
"""Variable expansion using the data store.
Example:
-def expandKeys(alterdata = _data_dict, readdata = None):
+def expandKeys(alterdata, readdata = None):
if readdata == None:
readdata = alterdata
if readdata == None:
readdata = alterdata
-def expandData(alterdata = _data_dict, readdata = None):
+def expandData(alterdata, readdata = None):
"""For each variable in alterdata, expand it, and update the var contents.
Replacements use data from readdata.
"""For each variable in alterdata, expand it, and update the var contents.
Replacements use data from readdata.
-def inheritFromOS(d = _data_dict):
"""Inherit variables from the environment."""
# fakeroot needs to be able to set these
non_inherit_vars = [ "LD_LIBRARY_PATH", "LD_PRELOAD" ]
"""Inherit variables from the environment."""
# fakeroot needs to be able to set these
non_inherit_vars = [ "LD_LIBRARY_PATH", "LD_PRELOAD" ]
-def emit_var(var, o=sys.__stdout__, d = _data_dict, all=False):
+def emit_var(var, o=sys.__stdout__, d = init(), all=False):
"""Emit a variable to be sourced by a shell."""
if getVarFlag(var, "python", d):
return 0
"""Emit a variable to be sourced by a shell."""
if getVarFlag(var, "python", d):
return 0
-def emit_env(o=sys.__stdout__, d = _data_dict, all=False):
+def emit_env(o=sys.__stdout__, d = init(), all=False):
"""Emits all items in the data store in a format such that it can be sourced by a shell."""
env = keys(d)
"""Emits all items in the data store in a format such that it can be sourced by a shell."""
env = keys(d)
continue
emit_var(e, o, d) and o.write('\n')
continue
emit_var(e, o, d) and o.write('\n')
-def update_data(d = _data_dict):
"""Modifies the environment vars according to local overrides and commands.
Examples:
Appending to a variable:
"""Modifies the environment vars according to local overrides and commands.
Examples:
Appending to a variable:
dodel = []
overrides = (getVar('OVERRIDES', d, 1) or "").split(':') or []
dodel = []
overrides = (getVar('OVERRIDES', d, 1) or "").split(':') or []
- def applyOverrides(var, d = _data_dict):
+ def applyOverrides(var, d):
if not overrides:
debug(1, "OVERRIDES not defined, nothing to do")
return
if not overrides:
debug(1, "OVERRIDES not defined, nothing to do")
return
if not bb.data.getVar('TOPDIR', data):
bb.data.setVar('TOPDIR', os.getcwd(), data)
if not bb.data.getVar('BBPATH', data):
if not bb.data.getVar('TOPDIR', data):
bb.data.setVar('TOPDIR', os.getcwd(), data)
if not bb.data.getVar('BBPATH', data):
- bb.data.setVar('BBPATH', os.path.join(sys.prefix, 'share', 'bitbake'))
+ bb.data.setVar('BBPATH', os.path.join(sys.prefix, 'share', 'bitbake'), data)
def supports(fn, d):
return localpath(fn, d)[-5:] == ".conf"
def supports(fn, d):
return localpath(fn, d)[-5:] == ".conf"