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/classes/patch.bbclass | |
| 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/classes/patch.bbclass')
| -rw-r--r-- | meta/classes/patch.bbclass | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass index 1f6927be04..2c1f58cbdc 100644 --- a/meta/classes/patch.bbclass +++ b/meta/classes/patch.bbclass | |||
| @@ -10,13 +10,13 @@ PATCH_GIT_USER_EMAIL ?= "oe.patch@oe" | |||
| 10 | 10 | ||
| 11 | inherit terminal | 11 | inherit terminal |
| 12 | 12 | ||
| 13 | def src_patches(d, all = False ): | 13 | def src_patches(d, all=False, expand=True): |
| 14 | workdir = d.getVar('WORKDIR', True) | 14 | workdir = d.getVar('WORKDIR', True) |
| 15 | fetch = bb.fetch2.Fetch([], d) | 15 | fetch = bb.fetch2.Fetch([], d) |
| 16 | patches = [] | 16 | patches = [] |
| 17 | sources = [] | 17 | sources = [] |
| 18 | for url in fetch.urls: | 18 | for url in fetch.urls: |
| 19 | local = patch_path(url, fetch, workdir) | 19 | local = patch_path(url, fetch, workdir, expand) |
| 20 | if not local: | 20 | if not local: |
| 21 | if all: | 21 | if all: |
| 22 | local = fetch.localpath(url) | 22 | local = fetch.localpath(url) |
| @@ -55,13 +55,14 @@ def src_patches(d, all = False ): | |||
| 55 | 55 | ||
| 56 | return patches | 56 | return patches |
| 57 | 57 | ||
| 58 | def patch_path(url, fetch, workdir): | 58 | def patch_path(url, fetch, workdir, expand=True): |
| 59 | """Return the local path of a patch, or None if this isn't a patch""" | 59 | """Return the local path of a patch, or None if this isn't a patch""" |
| 60 | 60 | ||
| 61 | local = fetch.localpath(url) | 61 | local = fetch.localpath(url) |
| 62 | base, ext = os.path.splitext(os.path.basename(local)) | 62 | base, ext = os.path.splitext(os.path.basename(local)) |
| 63 | if ext in ('.gz', '.bz2', '.Z'): | 63 | if ext in ('.gz', '.bz2', '.Z'): |
| 64 | local = os.path.join(workdir, base) | 64 | if expand: |
| 65 | local = os.path.join(workdir, base) | ||
| 65 | ext = os.path.splitext(base)[1] | 66 | ext = os.path.splitext(base)[1] |
| 66 | 67 | ||
| 67 | urldata = fetch.ud[url] | 68 | urldata = fetch.ud[url] |
