[gnome-continuous-yocto/gnomeostree-3.28-rocko: 6833/8267] devtool: extract: refactor kern-tools-native handling
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 6833/8267] devtool: extract: refactor kern-tools-native handling
- Date: Sun, 17 Dec 2017 05:23:58 +0000 (UTC)
commit a9848fdd46f4f567444e00892a0f5868deea1643
Author: Paul Eggleton <paul eggleton linux intel com>
Date: Thu Jul 20 16:48:08 2017 +0200
devtool: extract: refactor kern-tools-native handling
When extracting linux-yocto kernel source, we don't need to dance around
shutting down and starting up tinfoil anymore, we can just execute the
tasks as needed when needed using tinfoil's new build_targets()
function. This allows us to tidy up the code structure a bit.
(From OE-Core rev: 5c7f5031023fb74b5f2f26d6b3c829981f2f54d2)
Signed-off-by: Paul Eggleton <paul eggleton linux intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
scripts/lib/devtool/standard.py | 37 +++++--------------------------------
1 files changed, 5 insertions(+), 32 deletions(-)
---
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 7e342e7..0104e67 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -383,7 +383,7 @@ def extract(args, config, basepath, workspace):
"""Entry point for the devtool 'extract' subcommand"""
import bb
- tinfoil = _prep_extract_operation(config, basepath, args.recipename)
+ tinfoil = setup_tinfoil(basepath=basepath)
if not tinfoil:
# Error already shown
return 1
@@ -407,7 +407,7 @@ def sync(args, config, basepath, workspace):
"""Entry point for the devtool 'sync' subcommand"""
import bb
- tinfoil = _prep_extract_operation(config, basepath, args.recipename)
+ tinfoil = setup_tinfoil(basepath=basepath)
if not tinfoil:
# Error already shown
return 1
@@ -428,29 +428,6 @@ def sync(args, config, basepath, workspace):
tinfoil.shutdown()
-def _prep_extract_operation(config, basepath, recipename, tinfoil=None):
- """HACK: Ugly workaround for making sure that requirements are met when
- trying to extract a package. Returns the tinfoil instance to be used."""
- if not tinfoil:
- tinfoil = setup_tinfoil(basepath=basepath)
-
- rd = parse_recipe(config, tinfoil, recipename, True)
- if not rd:
- tinfoil.shutdown()
- return None
-
- if bb.data.inherits_class('kernel-yocto', rd):
- tinfoil.shutdown()
- try:
- stdout, _ = exec_build_env_command(config.init_path, basepath,
- 'bitbake kern-tools-native')
- tinfoil = setup_tinfoil(basepath=basepath)
- except bb.process.ExecutionError as err:
- raise DevtoolError("Failed to build kern-tools-native:\n%s" %
- err.stdout)
- return tinfoil
-
-
def _extract_source(srctree, keep_temp, devbranch, sync, d, tinfoil):
"""Extract sources of a recipe"""
import oe.recipeutils
@@ -475,6 +452,9 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d, tinfoil):
raise DevtoolError("The %s recipe has do_unpack disabled, unable to "
"extract source" % pn, 4)
+ if bb.data.inherits_class('kernel-yocto', d):
+ tinfoil.build_targets('kern-tools-native')
+
if not sync:
# Prepare for shutil.move later on
bb.utils.mkdirhier(srctree)
@@ -773,13 +753,6 @@ def modify(args, config, basepath, workspace):
raise DevtoolError("--no-extract specified and source path %s does "
"not exist or is not a directory" %
srctree)
- if not args.no_extract:
- tinfoil = _prep_extract_operation(config, basepath, pn, tinfoil)
- if not tinfoil:
- # Error already shown
- return 1
- # We need to re-parse because tinfoil may have been re-initialised
- rd = parse_recipe(config, tinfoil, args.recipename, True)
recipefile = rd.getVar('FILE')
appendfile = recipe_to_append(recipefile, config, args.wildcard)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]