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:
Paul Eggleton
2019-11-19 23:52:52 +13:00
committed by Richard Purdie
parent 81cd5f7714
commit ea01bd31c3
3 changed files with 14 additions and 5 deletions

View File

@@ -495,9 +495,7 @@ def create_recipe(args):
if ftmpdir and args.keep_temp:
logger.info('Fetch temp directory is %s' % ftmpdir)
dirlist = os.listdir(srctree)
filterout = ['git.indirectionsymlink', 'source-date-epoch']
dirlist = [x for x in dirlist if x not in filterout]
dirlist = scriptutils.filter_src_subdirs(srctree)
logger.debug('Directory listing (excluding filtered out):\n %s' % '\n '.join(dirlist))
if len(dirlist) == 1:
singleitem = os.path.join(srctree, dirlist[0])