diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-08-31 11:54:08 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-31 23:30:02 +0100 |
commit | 69d50eb9ec2e8dc696aac13d0ffbf890fd4ce0e6 (patch) | |
tree | 199711a420cc2eae829a87f039056b01a35f8cdd /meta/lib/oe/recipeutils.py | |
parent | 34580ac2872da6ae70d5269eb107d31cd5239ad7 (diff) | |
download | poky-69d50eb9ec2e8dc696aac13d0ffbf890fd4ce0e6.tar.gz |
devtool: upgrade: workaround for recipes which apply patches conditional upon class
If we're upgrading a recipe that appends additional patches for, say,
class-native, and we're just upgrading the target variant, then when we
copied the recipe into the workspace we skipped copying the additional patches
for the native variant. This caused warnings because the workspace
recipe is preferred. Look at SRC_URI for all variants when copying files
to work around this.
More work is needed to make it easier to work with recipes that use
BBCLASSEXTEND where you need to build more than one variant at once, but
this at least fixes the immediate ugliness.
(From OE-Core rev: 56bf5e93358187e31160d7893f57906bb3dc7ad7)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/recipeutils.py')
-rw-r--r-- | meta/lib/oe/recipeutils.py | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index b946128d78..c8570acf9e 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py | |||
@@ -2,7 +2,7 @@ | |||
2 | # | 2 | # |
3 | # Some code borrowed from the OE layer index | 3 | # Some code borrowed from the OE layer index |
4 | # | 4 | # |
5 | # Copyright (C) 2013-2016 Intel Corporation | 5 | # Copyright (C) 2013-2017 Intel Corporation |
6 | # | 6 | # |
7 | 7 | ||
8 | import sys | 8 | import sys |
@@ -320,7 +320,7 @@ def patch_recipe(d, fn, varvalues, patch=False, relpath=''): | |||
320 | 320 | ||
321 | 321 | ||
322 | 322 | ||
323 | def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True): | 323 | def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True, all_variants=False): |
324 | """Copy (local) recipe files, including both files included via include/require, | 324 | """Copy (local) recipe files, including both files included via include/require, |
325 | and files referred to in the SRC_URI variable.""" | 325 | and files referred to in the SRC_URI variable.""" |
326 | import bb.fetch2 | 326 | import bb.fetch2 |
@@ -328,10 +328,31 @@ def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True): | |||
328 | 328 | ||
329 | # FIXME need a warning if the unexpanded SRC_URI value contains variable references | 329 | # FIXME need a warning if the unexpanded SRC_URI value contains variable references |
330 | 330 | ||
331 | uris = (d.getVar('SRC_URI') or "").split() | 331 | uri_values = [] |
332 | fetch = bb.fetch2.Fetch(uris, d) | 332 | localpaths = [] |
333 | if download: | 333 | def fetch_urls(rdata): |
334 | fetch.download() | 334 | # Collect the local paths from SRC_URI |
335 | srcuri = rdata.getVar('SRC_URI') or "" | ||
336 | if srcuri not in uri_values: | ||
337 | fetch = bb.fetch2.Fetch(srcuri.split(), rdata) | ||
338 | if download: | ||
339 | fetch.download() | ||
340 | for pth in fetch.localpaths(): | ||
341 | if pth not in localpaths: | ||
342 | localpaths.append(pth) | ||
343 | uri_values.append(srcuri) | ||
344 | |||
345 | fetch_urls(d) | ||
346 | if all_variants: | ||
347 | # Get files for other variants e.g. in the case of a SRC_URI_append | ||
348 | localdata = bb.data.createCopy(d) | ||
349 | variants = (localdata.getVar('BBCLASSEXTEND') or '').split() | ||
350 | if variants: | ||
351 | # Ensure we handle class-target if we're dealing with one of the variants | ||
352 | variants.append('target') | ||
353 | for variant in variants: | ||
354 | localdata.setVar('CLASSOVERRIDE', 'class-%s' % variant) | ||
355 | fetch_urls(localdata) | ||
335 | 356 | ||
336 | # Copy local files to target directory and gather any remote files | 357 | # Copy local files to target directory and gather any remote files |
337 | bb_dir = os.path.abspath(os.path.dirname(d.getVar('FILE'))) + os.sep | 358 | bb_dir = os.path.abspath(os.path.dirname(d.getVar('FILE'))) + os.sep |
@@ -341,7 +362,7 @@ def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True): | |||
341 | includes = [os.path.abspath(path) for path in d.getVar('BBINCLUDED').split() if os.path.exists(path)] | 362 | includes = [os.path.abspath(path) for path in d.getVar('BBINCLUDED').split() if os.path.exists(path)] |
342 | # We also check this below, but we don't want any items in this list being considered remotes | 363 | # We also check this below, but we don't want any items in this list being considered remotes |
343 | includes = [path for path in includes if path.startswith(bb_dir)] | 364 | includes = [path for path in includes if path.startswith(bb_dir)] |
344 | for path in fetch.localpaths() + includes: | 365 | for path in localpaths + includes: |
345 | # Only import files that are under the meta directory | 366 | # Only import files that are under the meta directory |
346 | if path.startswith(bb_dir): | 367 | if path.startswith(bb_dir): |
347 | if not whole_dir: | 368 | if not whole_dir: |