public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 14/14] devtool: build: support using BBCLASSEXTENDed names
Date: Thu,  7 Jan 2016 00:15:55 +1300	[thread overview]
Message-ID: <611ea247254a0f6fe663771e440ea80c5453d201.1452078721.git.paul.eggleton@linux.intel.com> (raw)
In-Reply-To: <cover.1452078721.git.paul.eggleton@linux.intel.com>
In-Reply-To: <cover.1452078721.git.paul.eggleton@linux.intel.com>

It's logical that you would want to build BBCLASSEXTENDed items
separately through devtool build, so simply allow that - we're just
passing the name verbatim to bitbake, so all it means is adjusting the
validation.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/lib/devtool/__init__.py | 26 +++++++++++++++++++++-----
 scripts/lib/devtool/build.py    |  4 ++--
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index 253e4d5..0405d22 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -146,19 +146,35 @@ def parse_recipe(config, tinfoil, pn, appends):
     return oe.recipeutils.parse_recipe(recipefile, append_files,
                                        tinfoil.config_data)
 
-def check_workspace_recipe(workspace, pn, checksrc=True):
+def check_workspace_recipe(workspace, pn, checksrc=True, bbclassextend=False):
     """
     Check that a recipe is in the workspace and (optionally) that source
     is present.
     """
-    if not pn in workspace:
+
+    workspacepn = pn
+
+    for recipe, value in workspace.iteritems():
+        if recipe == pn:
+            break
+        if bbclassextend:
+            recipefile = value['recipefile']
+            if recipefile:
+                targets = get_bbclassextend_targets(recipefile, recipe)
+                if pn in targets:
+                    workspacepn = recipe
+                    break
+    else:
         raise DevtoolError("No recipe named '%s' in your workspace" % pn)
+
     if checksrc:
-        srctree = workspace[pn]['srctree']
+        srctree = workspace[workspacepn]['srctree']
         if not os.path.exists(srctree):
-            raise DevtoolError("Source tree %s for recipe %s does not exist" % (srctree, pn))
+            raise DevtoolError("Source tree %s for recipe %s does not exist" % (srctree, workspacepn))
         if not os.listdir(srctree):
-            raise DevtoolError("Source tree %s for recipe %s is empty" % (srctree, pn))
+            raise DevtoolError("Source tree %s for recipe %s is empty" % (srctree, workspacepn))
+
+    return workspacepn
 
 def use_external_build(same_dir, no_same_dir, d):
     """
diff --git a/scripts/lib/devtool/build.py b/scripts/lib/devtool/build.py
index a9a0778..c4c0c9f 100644
--- a/scripts/lib/devtool/build.py
+++ b/scripts/lib/devtool/build.py
@@ -51,11 +51,11 @@ def _get_build_task(config):
 
 def build(args, config, basepath, workspace):
     """Entry point for the devtool 'build' subcommand"""
-    check_workspace_recipe(workspace, args.recipename)
+    workspacepn = check_workspace_recipe(workspace, args.recipename, bbclassextend=True)
 
     build_task = _get_build_task(config)
 
-    bbappend = workspace[args.recipename]['bbappend']
+    bbappend = workspace[workspacepn]['bbappend']
     if args.disable_parallel_make:
         logger.info("Disabling 'make' parallelism")
         _set_file_values(bbappend, {'PARALLEL_MAKE': ''})
-- 
2.5.0



      parent reply	other threads:[~2016-01-06 11:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-06 11:15 [PATCH 00/14] Extensible SDK / devtool / recipetool improvements Paul Eggleton
2016-01-06 11:15 ` [PATCH 01/14] scripts/oe-publish-sdk: add missing call to git update-server-info Paul Eggleton
2016-01-06 11:15 ` [PATCH 02/14] classes/populate_sdk_ext: fix cascading from preparation failure Paul Eggleton
2016-01-06 11:15 ` [PATCH 03/14] classes/populate_sdk_ext: disable signature warnings Paul Eggleton
2016-01-06 11:15 ` [PATCH 04/14] devtool: sdk-update: fix not using updateserver config file option Paul Eggleton
2016-01-06 11:15 ` [PATCH 05/14] devtool: sdk-update: fix metadata update step Paul Eggleton
2016-01-06 11:15 ` [PATCH 06/14] devtool: sdk-update: fix error checking Paul Eggleton
2016-01-06 11:15 ` [PATCH 07/14] devtool: sdk-update: add option to skip preparation step Paul Eggleton
2016-01-06 11:15 ` [PATCH 08/14] recipetool: create: lower case name when determining from filename Paul Eggleton
2016-01-06 11:15 ` [PATCH 09/14] recipetool: create: support creating standalone native/nativesdk recipes Paul Eggleton
2016-01-06 11:15 ` [PATCH 10/14] devtool: reset: do clean for multiple recipes at once with -a Paul Eggleton
2016-01-06 11:15 ` [PATCH 11/14] devtool: add: support adding a native variant Paul Eggleton
2016-01-06 11:15 ` [PATCH 12/14] devtool: refactor code for getting local recipe file Paul Eggleton
2016-01-06 11:15 ` [PATCH 13/14] devtool: reset: support recipes with BBCLASSEXTEND Paul Eggleton
2016-01-06 11:15 ` Paul Eggleton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=611ea247254a0f6fe663771e440ea80c5453d201.1452078721.git.paul.eggleton@linux.intel.com \
    --to=paul.eggleton@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox