mirror of
https://git.yoctoproject.org/poky
synced 2026-04-04 23:02:22 +02:00
devtool: fix devtool upgrade with reproducible_builds class
If the reproducible_build class is inherited then there may be a "source-date-epoch" subdirectory in a fetched source tree; devtool upgrade was not expecting that in the upgraded source. Take a small snippet of code from recipetool create which already handles this, and make it a shared function that can be used in both places. Additionally, fix an assumption that the source is always in a subdirectory in the cleanup code that blocked debugging this. [YOCTO #13635] (From OE-Core rev: 0d642861cd9cf034b8d4951433980addc215d4fd) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
81cd5f7714
commit
ea01bd31c3
@@ -32,7 +32,7 @@ def _run(cmd, cwd=''):
|
||||
|
||||
def _get_srctree(tmpdir):
|
||||
srctree = tmpdir
|
||||
dirs = os.listdir(tmpdir)
|
||||
dirs = scriptutils.filter_src_subdirs(tmpdir)
|
||||
if len(dirs) == 1:
|
||||
srctree = os.path.join(tmpdir, dirs[0])
|
||||
return srctree
|
||||
@@ -281,7 +281,8 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee
|
||||
logger.info('Preserving temporary directory %s' % tmpsrctree)
|
||||
else:
|
||||
shutil.rmtree(tmpsrctree)
|
||||
shutil.rmtree(tmpdir)
|
||||
if tmpdir != tmpsrctree:
|
||||
shutil.rmtree(tmpdir)
|
||||
|
||||
return (rev, md5, sha256, srcbranch, srcsubdir_rel)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user