diff options
| author | Chen Qi <Qi.Chen@windriver.com> | 2025-02-24 22:48:51 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-02-25 15:27:28 +0000 |
| commit | 40b5f61a8f359a428fc0262522d0fd3929e01c15 (patch) | |
| tree | 8b94fd572dd4c87b59b0248bd7766ebda5b316c1 /bitbake/lib | |
| parent | 9a59194f22293a22cf1189440b0e83304bc2f4b3 (diff) | |
| download | poky-40b5f61a8f359a428fc0262522d0fd3929e01c15.tar.gz | |
bitbake: data_smart: fix indentation
Fix 8 spaces indentation to be 4 spaces.
(Bitbake rev: 973866d134f0493bb3034593fe03cb8bf8920c5c)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
| -rw-r--r-- | bitbake/lib/bb/data_smart.py | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 5412596566..0aa09e1955 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
| @@ -106,52 +106,52 @@ class VariableParse: | |||
| 106 | self.contains = {} | 106 | self.contains = {} |
| 107 | 107 | ||
| 108 | def var_sub(self, match): | 108 | def var_sub(self, match): |
| 109 | key = match.group()[2:-1] | 109 | key = match.group()[2:-1] |
| 110 | if self.varname and key: | 110 | if self.varname and key: |
| 111 | if self.varname == key: | 111 | if self.varname == key: |
| 112 | raise Exception("variable %s references itself!" % self.varname) | 112 | raise Exception("variable %s references itself!" % self.varname) |
| 113 | var = self.d.getVarFlag(key, "_content") | 113 | var = self.d.getVarFlag(key, "_content") |
| 114 | self.references.add(key) | 114 | self.references.add(key) |
| 115 | if var is not None: | 115 | if var is not None: |
| 116 | return var | 116 | return var |
| 117 | else: | 117 | else: |
| 118 | return match.group() | 118 | return match.group() |
| 119 | 119 | ||
| 120 | def python_sub(self, match): | 120 | def python_sub(self, match): |
| 121 | if isinstance(match, str): | 121 | if isinstance(match, str): |
| 122 | code = match | 122 | code = match |
| 123 | else: | 123 | else: |
| 124 | code = match.group()[3:-1] | 124 | code = match.group()[3:-1] |
| 125 | 125 | ||
| 126 | # Do not run code that contains one or more unexpanded variables | 126 | # Do not run code that contains one or more unexpanded variables |
| 127 | # instead return the code with the characters we removed put back | 127 | # instead return the code with the characters we removed put back |
| 128 | if __expand_var_regexp__.findall(code): | 128 | if __expand_var_regexp__.findall(code): |
| 129 | return "${@" + code + "}" | 129 | return "${@" + code + "}" |
| 130 | 130 | ||
| 131 | if self.varname: | 131 | if self.varname: |
| 132 | varname = 'Var <%s>' % self.varname | 132 | varname = 'Var <%s>' % self.varname |
| 133 | else: | 133 | else: |
| 134 | varname = '<expansion>' | 134 | varname = '<expansion>' |
| 135 | codeobj = compile(code.strip(), varname, "eval") | 135 | codeobj = compile(code.strip(), varname, "eval") |
| 136 | 136 | ||
| 137 | parser = bb.codeparser.PythonParser(self.varname, logger) | 137 | parser = bb.codeparser.PythonParser(self.varname, logger) |
| 138 | parser.parse_python(code) | 138 | parser.parse_python(code) |
| 139 | if self.varname: | 139 | if self.varname: |
| 140 | vardeps = self.d.getVarFlag(self.varname, "vardeps") | 140 | vardeps = self.d.getVarFlag(self.varname, "vardeps") |
| 141 | if vardeps is None: | 141 | if vardeps is None: |
| 142 | parser.log.flush() | ||
| 143 | else: | ||
| 144 | parser.log.flush() | 142 | parser.log.flush() |
| 145 | self.references |= parser.references | 143 | else: |
| 146 | self.execs |= parser.execs | 144 | parser.log.flush() |
| 145 | self.references |= parser.references | ||
| 146 | self.execs |= parser.execs | ||
| 147 | 147 | ||
| 148 | for k in parser.contains: | 148 | for k in parser.contains: |
| 149 | if k not in self.contains: | 149 | if k not in self.contains: |
| 150 | self.contains[k] = parser.contains[k].copy() | 150 | self.contains[k] = parser.contains[k].copy() |
| 151 | else: | 151 | else: |
| 152 | self.contains[k].update(parser.contains[k]) | 152 | self.contains[k].update(parser.contains[k]) |
| 153 | value = utils.better_eval(codeobj, DataContext(self.d), {'d' : self.d}) | 153 | value = utils.better_eval(codeobj, DataContext(self.d), {'d' : self.d}) |
| 154 | return str(value) | 154 | return str(value) |
| 155 | 155 | ||
| 156 | class DataContext(dict): | 156 | class DataContext(dict): |
| 157 | excluded = set([i for i in dir(builtins) if not i.startswith('_')] + ['oe']) | 157 | excluded = set([i for i in dir(builtins) if not i.startswith('_')] + ['oe']) |
