summaryrefslogtreecommitdiff
path: root/meta/classes
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-11-10 14:45:17 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-23 11:02:27 +0000
commite47d21624dfec6f71742b837e91da553f18a28c5 (patch)
tree4d5296657218b97ee68070f5f04087bdf74a20ab /meta/classes
parentd9971f5dc8eb7de551fd6f5e058fd24770ef5d78 (diff)
downloadopenembedded-core-e47d21624dfec6f71742b837e91da553f18a28c5.tar.gz
openembedded-core-e47d21624dfec6f71742b837e91da553f18a28c5.tar.bz2
openembedded-core-e47d21624dfec6f71742b837e91da553f18a28c5.zip
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]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/patch.bbclass9
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"
inherit terminal
-def src_patches(d, all = False ):
+def src_patches(d, all=False, expand=True):
workdir = d.getVar('WORKDIR', True)
fetch = bb.fetch2.Fetch([], d)
patches = []
sources = []
for url in fetch.urls:
- local = patch_path(url, fetch, workdir)
+ local = patch_path(url, fetch, workdir, expand)
if not local:
if all:
local = fetch.localpath(url)
@@ -55,13 +55,14 @@ def src_patches(d, all = False ):
return patches
-def patch_path(url, fetch, workdir):
+def patch_path(url, fetch, workdir, expand=True):
"""Return the local path of a patch, or None if this isn't a patch"""
local = fetch.localpath(url)
base, ext = os.path.splitext(os.path.basename(local))
if ext in ('.gz', '.bz2', '.Z'):
- local = os.path.join(workdir, base)
+ if expand:
+ local = os.path.join(workdir, base)
ext = os.path.splitext(base)[1]
urldata = fetch.ud[url]