aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/upgrade.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-09-22 17:21:27 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-22 18:12:55 +0100
commit320585b7ff6340df0b0dbc63f95ed3ca8fc3a993 (patch)
treebd0cab3c5f7099510cb96ad8ed99523b2d633f5b /scripts/lib/devtool/upgrade.py
parentd2bb9f08303bb120e811c03af2f5339e8f262cfa (diff)
downloadopenembedded-core-contrib-320585b7ff6340df0b0dbc63f95ed3ca8fc3a993.tar.gz
devtool: add: properly handle separate build directory
When we were adding a recipe for software that would typically be built in the same directory as the source, we were always using a separate build directory unless the user explicitly specified not to, leading to errors for software that doesn't expect to be built that way (such as Python modules using distutils). Split out the code that makes this determination automatically from the "devtool modify" and "devtool upgrade" code and re-use that here so the behaviour is consistent. 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/upgrade.py')
-rw-r--r--scripts/lib/devtool/upgrade.py20
1 files changed, 3 insertions, 17 deletions
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 86443b0735..6c1dfee3fe 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -29,7 +29,7 @@ import errno
import bb
import oe.recipeutils
from devtool import standard
-from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe
+from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe, use_external_build
logger = logging.getLogger('devtool')
@@ -126,21 +126,6 @@ def _rename_recipe_files(bpn, oldpv, newpv, path):
_rename_recipe_dirs(oldpv, newpv, path)
return _rename_recipe_file(bpn, oldpv, newpv, path)
-def _use_external_build(same_dir, no_same_dir, d):
- b_is_s = True
- if no_same_dir:
- logger.info('using separate build directory since --no-same-dir specified')
- b_is_s = False
- elif same_dir:
- logger.info('using source tree as build directory since --same-dir specified')
- elif bb.data.inherits_class('autotools-brokensep', d):
- logger.info('using source tree as build directory since original recipe inherits autotools-brokensep')
- elif d.getVar('B', True) == os.path.abspath(d.getVar('S', True)):
- logger.info('using source tree as build directory since that is the default for this recipe')
- else:
- b_is_s = False
- return b_is_s
-
def _write_append(rc, srctree, same_dir, no_same_dir, rev, workspace, d):
"""Writes an append file"""
if not os.path.exists(rc):
@@ -161,7 +146,8 @@ def _write_append(rc, srctree, same_dir, no_same_dir, rev, workspace, d):
f.write(('# NOTE: We use pn- overrides here to avoid affecting'
'multiple variants in the case where the recipe uses BBCLASSEXTEND\n'))
f.write('EXTERNALSRC_pn-%s = "%s"\n' % (pn, srctree))
- if _use_external_build(same_dir, no_same_dir, d):
+ b_is_s = use_external_build(same_dir, no_same_dir, d)
+ if b_is_s:
f.write('EXTERNALSRC_BUILD_pn-%s = "%s"\n' % (pn, srctree))
if rev:
f.write('\n# initial_rev: %s\n' % rev)