diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-16 18:00:13 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-18 10:07:23 +0100 |
commit | 189371f8393971d00bca0fceffd67cc07784f6ee (patch) | |
tree | 3b210e6773ea695a18db318f538e47842a1b9e2c | |
parent | 8b35b032ed47e8f8a89bce354ffd82e0301043ac (diff) | |
download | poky-189371f8393971d00bca0fceffd67cc07784f6ee.tar.gz |
devtool/recipetool/meta: Adapt to bitbake API changes for multi-configuration builds
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]
(From OE-Core rev: 041212fa37bb83acac5ce4ceb9b7b77ad172c5c3)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oe/recipeutils.py | 19 | ||||
-rw-r--r-- | meta/lib/oeqa/utils/commands.py | 2 | ||||
-rw-r--r-- | scripts/lib/devtool/__init__.py | 3 | ||||
-rw-r--r-- | scripts/lib/devtool/standard.py | 2 | ||||
-rw-r--r-- | scripts/lib/devtool/upgrade.py | 2 | ||||
-rw-r--r-- | scripts/lib/recipetool/append.py | 3 | ||||
-rw-r--r-- | scripts/lib/recipetool/setvar.py | 2 | ||||
-rwxr-xr-x | scripts/oe-check-sstate | 6 |
8 files changed, 19 insertions, 20 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index c77664f135..e7dd8afb08 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py | |||
@@ -27,16 +27,16 @@ list_vars = ['SRC_URI', 'LIC_FILES_CHKSUM'] | |||
27 | meta_vars = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION'] | 27 | meta_vars = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION'] |
28 | 28 | ||
29 | 29 | ||
30 | def pn_to_recipe(cooker, pn): | 30 | def pn_to_recipe(cooker, pn, mc=''): |
31 | """Convert a recipe name (PN) to the path to the recipe file""" | 31 | """Convert a recipe name (PN) to the path to the recipe file""" |
32 | import bb.providers | 32 | import bb.providers |
33 | 33 | ||
34 | if pn in cooker.recipecache.pkg_pn: | 34 | if pn in cooker.recipecaches[mc].pkg_pn: |
35 | best = bb.providers.findBestProvider(pn, cooker.data, cooker.recipecache, cooker.recipecache.pkg_pn) | 35 | best = bb.providers.findBestProvider(pn, cooker.data, cooker.recipecaches[mc], cooker.recipecaches[mc].pkg_pn) |
36 | return best[3] | 36 | return best[3] |
37 | elif pn in cooker.recipecache.providers: | 37 | elif pn in cooker.recipecaches[mc].providers: |
38 | filenames = cooker.recipecache.providers[pn] | 38 | filenames = cooker.recipecaches[mc].providers[pn] |
39 | eligible, foundUnique = bb.providers.filterProviders(filenames, pn, cooker.expanded_data, cooker.recipecache) | 39 | eligible, foundUnique = bb.providers.filterProviders(filenames, pn, cooker.expanded_data, cooker.recipecaches[mc]) |
40 | filename = eligible[0] | 40 | filename = eligible[0] |
41 | return filename | 41 | return filename |
42 | else: | 42 | else: |
@@ -50,13 +50,14 @@ def get_unavailable_reasons(cooker, pn): | |||
50 | return taskdata.get_reasons(pn) | 50 | return taskdata.get_reasons(pn) |
51 | 51 | ||
52 | 52 | ||
53 | def parse_recipe(fn, appendfiles, d): | 53 | def parse_recipe(cooker, fn, appendfiles): |
54 | """ | 54 | """ |
55 | Parse an individual recipe file, optionally with a list of | 55 | Parse an individual recipe file, optionally with a list of |
56 | bbappend files. | 56 | bbappend files. |
57 | """ | 57 | """ |
58 | import bb.cache | 58 | import bb.cache |
59 | envdata = bb.cache.Cache.loadDataFull(fn, appendfiles, d) | 59 | parser = bb.cache.NoCache(cooker.databuilder) |
60 | envdata = parser.loadDataFull(fn, appendfiles) | ||
60 | return envdata | 61 | return envdata |
61 | 62 | ||
62 | 63 | ||
@@ -79,7 +80,7 @@ def parse_recipe_simple(cooker, pn, d, appends=True): | |||
79 | appendfiles = cooker.collection.get_file_appends(recipefile) | 80 | appendfiles = cooker.collection.get_file_appends(recipefile) |
80 | else: | 81 | else: |
81 | appendfiles = None | 82 | appendfiles = None |
82 | return parse_recipe(recipefile, appendfiles, d) | 83 | return parse_recipe(cooker, recipefile, appendfiles) |
83 | 84 | ||
84 | 85 | ||
85 | def get_var_files(fn, varlist, d): | 86 | def get_var_files(fn, varlist, d): |
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py index a8e184d0c3..5cd0f7477b 100644 --- a/meta/lib/oeqa/utils/commands.py +++ b/meta/lib/oeqa/utils/commands.py | |||
@@ -223,7 +223,7 @@ def runqemu(pn, ssh=True): | |||
223 | tinfoil.config_data.setVar("TEST_QEMUBOOT_TIMEOUT", "1000") | 223 | tinfoil.config_data.setVar("TEST_QEMUBOOT_TIMEOUT", "1000") |
224 | import oe.recipeutils | 224 | import oe.recipeutils |
225 | recipefile = oe.recipeutils.pn_to_recipe(tinfoil.cooker, pn) | 225 | recipefile = oe.recipeutils.pn_to_recipe(tinfoil.cooker, pn) |
226 | recipedata = oe.recipeutils.parse_recipe(recipefile, [], tinfoil.config_data) | 226 | recipedata = oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, []) |
227 | 227 | ||
228 | # The QemuRunner log is saved out, but we need to ensure it is at the right | 228 | # The QemuRunner log is saved out, but we need to ensure it is at the right |
229 | # log level (and then ensure that since it's a child of the BitBake logger, | 229 | # log level (and then ensure that since it's a child of the BitBake logger, |
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index 65eb4527bc..216b7c345a 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py | |||
@@ -146,8 +146,7 @@ def parse_recipe(config, tinfoil, pn, appends, filter_workspace=True): | |||
146 | not path.startswith(config.workspace_path)] | 146 | not path.startswith(config.workspace_path)] |
147 | else: | 147 | else: |
148 | append_files = None | 148 | append_files = None |
149 | return oe.recipeutils.parse_recipe(recipefile, append_files, | 149 | return oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, append_files) |
150 | tinfoil.config_data) | ||
151 | 150 | ||
152 | def check_workspace_recipe(workspace, pn, checksrc=True, bbclassextend=False): | 151 | def check_workspace_recipe(workspace, pn, checksrc=True, bbclassextend=False): |
153 | """ | 152 | """ |
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 9c09533b54..3de2401325 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -221,7 +221,7 @@ def add(args, config, basepath, workspace): | |||
221 | initial_rev = stdout.rstrip() | 221 | initial_rev = stdout.rstrip() |
222 | 222 | ||
223 | tinfoil = setup_tinfoil(config_only=True, basepath=basepath) | 223 | tinfoil = setup_tinfoil(config_only=True, basepath=basepath) |
224 | rd = oe.recipeutils.parse_recipe(recipefile, None, tinfoil.config_data) | 224 | rd = oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, None) |
225 | if not rd: | 225 | if not rd: |
226 | return 1 | 226 | return 1 |
227 | 227 | ||
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py index 8ea72ef2b5..fc2f919383 100644 --- a/scripts/lib/devtool/upgrade.py +++ b/scripts/lib/devtool/upgrade.py | |||
@@ -318,7 +318,7 @@ def _create_new_recipe(newpv, md5, sha256, srcrev, srcbranch, workspace, tinfoil | |||
318 | newvalues['SRC_URI[md5sum]'] = md5 | 318 | newvalues['SRC_URI[md5sum]'] = md5 |
319 | newvalues['SRC_URI[sha256sum]'] = sha256 | 319 | newvalues['SRC_URI[sha256sum]'] = sha256 |
320 | 320 | ||
321 | rd = oe.recipeutils.parse_recipe(fullpath, None, tinfoil.config_data) | 321 | rd = oe.recipeutils.parse_recipe(tinfoil.cooker, fullpath, None) |
322 | oe.recipeutils.patch_recipe(rd, fullpath, newvalues) | 322 | oe.recipeutils.patch_recipe(rd, fullpath, newvalues) |
323 | 323 | ||
324 | return fullpath, copied | 324 | return fullpath, copied |
diff --git a/scripts/lib/recipetool/append.py b/scripts/lib/recipetool/append.py index 5d73d307e0..1e0fc1ee85 100644 --- a/scripts/lib/recipetool/append.py +++ b/scripts/lib/recipetool/append.py | |||
@@ -115,8 +115,7 @@ def _parse_recipe(pn, tinfoil): | |||
115 | # Error already logged | 115 | # Error already logged |
116 | return None | 116 | return None |
117 | append_files = tinfoil.cooker.collection.get_file_appends(recipefile) | 117 | append_files = tinfoil.cooker.collection.get_file_appends(recipefile) |
118 | rd = oe.recipeutils.parse_recipe(recipefile, append_files, | 118 | rd = oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, append_files) |
119 | tinfoil.config_data) | ||
120 | return rd | 119 | return rd |
121 | 120 | ||
122 | def determine_file_source(targetpath, rd): | 121 | def determine_file_source(targetpath, rd): |
diff --git a/scripts/lib/recipetool/setvar.py b/scripts/lib/recipetool/setvar.py index 657d2b6a7b..85701c06a9 100644 --- a/scripts/lib/recipetool/setvar.py +++ b/scripts/lib/recipetool/setvar.py | |||
@@ -51,7 +51,7 @@ def setvar(args): | |||
51 | if args.recipe_only: | 51 | if args.recipe_only: |
52 | patches = [oe.recipeutils.patch_recipe_file(args.recipefile, varvalues, patch=args.patch)] | 52 | patches = [oe.recipeutils.patch_recipe_file(args.recipefile, varvalues, patch=args.patch)] |
53 | else: | 53 | else: |
54 | rd = oe.recipeutils.parse_recipe(args.recipefile, None, tinfoil.config_data) | 54 | rd = oe.recipeutils.parse_recipe(tinfoil.cooker, args.recipefile, None) |
55 | if not rd: | 55 | if not rd: |
56 | return 1 | 56 | return 1 |
57 | patches = oe.recipeutils.patch_recipe(rd, args.recipefile, varvalues, patch=args.patch) | 57 | patches = oe.recipeutils.patch_recipe(rd, args.recipefile, varvalues, patch=args.patch) |
diff --git a/scripts/oe-check-sstate b/scripts/oe-check-sstate index 8aab86adb3..d06efe436a 100755 --- a/scripts/oe-check-sstate +++ b/scripts/oe-check-sstate | |||
@@ -40,13 +40,13 @@ def translate_virtualfns(tasks): | |||
40 | try: | 40 | try: |
41 | tinfoil.prepare(False) | 41 | tinfoil.prepare(False) |
42 | 42 | ||
43 | pkg_fn = tinfoil.cooker.recipecache.pkg_fn | 43 | recipecaches = tinfoil.cooker.recipecaches |
44 | outtasks = [] | 44 | outtasks = [] |
45 | for task in tasks: | 45 | for task in tasks: |
46 | fn, taskname = task.rsplit(':', 1) | 46 | (mc, fn, taskname) = bb.runqueue.split_tid(task) |
47 | if taskname.endswith('_setscene'): | 47 | if taskname.endswith('_setscene'): |
48 | taskname = taskname[:-9] | 48 | taskname = taskname[:-9] |
49 | outtasks.append('%s:%s' % (pkg_fn[fn], taskname)) | 49 | outtasks.append('%s:%s' % (recipecaches[mc].pkg_fn[fn], taskname)) |
50 | finally: | 50 | finally: |
51 | tinfoil.shutdown() | 51 | tinfoil.shutdown() |
52 | return outtasks | 52 | return outtasks |