summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-08-28 14:55:19 +1200
committerPaul Eggleton <paul.eggleton@linux.intel.com>2017-08-31 11:50:26 +1200
commit2b2a271a3fb1f07b048c2a76fb065ecd69bb31d1 (patch)
tree54fd2f2cd3e411b6cfba86bde3bbe8108adb1f27
parent6acf76beda4d824bd7edf9ab5bfbb425d4b5aa69 (diff)
downloadopenembedded-core-contrib-2b2a271a3fb1f07b048c2a76fb065ecd69bb31d1.tar.gz
openembedded-core-contrib-2b2a271a3fb1f07b048c2a76fb065ecd69bb31d1.tar.bz2
openembedded-core-contrib-2b2a271a3fb1f07b048c2a76fb065ecd69bb31d1.zip
devtool: upgrade: fix handling of non-absolute paths
If your BBLAYERS has non-absolute paths in it (e.g. "${COREBASE}/../something") then none of the paths matched in copy_recipe_files() with the result that no files got copied and you ended up with an error later on because the recipe file couldn't be found at the destination. Fix this as well as adding an explicit check to see if no files got copied - error out earlier if so. Fixes [YOCTO #10981]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-rw-r--r--meta/lib/oe/recipeutils.py8
-rw-r--r--scripts/lib/devtool/upgrade.py3
2 files changed, 8 insertions, 3 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index a7fdd36e40..b946128d78 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -334,11 +334,13 @@ def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True):
fetch.download()
# Copy local files to target directory and gather any remote files
- bb_dir = os.path.dirname(d.getVar('FILE')) + os.sep
+ bb_dir = os.path.abspath(os.path.dirname(d.getVar('FILE'))) + os.sep
remotes = []
copied = []
- includes = [path for path in d.getVar('BBINCLUDED').split() if
- path.startswith(bb_dir) and os.path.exists(path)]
+ # Need to do this in two steps since we want to check against the absolute path
+ includes = [os.path.abspath(path) for path in d.getVar('BBINCLUDED').split() if os.path.exists(path)]
+ # We also check this below, but we don't want any items in this list being considered remotes
+ includes = [path for path in includes if path.startswith(bb_dir)]
for path in fetch.localpaths() + includes:
# Only import files that are under the meta directory
if path.startswith(bb_dir):
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 1f11d47e5a..24937dcd20 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -301,6 +301,9 @@ def _create_new_recipe(newpv, md5, sha256, srcrev, srcbranch, workspace, tinfoil
path = os.path.join(workspace, 'recipes', bpn)
bb.utils.mkdirhier(path)
copied, _ = oe.recipeutils.copy_recipe_files(rd, path)
+ if not copied:
+ raise DevtoolError('Internal error - no files were copied for recipe %s' % bpn)
+ logger.debug('Copied %s to %s' % (copied, path))
oldpv = rd.getVar('PV')
if not newpv: