diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-06-18 15:14:19 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-06-23 11:57:53 +0100 |
commit | 69b69193411849de71cf7c81735c3239e28a2940 (patch) | |
tree | 054081264a49c9aa3002bc358ab0c4d7b7239015 /bitbake/lib/bb/parse/parse_py | |
parent | 86d30d756a60d181a95cf07041920a367a0cd0ba (diff) | |
download | poky-69b69193411849de71cf7c81735c3239e28a2940.tar.gz |
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py')
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 8 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/ConfHandler.py | 4 |
2 files changed, 6 insertions, 6 deletions
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): | |||
69 | return os.path.splitext(fn)[-1] in [".bb", ".bbclass", ".inc"] | 69 | return os.path.splitext(fn)[-1] in [".bb", ".bbclass", ".inc"] |
70 | 70 | ||
71 | def inherit(files, fn, lineno, d): | 71 | def inherit(files, fn, lineno, d): |
72 | __inherit_cache = d.getVar('__inherit_cache') or [] | 72 | __inherit_cache = d.getVar('__inherit_cache', False) or [] |
73 | files = d.expand(files).split() | 73 | files = d.expand(files).split() |
74 | for file in files: | 74 | for file in files: |
75 | if not os.path.isabs(file) and not file.endswith(".bbclass"): | 75 | if not os.path.isabs(file) and not file.endswith(".bbclass"): |
@@ -89,7 +89,7 @@ def inherit(files, fn, lineno, d): | |||
89 | __inherit_cache.append( file ) | 89 | __inherit_cache.append( file ) |
90 | d.setVar('__inherit_cache', __inherit_cache) | 90 | d.setVar('__inherit_cache', __inherit_cache) |
91 | include(fn, file, lineno, d, "inherit") | 91 | include(fn, file, lineno, d, "inherit") |
92 | __inherit_cache = d.getVar('__inherit_cache') or [] | 92 | __inherit_cache = d.getVar('__inherit_cache', False) or [] |
93 | 93 | ||
94 | def get_statements(filename, absolute_filename, base_name): | 94 | def get_statements(filename, absolute_filename, base_name): |
95 | global cached_statements | 95 | global cached_statements |
@@ -129,13 +129,13 @@ def handle(fn, d, include): | |||
129 | 129 | ||
130 | if ext == ".bbclass": | 130 | if ext == ".bbclass": |
131 | __classname__ = root | 131 | __classname__ = root |
132 | __inherit_cache = d.getVar('__inherit_cache') or [] | 132 | __inherit_cache = d.getVar('__inherit_cache', False) or [] |
133 | if not fn in __inherit_cache: | 133 | if not fn in __inherit_cache: |
134 | __inherit_cache.append(fn) | 134 | __inherit_cache.append(fn) |
135 | d.setVar('__inherit_cache', __inherit_cache) | 135 | d.setVar('__inherit_cache', __inherit_cache) |
136 | 136 | ||
137 | if include != 0: | 137 | if include != 0: |
138 | oldfile = d.getVar('FILE') | 138 | oldfile = d.getVar('FILE', False) |
139 | else: | 139 | else: |
140 | oldfile = None | 140 | oldfile = None |
141 | 141 | ||
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+(.+)" ) | |||
58 | __export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/]+)$" ) | 58 | __export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/]+)$" ) |
59 | 59 | ||
60 | def init(data): | 60 | def init(data): |
61 | topdir = data.getVar('TOPDIR') | 61 | topdir = data.getVar('TOPDIR', False) |
62 | if not topdir: | 62 | if not topdir: |
63 | data.setVar('TOPDIR', os.getcwd()) | 63 | data.setVar('TOPDIR', os.getcwd()) |
64 | 64 | ||
@@ -112,7 +112,7 @@ def handle(fn, data, include): | |||
112 | if include == 0: | 112 | if include == 0: |
113 | oldfile = None | 113 | oldfile = None |
114 | else: | 114 | else: |
115 | oldfile = data.getVar('FILE') | 115 | oldfile = data.getVar('FILE', False) |
116 | 116 | ||
117 | abs_fn = resolve_file(fn, data) | 117 | abs_fn = resolve_file(fn, data) |
118 | f = open(abs_fn, 'r') | 118 | f = open(abs_fn, 'r') |