1
0
mirror of https://git.yoctoproject.org/poky synced 2026-07-27 19:37:10 +00:00

meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)

Using "1" with getVar is bad coding style and "True" is preferred.
This patch is a sed over the meta directory of the form:

sed \
 -e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \
 -e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \
 -i `grep -ril getVar *`

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2012-03-03 10:59:25 +00:00
parent d01dadfb87
commit 06f2f8ce0a
83 changed files with 290 additions and 290 deletions
+6 -6
View File
@@ -3,12 +3,12 @@ python do_distribute_sources () {
l = bb.data.createCopy(d)
bb.data.update_data(l)
sources_dir = d.getVar('SRC_DISTRIBUTEDIR', 1)
src_uri = d.getVar('SRC_URI', 1).split()
sources_dir = d.getVar('SRC_DISTRIBUTEDIR', True)
src_uri = d.getVar('SRC_URI', True).split()
fetcher = bb.fetch2.Fetch(src_uri, d)
ud = fetcher.ud
licenses = d.getVar('LICENSE', 1).replace('&', '|')
licenses = d.getVar('LICENSE', True).replace('&', '|')
licenses = licenses.replace('(', '').replace(')', '')
clean_licenses = ""
for x in licenses.split():
@@ -20,7 +20,7 @@ python do_distribute_sources () {
for license in clean_licenses.split('|'):
for url in ud.values():
cmd = d.getVar('SRC_DISTRIBUTECOMMAND', 1)
cmd = d.getVar('SRC_DISTRIBUTECOMMAND', True)
if not cmd:
raise bb.build.FuncFailed("Unable to distribute sources, SRC_DISTRIBUTECOMMAND not defined")
url.setup_localpath(d)
@@ -29,9 +29,9 @@ python do_distribute_sources () {
if url.basename == '*':
import os.path
dest_dir = os.path.basename(os.path.dirname(os.path.abspath(url.localpath)))
d.setVar('DEST', "%s_%s/" % (d.getVar('PF', 1), dest_dir))
d.setVar('DEST', "%s_%s/" % (d.getVar('PF', True), dest_dir))
else:
d.setVar('DEST', "%s_%s" % (d.getVar('PF', 1), url.basename))
d.setVar('DEST', "%s_%s" % (d.getVar('PF', True), url.basename))
else:
d.setVar('DEST', '')