mirror of
https://git.yoctoproject.org/poky
synced 2026-07-27 07:27:12 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
f6e21d1bfc
commit
fcb84383ce
@@ -409,7 +409,7 @@ def extract(args, config, basepath, workspace):
|
||||
return 1
|
||||
|
||||
srctree = os.path.abspath(args.srctree)
|
||||
initial_rev = _extract_source(srctree, args.keep_temp, args.branch, False, config, basepath, workspace, args.fixed_setup, rd, tinfoil)
|
||||
initial_rev, _ = _extract_source(srctree, args.keep_temp, args.branch, False, config, basepath, workspace, args.fixed_setup, rd, tinfoil)
|
||||
logger.info('Source tree extracted to %s' % srctree)
|
||||
|
||||
if initial_rev:
|
||||
@@ -433,7 +433,7 @@ def sync(args, config, basepath, workspace):
|
||||
return 1
|
||||
|
||||
srctree = os.path.abspath(args.srctree)
|
||||
initial_rev = _extract_source(srctree, args.keep_temp, args.branch, True, config, basepath, workspace, args.fixed_setup, rd, tinfoil)
|
||||
initial_rev, _ = _extract_source(srctree, args.keep_temp, args.branch, True, config, basepath, workspace, args.fixed_setup, rd, tinfoil)
|
||||
logger.info('Source tree %s synchronized' % srctree)
|
||||
|
||||
if initial_rev:
|
||||
@@ -549,6 +549,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works
|
||||
|
||||
with open(os.path.join(tempdir, 'srcsubdir'), 'r') as f:
|
||||
srcsubdir = f.read()
|
||||
srcsubdir_rel = os.path.relpath(srcsubdir, os.path.join(tempdir, 'workdir'))
|
||||
|
||||
tempdir_localdir = os.path.join(tempdir, 'oe-local-files')
|
||||
srctree_localdir = os.path.join(srctree, 'oe-local-files')
|
||||
@@ -615,7 +616,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works
|
||||
logger.info('Preserving temporary directory %s' % tempdir)
|
||||
else:
|
||||
shutil.rmtree(tempdir)
|
||||
return initial_rev
|
||||
return initial_rev, srcsubdir_rel
|
||||
|
||||
def _add_md5(config, recipename, filename):
|
||||
"""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):
|
||||
initial_rev = None
|
||||
commits = []
|
||||
if not args.no_extract:
|
||||
initial_rev = _extract_source(srctree, args.keep_temp, args.branch, False, config, basepath, workspace, args.fixed_setup, rd, tinfoil)
|
||||
initial_rev, _ = _extract_source(srctree, args.keep_temp, args.branch, False, config, basepath, workspace, args.fixed_setup, rd, tinfoil)
|
||||
if not initial_rev:
|
||||
return 1
|
||||
logger.info('Source tree extracted to %s' % srctree)
|
||||
|
||||
Reference in New Issue
Block a user