diff options
Diffstat (limited to 'scripts/lib/devtool/upgrade.py')
| -rw-r--r-- | scripts/lib/devtool/upgrade.py | 20 |
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 | |||
| 29 | import bb | 29 | import bb |
| 30 | import oe.recipeutils | 30 | import oe.recipeutils |
| 31 | from devtool import standard | 31 | from devtool import standard |
| 32 | from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe | 32 | from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe, use_external_build |
| 33 | 33 | ||
| 34 | logger = logging.getLogger('devtool') | 34 | logger = 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 | ||
| 129 | def _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 | |||
| 144 | def _write_append(rc, srctree, same_dir, no_same_dir, rev, workspace, d): | 129 | def _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) |
