]> code.ossystems Code Review - openembedded-core.git/commitdiff
devtool/recipetool/meta: Adapt to bitbake API changes for multi-configuration builds
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 16 Aug 2016 17:00:13 +0000 (18:00 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 18 Aug 2016 08:27:56 +0000 (09:27 +0100)
Unfortunately to implenent multiconfig support in bitbake some APIs
had to change. This updates code in OE to match the changes in bitbake.
Its mostly periperhal changes around devtool/recipetool

[Will need a bitbake version requirement bump which I'll make when merging]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/recipeutils.py
meta/lib/oeqa/utils/commands.py
scripts/lib/devtool/__init__.py
scripts/lib/devtool/standard.py
scripts/lib/devtool/upgrade.py
scripts/lib/recipetool/append.py
scripts/lib/recipetool/setvar.py
scripts/oe-check-sstate

index c77664f135c1e8655caa8461986948473df526a7..e7dd8afb0846092926c0d4237c20e75faae50ad8 100644 (file)
@@ -27,16 +27,16 @@ list_vars = ['SRC_URI', 'LIC_FILES_CHKSUM']
 meta_vars = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION']
 
 
-def pn_to_recipe(cooker, pn):
+def pn_to_recipe(cooker, pn, mc=''):
     """Convert a recipe name (PN) to the path to the recipe file"""
     import bb.providers
 
-    if pn in cooker.recipecache.pkg_pn:
-        best = bb.providers.findBestProvider(pn, cooker.data, cooker.recipecache, cooker.recipecache.pkg_pn)
+    if pn in cooker.recipecaches[mc].pkg_pn:
+        best = bb.providers.findBestProvider(pn, cooker.data, cooker.recipecaches[mc], cooker.recipecaches[mc].pkg_pn)
         return best[3]
-    elif pn in cooker.recipecache.providers:
-        filenames = cooker.recipecache.providers[pn]
-        eligible, foundUnique = bb.providers.filterProviders(filenames, pn, cooker.expanded_data, cooker.recipecache)
+    elif pn in cooker.recipecaches[mc].providers:
+        filenames = cooker.recipecaches[mc].providers[pn]
+        eligible, foundUnique = bb.providers.filterProviders(filenames, pn, cooker.expanded_data, cooker.recipecaches[mc])
         filename = eligible[0]
         return filename
     else:
@@ -50,13 +50,14 @@ def get_unavailable_reasons(cooker, pn):
     return taskdata.get_reasons(pn)
 
 
-def parse_recipe(fn, appendfiles, d):
+def parse_recipe(cooker, fn, appendfiles):
     """
     Parse an individual recipe file, optionally with a list of
     bbappend files.
     """
     import bb.cache
-    envdata = bb.cache.Cache.loadDataFull(fn, appendfiles, d)
+    parser = bb.cache.NoCache(cooker.databuilder)
+    envdata = parser.loadDataFull(fn, appendfiles)
     return envdata
 
 
@@ -79,7 +80,7 @@ def parse_recipe_simple(cooker, pn, d, appends=True):
         appendfiles = cooker.collection.get_file_appends(recipefile)
     else:
         appendfiles = None
-    return parse_recipe(recipefile, appendfiles, d)
+    return parse_recipe(cooker, recipefile, appendfiles)
 
 
 def get_var_files(fn, varlist, d):
index a8e184d0c3602d525996752dda70bd19a382ddf0..5cd0f7477baa5bb45f2b2b5b93fb1ff0efd02923 100644 (file)
@@ -223,7 +223,7 @@ def runqemu(pn, ssh=True):
         tinfoil.config_data.setVar("TEST_QEMUBOOT_TIMEOUT", "1000")
         import oe.recipeutils
         recipefile = oe.recipeutils.pn_to_recipe(tinfoil.cooker, pn)
-        recipedata = oe.recipeutils.parse_recipe(recipefile, [], tinfoil.config_data)
+        recipedata = oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, [])
 
         # The QemuRunner log is saved out, but we need to ensure it is at the right
         # log level (and then ensure that since it's a child of the BitBake logger,
index 65eb4527bce95f8c6b66bce3f1ecca2fe93577ae..216b7c345ab9349a0a60a98e81d97c6c778dc5f6 100644 (file)
@@ -146,8 +146,7 @@ def parse_recipe(config, tinfoil, pn, appends, filter_workspace=True):
                             not path.startswith(config.workspace_path)]
     else:
         append_files = None
-    return oe.recipeutils.parse_recipe(recipefile, append_files,
-                                       tinfoil.config_data)
+    return oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, append_files)
 
 def check_workspace_recipe(workspace, pn, checksrc=True, bbclassextend=False):
     """
index 9c09533b540030a4b95f1b40cfb32697be902249..3de2401325f6cedef43b6e9a766af9d856e8e308 100644 (file)
@@ -221,7 +221,7 @@ def add(args, config, basepath, workspace):
         initial_rev = stdout.rstrip()
 
     tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
-    rd = oe.recipeutils.parse_recipe(recipefile, None, tinfoil.config_data)
+    rd = oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, None)
     if not rd:
         return 1
 
index 8ea72ef2b5c2c1ecd336ccb672a9de8ef5da67c5..fc2f919383dafb4506482e4717af9e758bab0369 100644 (file)
@@ -318,7 +318,7 @@ def _create_new_recipe(newpv, md5, sha256, srcrev, srcbranch, workspace, tinfoil
         newvalues['SRC_URI[md5sum]'] = md5
         newvalues['SRC_URI[sha256sum]'] = sha256
 
-    rd = oe.recipeutils.parse_recipe(fullpath, None, tinfoil.config_data)
+    rd = oe.recipeutils.parse_recipe(tinfoil.cooker, fullpath, None)
     oe.recipeutils.patch_recipe(rd, fullpath, newvalues)
 
     return fullpath, copied
index 5d73d307e040b9d2e9bcb59c648e682e5969a9d0..1e0fc1ee856edd4e0c48961f7e0d6a4677159aca 100644 (file)
@@ -115,8 +115,7 @@ def _parse_recipe(pn, tinfoil):
         # Error already logged
         return None
     append_files = tinfoil.cooker.collection.get_file_appends(recipefile)
-    rd = oe.recipeutils.parse_recipe(recipefile, append_files,
-                                    tinfoil.config_data)
+    rd = oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, append_files)
     return rd
 
 def determine_file_source(targetpath, rd):
index 657d2b6a7b10d6f6f14c2dd235477f7ca6996450..85701c06a9b903647b810f8568244a3c9c25f70f 100644 (file)
@@ -51,7 +51,7 @@ def setvar(args):
     if args.recipe_only:
         patches = [oe.recipeutils.patch_recipe_file(args.recipefile, varvalues, patch=args.patch)]
     else:
-        rd = oe.recipeutils.parse_recipe(args.recipefile, None, tinfoil.config_data)
+        rd = oe.recipeutils.parse_recipe(tinfoil.cooker, args.recipefile, None)
         if not rd:
             return 1
         patches = oe.recipeutils.patch_recipe(rd, args.recipefile, varvalues, patch=args.patch)
index 8aab86adb372b2f29edfbfe9d784334f58d0e0d0..d06efe436a562af7c6a20d63d81d33394d9c1b81 100755 (executable)
@@ -40,13 +40,13 @@ def translate_virtualfns(tasks):
     try:
         tinfoil.prepare(False)
 
-        pkg_fn = tinfoil.cooker.recipecache.pkg_fn
+        recipecaches = tinfoil.cooker.recipecaches
         outtasks = []
         for task in tasks:
-            fn, taskname = task.rsplit(':', 1)
+            (mc, fn, taskname) = bb.runqueue.split_tid(task)
             if taskname.endswith('_setscene'):
                 taskname = taskname[:-9]
-            outtasks.append('%s:%s' % (pkg_fn[fn], taskname))
+            outtasks.append('%s:%s' % (recipecaches[mc].pkg_fn[fn], taskname))
     finally:
         tinfoil.shutdown()
     return outtasks