diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-11-10 14:45:17 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-11-23 11:10:13 +0000 |
commit | 55a157f4e687de98d78f74e0ec7b4e9883599319 (patch) | |
tree | 8702aaff3d6782ccfce84ab1f17d5acf4c82433f /meta/lib/oeqa | |
parent | d316363b7ba57cbf5300c6cd3b4cc68fb3258d6f (diff) | |
download | poky-55a157f4e687de98d78f74e0ec7b4e9883599319.tar.gz |
devtool: update-recipe: fix handling of compressed local patches
It is possible to use gzip or bzip2 to compress patches and still refer
to them in compressed form in the SRC_URI value within a recipe. If you
run "devtool modify" on such a recipe, make changes to the commit for
the patch and then run devtool update-recipe, we need to correctly
associate the commit back to the compressed patch file and re-compress
the patch, neither of which we were doing previously.
Additionally, add an oe-selftest test to ensure this doesn't regress in
future.
Fixes [YOCTO #8278].
(From OE-Core rev: e47d21624dfec6f71742b837e91da553f18a28c5)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/selftest/devtool.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py index f6226c1ad9..92dc5e5869 100644 --- a/meta/lib/oeqa/selftest/devtool.py +++ b/meta/lib/oeqa/selftest/devtool.py | |||
@@ -948,6 +948,30 @@ class DevtoolTests(DevtoolBase): | |||
948 | expected_status = [(' M', '.*/%s/file2$' % testrecipe)] | 948 | expected_status = [(' M', '.*/%s/file2$' % testrecipe)] |
949 | self._check_repo_status(os.path.dirname(recipefile), expected_status) | 949 | self._check_repo_status(os.path.dirname(recipefile), expected_status) |
950 | 950 | ||
951 | def test_devtool_update_recipe_local_patch_gz(self): | ||
952 | # First, modify the recipe | ||
953 | testrecipe = 'devtool-test-patch-gz' | ||
954 | recipefile = get_bb_var('FILE', testrecipe) | ||
955 | src_uri = get_bb_var('SRC_URI', testrecipe) | ||
956 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') | ||
957 | self.track_for_cleanup(tempdir) | ||
958 | self.track_for_cleanup(self.workspacedir) | ||
959 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | ||
960 | # (don't bother with cleaning the recipe on teardown, we won't be building it) | ||
961 | result = runCmd('devtool modify %s' % testrecipe) | ||
962 | # Modify one file | ||
963 | srctree = os.path.join(self.workspacedir, 'sources', testrecipe) | ||
964 | runCmd('echo "Another line" >> README', cwd=srctree) | ||
965 | runCmd('git commit -a --amend --no-edit', cwd=srctree) | ||
966 | self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile))) | ||
967 | result = runCmd('devtool update-recipe %s' % testrecipe) | ||
968 | expected_status = [(' M', '.*/%s/readme.patch.gz$' % testrecipe)] | ||
969 | self._check_repo_status(os.path.dirname(recipefile), expected_status) | ||
970 | patch_gz = os.path.join(os.path.dirname(recipefile), testrecipe, 'readme.patch.gz') | ||
971 | result = runCmd('file %s' % patch_gz) | ||
972 | if 'gzip compressed data' not in result.output: | ||
973 | self.fail('New patch file is not gzipped - file reports:\n%s' % result.output) | ||
974 | |||
951 | @testcase(1163) | 975 | @testcase(1163) |
952 | def test_devtool_extract(self): | 976 | def test_devtool_extract(self): |
953 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') | 977 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') |