From 69b69193411849de71cf7c81735c3239e28a2940 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 18 Jun 2015 15:14:19 +0100 Subject: bitbake: bitbake: Add explict getVar param for (non) expansion Rather than just use d.getVar(X), use the more explict d.getVar(X, False) since at some point in the future, having the default of expansion would be nice. This is the first step towards that. This patch was mostly made using the command: sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *` (Bitbake rev: 659ef95c9b8aced3c4ded81c48bcc0fbde4d429f) Signed-off-by: Richard Purdie --- bitbake/lib/bb/parse/parse_py/BBHandler.py | 8 ++++---- bitbake/lib/bb/parse/parse_py/ConfHandler.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'bitbake/lib/bb/parse/parse_py') diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index 03109dfbb2..ec097baf73 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py @@ -69,7 +69,7 @@ def supports(fn, d): return os.path.splitext(fn)[-1] in [".bb", ".bbclass", ".inc"] def inherit(files, fn, lineno, d): - __inherit_cache = d.getVar('__inherit_cache') or [] + __inherit_cache = d.getVar('__inherit_cache', False) or [] files = d.expand(files).split() for file in files: if not os.path.isabs(file) and not file.endswith(".bbclass"): @@ -89,7 +89,7 @@ def inherit(files, fn, lineno, d): __inherit_cache.append( file ) d.setVar('__inherit_cache', __inherit_cache) include(fn, file, lineno, d, "inherit") - __inherit_cache = d.getVar('__inherit_cache') or [] + __inherit_cache = d.getVar('__inherit_cache', False) or [] def get_statements(filename, absolute_filename, base_name): global cached_statements @@ -129,13 +129,13 @@ def handle(fn, d, include): if ext == ".bbclass": __classname__ = root - __inherit_cache = d.getVar('__inherit_cache') or [] + __inherit_cache = d.getVar('__inherit_cache', False) or [] if not fn in __inherit_cache: __inherit_cache.append(fn) d.setVar('__inherit_cache', __inherit_cache) if include != 0: - oldfile = d.getVar('FILE') + oldfile = d.getVar('FILE', False) else: oldfile = None diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py index 8d7a0d562a..250a557cb4 100644 --- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py @@ -58,7 +58,7 @@ __require_regexp__ = re.compile( r"require\s+(.+)" ) __export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/]+)$" ) def init(data): - topdir = data.getVar('TOPDIR') + topdir = data.getVar('TOPDIR', False) if not topdir: data.setVar('TOPDIR', os.getcwd()) @@ -112,7 +112,7 @@ def handle(fn, data, include): if include == 0: oldfile = None else: - oldfile = data.getVar('FILE') + oldfile = data.getVar('FILE', False) abs_fn = resolve_file(fn, data) f = open(abs_fn, 'r') -- cgit v1.2.3-54-g00ecf