summaryrefslogtreecommitdiffstats
path: root/meta/files
diff options
context:
space:
mode:
authorBill Randle <william.c.randle@intel.com>2016-04-13 10:17:42 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-18 16:28:21 +0100
commit8beb671843f1f8b6613e286c17e746f64c33ffa5 (patch)
tree5aac97730679d98e6a2cc8dc6ea20e96aada638c /meta/files
parent0262bc51cdad5e88b14bdce634fe08ab4401de8b (diff)
downloadopenembedded-core-contrib-8beb671843f1f8b6613e286c17e746f64c33ffa5.tar.gz
openembedded-core-contrib-8beb671843f1f8b6613e286c17e746f64c33ffa5.tar.bz2
openembedded-core-contrib-8beb671843f1f8b6613e286c17e746f64c33ffa5.zip
ext-sdk-prepare.py: exclude do_rm_work from unexpected output; create unit test
When installing the esdk with INHERIT += "rm_work", the script complains about do_rm_work as unexpected output from the bitbake run. This patch ignores any output lines with do_rm_work and further refactors the output comparison into its own function creates a new unit test to verify the fix. The unit test can be run direct from the command line or via oe-selftest. [YOCTO #9019] (From OE-Core rev: d41930e1daa933cf4bf063fa79a2e8fc9129e1b1) Signed-off-by: Bill Randle <william.c.randle@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/files')
-rw-r--r--meta/files/ext-sdk-prepare.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/meta/files/ext-sdk-prepare.py b/meta/files/ext-sdk-prepare.py
index 80db8bb16a..605e2ebefa 100644
--- a/meta/files/ext-sdk-prepare.py
+++ b/meta/files/ext-sdk-prepare.py
@@ -27,6 +27,21 @@ def exec_watch(cmd, **options):
return process.returncode, buf
+def check_unexpected(lines, recipes):
+ """Check for unexpected output lines from dry run"""
+ unexpected = []
+ for line in lines.splitlines():
+ if 'Running task' in line:
+ for recipe in recipes:
+ if recipe in line:
+ break
+ else:
+ line = line.split('Running', 1)[-1]
+ if 'do_rm_work' not in line:
+ unexpected.append(line.rstrip())
+ elif 'Running setscene' in line:
+ unexpected.append(line.rstrip())
+ return unexpected
def main():
if len(sys.argv) < 2:
@@ -67,17 +82,7 @@ def main():
try:
out = subprocess.check_output('bitbake %s -n' % ' '.join(sdk_targets), stderr=subprocess.STDOUT, shell=True)
- unexpected = []
- for line in out.splitlines():
- if 'Running task' in line:
- for recipe in recipes:
- if recipe in line:
- break
- else:
- line = line.split('Running', 1)[-1]
- unexpected.append(line.rstrip())
- elif 'Running setscene' in line:
- unexpected.append(line.rstrip())
+ unexpected = check_unexpected(out, recipes)
except subprocess.CalledProcessError as e:
print('ERROR: Failed to execute dry-run:\n%s' % e.output)
return 1