diff options
Diffstat (limited to 'meta/lib/oeqa/utils/commands.py')
-rw-r--r-- | meta/lib/oeqa/utils/commands.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py index 2a47f90e32..b60a6e6c38 100644 --- a/meta/lib/oeqa/utils/commands.py +++ b/meta/lib/oeqa/utils/commands.py | |||
@@ -285,7 +285,20 @@ def get_bb_vars(variables=None, target=None, postconfig=None): | |||
285 | return values | 285 | return values |
286 | 286 | ||
287 | def get_bb_var(var, target=None, postconfig=None): | 287 | def get_bb_var(var, target=None, postconfig=None): |
288 | return get_bb_vars([var], target, postconfig)[var] | 288 | if postconfig: |
289 | return bitbake("-e %s" % target or "", postconfig=postconfig).output | ||
290 | else: | ||
291 | # Fast-path for the non-postconfig case | ||
292 | cmd = ["bitbake-getvar", "--quiet", "--value", var] | ||
293 | if target: | ||
294 | cmd.extend(["--recipe", target]) | ||
295 | try: | ||
296 | return subprocess.run(cmd, check=True, text=True, stdout=subprocess.PIPE).stdout.strip() | ||
297 | except subprocess.CalledProcessError as e: | ||
298 | # We need to return None not the empty string if the variable hasn't been set. | ||
299 | if e.returncode == 1: | ||
300 | return None | ||
301 | raise | ||
289 | 302 | ||
290 | def get_test_layer(bblayers=None): | 303 | def get_test_layer(bblayers=None): |
291 | if bblayers is None: | 304 | if bblayers is None: |