summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/standard.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2015-09-23 11:05:23 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-24 17:54:24 +0100
commit85d8b4a92fc7873a458a92a7d409bf73ff25c23b (patch)
tree3838e0d702ccde9b384ffca862723d14d679ea55 /scripts/lib/devtool/standard.py
parent6363a95550c1b78f8d9788de8b1d2cea7b06837a (diff)
downloadpoky-85d8b4a92fc7873a458a92a7d409bf73ff25c23b.tar.gz
devtool: second fix for running from a different directory
Do not change change current working directory permanently, but, only for the duration of tinfoil initialization instead. The previous fix caused very unintuitive behavior where using relative paths were solved with respect to the builddir instead of the current working directory. E.g. calling "devtool extract zlib ./zlib" would always create create srctree in ${TOPDIR}/zlib, independent of the users cwd. (From OE-Core rev: 4c7f159b0e17a0475a4a4e9dc4dd012e3d2e6a1f) (From OE-Core rev: 05060699e63cd25d089e83e9aa56c11d5baa8fd8) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/standard.py')
-rw-r--r--scripts/lib/devtool/standard.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 96b271c2d6..1dcf7cdf07 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -111,7 +111,7 @@ def add(args, config, basepath, workspace):
111 (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree) 111 (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree)
112 initial_rev = stdout.rstrip() 112 initial_rev = stdout.rstrip()
113 113
114 tinfoil = setup_tinfoil(config_only=True) 114 tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
115 rd = oe.recipeutils.parse_recipe(recipefile, None, tinfoil.config_data) 115 rd = oe.recipeutils.parse_recipe(recipefile, None, tinfoil.config_data)
116 if not rd: 116 if not rd:
117 return 1 117 return 1
@@ -231,7 +231,7 @@ class BbTaskExecutor(object):
231def _prep_extract_operation(config, basepath, recipename): 231def _prep_extract_operation(config, basepath, recipename):
232 """HACK: Ugly workaround for making sure that requirements are met when 232 """HACK: Ugly workaround for making sure that requirements are met when
233 trying to extract a package. Returns the tinfoil instance to be used.""" 233 trying to extract a package. Returns the tinfoil instance to be used."""
234 tinfoil = setup_tinfoil() 234 tinfoil = setup_tinfoil(basepath=basepath)
235 rd = parse_recipe(config, tinfoil, recipename, True) 235 rd = parse_recipe(config, tinfoil, recipename, True)
236 236
237 if bb.data.inherits_class('kernel-yocto', rd): 237 if bb.data.inherits_class('kernel-yocto', rd):
@@ -239,7 +239,7 @@ def _prep_extract_operation(config, basepath, recipename):
239 try: 239 try:
240 stdout, _ = exec_build_env_command(config.init_path, basepath, 240 stdout, _ = exec_build_env_command(config.init_path, basepath,
241 'bitbake kern-tools-native') 241 'bitbake kern-tools-native')
242 tinfoil = setup_tinfoil() 242 tinfoil = setup_tinfoil(basepath=basepath)
243 except bb.process.ExecutionError as err: 243 except bb.process.ExecutionError as err:
244 raise DevtoolError("Failed to build kern-tools-native:\n%s" % 244 raise DevtoolError("Failed to build kern-tools-native:\n%s" %
245 err.stdout) 245 err.stdout)
@@ -443,7 +443,7 @@ def modify(args, config, basepath, workspace):
443 if args.extract: 443 if args.extract:
444 tinfoil = _prep_extract_operation(config, basepath, args.recipename) 444 tinfoil = _prep_extract_operation(config, basepath, args.recipename)
445 else: 445 else:
446 tinfoil = setup_tinfoil() 446 tinfoil = setup_tinfoil(basepath=basepath)
447 447
448 rd = parse_recipe(config, tinfoil, args.recipename, True) 448 rd = parse_recipe(config, tinfoil, args.recipename, True)
449 if not rd: 449 if not rd:
@@ -797,7 +797,7 @@ def update_recipe(args, config, basepath, workspace):
797 raise DevtoolError('conf/layer.conf not found in bbappend ' 797 raise DevtoolError('conf/layer.conf not found in bbappend '
798 'destination layer "%s"' % args.append) 798 'destination layer "%s"' % args.append)
799 799
800 tinfoil = setup_tinfoil() 800 tinfoil = setup_tinfoil(basepath=basepath)
801 801
802 rd = parse_recipe(config, tinfoil, args.recipename, True) 802 rd = parse_recipe(config, tinfoil, args.recipename, True)
803 if not rd: 803 if not rd: