From ea01bd31c3f4645ca0efddf6913d5136b4ea5a8a Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Tue, 19 Nov 2019 23:52:52 +1300 Subject: 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 Signed-off-by: Richard Purdie --- scripts/lib/scriptutils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts/lib/scriptutils.py') diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py index c573dc7f67..45bdaf5f4e 100644 --- a/scripts/lib/scriptutils.py +++ b/scripts/lib/scriptutils.py @@ -268,3 +268,13 @@ def is_src_url(param): elif param.startswith('git@') or ('@' in param and param.endswith('.git')): return True return False + +def filter_src_subdirs(pth): + """ + Filter out subdirectories of initial unpacked source trees that we do not care about. + Used by devtool and recipetool. + """ + dirlist = os.listdir(pth) + filterout = ['git.indirectionsymlink', 'source-date-epoch'] + dirlist = [x for x in dirlist if x not in filterout] + return dirlist -- cgit v1.2.3-54-g00ecf