mirror of
https://git.yoctoproject.org/poky
synced 2026-09-24 13:36:22 +02:00
lib/oe/recipeutils: ignore archives by default in get_recipe_local_files()
By default, have get_recipe_local_files() not return any archive files. This prevents a local tarball from being erroneously removed from SRC_URI if you run "devtool modify" on a recipe followed by "devtool update-recipe". It doesn't actually help you to directly update the contents of such tarballs, but at least now it won't break the recipe. (From OE-Core rev: e9c418d4704c1bed4c5880e176e5288485f4f5a6) 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>
This commit is contained in:
committed by
Richard Purdie
parent
13c3a4bfa2
commit
e3193b76e0
@@ -389,10 +389,15 @@ def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True):
|
|||||||
return copied, remotes
|
return copied, remotes
|
||||||
|
|
||||||
|
|
||||||
def get_recipe_local_files(d, patches=False):
|
def get_recipe_local_files(d, patches=False, archives=False):
|
||||||
"""Get a list of local files in SRC_URI within a recipe."""
|
"""Get a list of local files in SRC_URI within a recipe."""
|
||||||
uris = (d.getVar('SRC_URI', True) or "").split()
|
uris = (d.getVar('SRC_URI', True) or "").split()
|
||||||
fetch = bb.fetch2.Fetch(uris, d)
|
fetch = bb.fetch2.Fetch(uris, d)
|
||||||
|
# FIXME this list should be factored out somewhere else (such as the
|
||||||
|
# fetcher) though note that this only encompasses actual container formats
|
||||||
|
# i.e. that can contain multiple files as opposed to those that only
|
||||||
|
# contain a compressed stream (i.e. .tar.gz as opposed to just .gz)
|
||||||
|
archive_exts = ['.tar', '.tgz', '.tar.gz', '.tar.Z', '.tbz', '.tbz2', '.tar.bz2', '.tar.xz', '.tar.lz', '.zip', '.jar', '.rpm', '.srpm', '.deb', '.ipk', '.tar.7z', '.7z']
|
||||||
ret = {}
|
ret = {}
|
||||||
for uri in uris:
|
for uri in uris:
|
||||||
if fetch.ud[uri].type == 'file':
|
if fetch.ud[uri].type == 'file':
|
||||||
@@ -409,7 +414,14 @@ def get_recipe_local_files(d, patches=False):
|
|||||||
if os.path.isabs(subdir):
|
if os.path.isabs(subdir):
|
||||||
continue
|
continue
|
||||||
fname = os.path.join(subdir, fname)
|
fname = os.path.join(subdir, fname)
|
||||||
ret[fname] = fetch.localpath(uri)
|
localpath = fetch.localpath(uri)
|
||||||
|
if not archives:
|
||||||
|
# Ignore archives that will be unpacked
|
||||||
|
if localpath.endswith(tuple(archive_exts)):
|
||||||
|
unpack = fetch.ud[uri].parm.get('unpack', True)
|
||||||
|
if unpack:
|
||||||
|
continue
|
||||||
|
ret[fname] = localpath
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user