diff options
| author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-10-30 17:16:56 +1300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-11-11 12:14:27 +0000 |
| commit | fcb84383ce9b555c13772515ec4f1f1f9b34737d (patch) | |
| tree | 3fcdcf426f97bc956c041867787b005937ec0bb0 /scripts/lib/devtool/standard.py | |
| parent | f6e21d1bfcb5d9d10c14afa7715c128700282db8 (diff) | |
| download | poky-fcb84383ce9b555c13772515ec4f1f1f9b34737d.tar.gz | |
devtool: upgrade: automatically handle changes to source subdirectory
If the directory where the source code extracts to changes (for
example, when upgrading iucode-tool from 1.5 to 2.1.1, the subdirectory
in the tarball changed from "iucode_tool-${PV}" to "iucode-tool-${PV}")
then handle this automatically. Also handle when it changes to match the
default S value (i.e. "${WORKDIR}/${BP}") in which case we just drop
setting S in the recipe.
Fixes [YOCTO #10939].
(From OE-Core rev: d29881a652bf03627d257a1eac5f02ec17315b8b)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@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.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 166862f12f..5ac678b3b1 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
| @@ -409,7 +409,7 @@ def extract(args, config, basepath, workspace): | |||
| 409 | return 1 | 409 | return 1 |
| 410 | 410 | ||
| 411 | srctree = os.path.abspath(args.srctree) | 411 | srctree = os.path.abspath(args.srctree) |
| 412 | initial_rev = _extract_source(srctree, args.keep_temp, args.branch, False, config, basepath, workspace, args.fixed_setup, rd, tinfoil) | 412 | initial_rev, _ = _extract_source(srctree, args.keep_temp, args.branch, False, config, basepath, workspace, args.fixed_setup, rd, tinfoil) |
| 413 | logger.info('Source tree extracted to %s' % srctree) | 413 | logger.info('Source tree extracted to %s' % srctree) |
| 414 | 414 | ||
| 415 | if initial_rev: | 415 | if initial_rev: |
| @@ -433,7 +433,7 @@ def sync(args, config, basepath, workspace): | |||
| 433 | return 1 | 433 | return 1 |
| 434 | 434 | ||
| 435 | srctree = os.path.abspath(args.srctree) | 435 | srctree = os.path.abspath(args.srctree) |
| 436 | initial_rev = _extract_source(srctree, args.keep_temp, args.branch, True, config, basepath, workspace, args.fixed_setup, rd, tinfoil) | 436 | initial_rev, _ = _extract_source(srctree, args.keep_temp, args.branch, True, config, basepath, workspace, args.fixed_setup, rd, tinfoil) |
| 437 | logger.info('Source tree %s synchronized' % srctree) | 437 | logger.info('Source tree %s synchronized' % srctree) |
| 438 | 438 | ||
| 439 | if initial_rev: | 439 | if initial_rev: |
| @@ -549,6 +549,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works | |||
| 549 | 549 | ||
| 550 | with open(os.path.join(tempdir, 'srcsubdir'), 'r') as f: | 550 | with open(os.path.join(tempdir, 'srcsubdir'), 'r') as f: |
| 551 | srcsubdir = f.read() | 551 | srcsubdir = f.read() |
| 552 | srcsubdir_rel = os.path.relpath(srcsubdir, os.path.join(tempdir, 'workdir')) | ||
| 552 | 553 | ||
| 553 | tempdir_localdir = os.path.join(tempdir, 'oe-local-files') | 554 | tempdir_localdir = os.path.join(tempdir, 'oe-local-files') |
| 554 | srctree_localdir = os.path.join(srctree, 'oe-local-files') | 555 | srctree_localdir = os.path.join(srctree, 'oe-local-files') |
| @@ -615,7 +616,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works | |||
| 615 | logger.info('Preserving temporary directory %s' % tempdir) | 616 | logger.info('Preserving temporary directory %s' % tempdir) |
| 616 | else: | 617 | else: |
| 617 | shutil.rmtree(tempdir) | 618 | shutil.rmtree(tempdir) |
| 618 | return initial_rev | 619 | return initial_rev, srcsubdir_rel |
| 619 | 620 | ||
| 620 | def _add_md5(config, recipename, filename): | 621 | def _add_md5(config, recipename, filename): |
| 621 | """Record checksum of a file (or recursively for a directory) to the md5-file of the workspace""" | 622 | """Record checksum of a file (or recursively for a directory) to the md5-file of the workspace""" |
| @@ -713,7 +714,7 @@ def modify(args, config, basepath, workspace): | |||
| 713 | initial_rev = None | 714 | initial_rev = None |
| 714 | commits = [] | 715 | commits = [] |
| 715 | if not args.no_extract: | 716 | if not args.no_extract: |
| 716 | initial_rev = _extract_source(srctree, args.keep_temp, args.branch, False, config, basepath, workspace, args.fixed_setup, rd, tinfoil) | 717 | initial_rev, _ = _extract_source(srctree, args.keep_temp, args.branch, False, config, basepath, workspace, args.fixed_setup, rd, tinfoil) |
| 717 | if not initial_rev: | 718 | if not initial_rev: |
| 718 | return 1 | 719 | return 1 |
| 719 | logger.info('Source tree extracted to %s' % srctree) | 720 | logger.info('Source tree extracted to %s' % srctree) |
