diff options
| author | Bill Randle <william.c.randle@intel.com> | 2016-04-13 10:17:42 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-04-18 16:28:21 +0100 |
| commit | 8beb671843f1f8b6613e286c17e746f64c33ffa5 (patch) | |
| tree | 5aac97730679d98e6a2cc8dc6ea20e96aada638c /meta/files | |
| parent | 0262bc51cdad5e88b14bdce634fe08ab4401de8b (diff) | |
| download | poky-8beb671843f1f8b6613e286c17e746f64c33ffa5.tar.gz | |
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.py | 27 |
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): | |||
| 27 | 27 | ||
| 28 | return process.returncode, buf | 28 | return process.returncode, buf |
| 29 | 29 | ||
| 30 | def check_unexpected(lines, recipes): | ||
| 31 | """Check for unexpected output lines from dry run""" | ||
| 32 | unexpected = [] | ||
| 33 | for line in lines.splitlines(): | ||
| 34 | if 'Running task' in line: | ||
| 35 | for recipe in recipes: | ||
| 36 | if recipe in line: | ||
| 37 | break | ||
| 38 | else: | ||
| 39 | line = line.split('Running', 1)[-1] | ||
| 40 | if 'do_rm_work' not in line: | ||
| 41 | unexpected.append(line.rstrip()) | ||
| 42 | elif 'Running setscene' in line: | ||
| 43 | unexpected.append(line.rstrip()) | ||
| 44 | return unexpected | ||
| 30 | 45 | ||
| 31 | def main(): | 46 | def main(): |
| 32 | if len(sys.argv) < 2: | 47 | if len(sys.argv) < 2: |
| @@ -67,17 +82,7 @@ def main(): | |||
| 67 | 82 | ||
| 68 | try: | 83 | try: |
| 69 | out = subprocess.check_output('bitbake %s -n' % ' '.join(sdk_targets), stderr=subprocess.STDOUT, shell=True) | 84 | out = subprocess.check_output('bitbake %s -n' % ' '.join(sdk_targets), stderr=subprocess.STDOUT, shell=True) |
| 70 | unexpected = [] | 85 | unexpected = check_unexpected(out, recipes) |
| 71 | for line in out.splitlines(): | ||
| 72 | if 'Running task' in line: | ||
| 73 | for recipe in recipes: | ||
| 74 | if recipe in line: | ||
| 75 | break | ||
| 76 | else: | ||
| 77 | line = line.split('Running', 1)[-1] | ||
| 78 | unexpected.append(line.rstrip()) | ||
| 79 | elif 'Running setscene' in line: | ||
| 80 | unexpected.append(line.rstrip()) | ||
| 81 | except subprocess.CalledProcessError as e: | 86 | except subprocess.CalledProcessError as e: |
| 82 | print('ERROR: Failed to execute dry-run:\n%s' % e.output) | 87 | print('ERROR: Failed to execute dry-run:\n%s' % e.output) |
| 83 | return 1 | 88 | return 1 |
