summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/upgrade.py
diff options
context:
space:
mode:
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
29import bb 29import bb
30import oe.recipeutils 30import oe.recipeutils
31from devtool import standard 31from devtool import standard
32from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe 32from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe, use_external_build
33 33
34logger = logging.getLogger('devtool') 34logger = logging.getLogger('devtool')
35 35
@@ -126,21 +126,6 @@ def _rename_recipe_files(bpn, oldpv, newpv, path):
126 _rename_recipe_dirs(oldpv, newpv, path) 126 _rename_recipe_dirs(oldpv, newpv, path)
127 return _rename_recipe_file(bpn, oldpv, newpv, path) 127 return _rename_recipe_file(bpn, oldpv, newpv, path)
128 128
129def _use_external_build(same_dir, no_same_dir, d):
130 b_is_s = True
131 if no_same_dir:
132 logger.info('using separate build directory since --no-same-dir specified')
133 b_is_s = False
134 elif same_dir:
135 logger.info('using source tree as build directory since --same-dir specified')
136 elif bb.data.inherits_class('autotools-brokensep', d):
137 logger.info('using source tree as build directory since original recipe inherits autotools-brokensep')
138 elif d.getVar('B', True) == os.path.abspath(d.getVar('S', True)):
139 logger.info('using source tree as build directory since that is the default for this recipe')
140 else:
141 b_is_s = False
142 return b_is_s
143
144def _write_append(rc, srctree, same_dir, no_same_dir, rev, workspace, d): 129def _write_append(rc, srctree, same_dir, no_same_dir, rev, workspace, d):
145 """Writes an append file""" 130 """Writes an append file"""
146 if not os.path.exists(rc): 131 if not os.path.exists(rc):
@@ -161,7 +146,8 @@ def _write_append(rc, srctree, same_dir, no_same_dir, rev, workspace, d):
161 f.write(('# NOTE: We use pn- overrides here to avoid affecting' 146 f.write(('# NOTE: We use pn- overrides here to avoid affecting'
162 'multiple variants in the case where the recipe uses BBCLASSEXTEND\n')) 147 'multiple variants in the case where the recipe uses BBCLASSEXTEND\n'))
163 f.write('EXTERNALSRC_pn-%s = "%s"\n' % (pn, srctree)) 148 f.write('EXTERNALSRC_pn-%s = "%s"\n' % (pn, srctree))
164 if _use_external_build(same_dir, no_same_dir, d): 149 b_is_s = use_external_build(same_dir, no_same_dir, d)
150 if b_is_s:
165 f.write('EXTERNALSRC_BUILD_pn-%s = "%s"\n' % (pn, srctree)) 151 f.write('EXTERNALSRC_BUILD_pn-%s = "%s"\n' % (pn, srctree))
166 if rev: 152 if rev:
167 f.write('\n# initial_rev: %s\n' % rev) 153 f.write('\n# initial_rev: %s\n' % rev)