diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oe/recipeutils.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index ab4177aa81..1589feb5ce 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py | |||
@@ -389,10 +389,15 @@ def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True): | |||
389 | return copied, remotes | 389 | return copied, remotes |
390 | 390 | ||
391 | 391 | ||
392 | def get_recipe_local_files(d, patches=False): | 392 | def get_recipe_local_files(d, patches=False, archives=False): |
393 | """Get a list of local files in SRC_URI within a recipe.""" | 393 | """Get a list of local files in SRC_URI within a recipe.""" |
394 | uris = (d.getVar('SRC_URI', True) or "").split() | 394 | uris = (d.getVar('SRC_URI', True) or "").split() |
395 | fetch = bb.fetch2.Fetch(uris, d) | 395 | fetch = bb.fetch2.Fetch(uris, d) |
396 | # FIXME this list should be factored out somewhere else (such as the | ||
397 | # fetcher) though note that this only encompasses actual container formats | ||
398 | # i.e. that can contain multiple files as opposed to those that only | ||
399 | # contain a compressed stream (i.e. .tar.gz as opposed to just .gz) | ||
400 | 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'] | ||
396 | ret = {} | 401 | ret = {} |
397 | for uri in uris: | 402 | for uri in uris: |
398 | if fetch.ud[uri].type == 'file': | 403 | if fetch.ud[uri].type == 'file': |
@@ -409,7 +414,14 @@ def get_recipe_local_files(d, patches=False): | |||
409 | if os.path.isabs(subdir): | 414 | if os.path.isabs(subdir): |
410 | continue | 415 | continue |
411 | fname = os.path.join(subdir, fname) | 416 | fname = os.path.join(subdir, fname) |
412 | ret[fname] = fetch.localpath(uri) | 417 | localpath = fetch.localpath(uri) |
418 | if not archives: | ||
419 | # Ignore archives that will be unpacked | ||
420 | if localpath.endswith(tuple(archive_exts)): | ||
421 | unpack = fetch.ud[uri].parm.get('unpack', True) | ||
422 | if unpack: | ||
423 | continue | ||
424 | ret[fname] = localpath | ||
413 | return ret | 425 | return ret |
414 | 426 | ||
415 | 427 | ||