]> code.ossystems Code Review - openembedded-core.git/commitdiff
devtool: finish: warn if moving recipe to unconfigured destination layer
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Mon, 31 Oct 2016 03:59:46 +0000 (16:59 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 7 Nov 2016 11:04:17 +0000 (11:04 +0000)
If you run devtool finish to move a recipe created in the workspace by
devtool add or devtool upgrade to a layer, and that layer is not
currently included in bblayers.conf (perhaps unintentionally), then the
recipe will no longer be visible to bitbake. In this scenario, show a
warning so that the user isn't surprised by the recipe "going missing".

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/devtool/standard.py

index 9511d5618cd68680f00d4e0e39a236ab155d67fa..c15bfef9d85f28001ea74065862a6721fcd13c43 100644 (file)
@@ -1517,6 +1517,11 @@ def finish(args, config, basepath, workspace):
             destpath = oe.recipeutils.get_bbfile_path(rd, destlayerdir, origrelpath)
             if not destpath:
                 raise DevtoolError("Unable to determine destination layer path - check that %s specifies an actual layer and %s/conf/layer.conf specifies BBFILES. You may also need to specify a more complete path." % (args.destination, destlayerdir))
+            # Warn if the layer isn't in bblayers.conf (the code to create a bbappend will do this in other cases)
+            layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS', True).split()]
+            if not os.path.abspath(destlayerdir) in layerdirs:
+                bb.warn('Specified destination layer is not currently enabled in bblayers.conf, so the %s recipe will now be unavailable in your current configuration until you add the layer there' % args.recipename)
+
         elif destlayerdir == origlayerdir:
             # Same layer, update the original recipe
             appendlayerdir = None