mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 01:40:07 +00:00
bitbake: bitbake: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (Bitbake rev: 3b45c479de8640f92dd1d9f147b02e1eecfaadc8) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
1d0c124cdf
commit
1fce7ecbbb
@@ -1165,7 +1165,7 @@
|
||||
<literallayout class='monospaced'>
|
||||
python some_python_function () {
|
||||
d.setVar("TEXT", "Hello World")
|
||||
print d.getVar("TEXT", True)
|
||||
print d.getVar("TEXT")
|
||||
}
|
||||
</literallayout>
|
||||
Because the Python "bb" and "os" modules are already
|
||||
@@ -1180,7 +1180,7 @@
|
||||
to freely set variable values to expandable expressions
|
||||
without having them expanded prematurely.
|
||||
If you do wish to expand a variable within a Python
|
||||
function, use <filename>d.getVar("X", True)</filename>.
|
||||
function, use <filename>d.getVar("X")</filename>.
|
||||
Or, for more complicated expressions, use
|
||||
<filename>d.expand()</filename>.
|
||||
</note>
|
||||
@@ -1232,7 +1232,7 @@
|
||||
Here is an example:
|
||||
<literallayout class='monospaced'>
|
||||
def get_depends(d):
|
||||
if d.getVar('SOMECONDITION', True):
|
||||
if d.getVar('SOMECONDITION'):
|
||||
return "dependencywithcond"
|
||||
else:
|
||||
return "dependency"
|
||||
@@ -1367,7 +1367,7 @@
|
||||
based on the value of another variable:
|
||||
<literallayout class='monospaced'>
|
||||
python () {
|
||||
if d.getVar('SOMEVAR', True) == 'value':
|
||||
if d.getVar('SOMEVAR') == 'value':
|
||||
d.setVar('ANOTHERVAR', 'value2')
|
||||
}
|
||||
</literallayout>
|
||||
|
||||
Reference in New Issue
Block a user