From: Peter Kjellerstedt Date: Tue, 3 Oct 2023 01:05:27 +0000 (+0200) Subject: externalsrc.bbclass: Support specifying patterns in CONFIGURE_FILES X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09873b3fb24a00cfbd73282d29e4c5821774f579;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git externalsrc.bbclass: Support specifying patterns in CONFIGURE_FILES This allows, e.g., *.cmake to be added to CONFIGURE_FILES to make the do_configure task depend on changes to any cmake file. Signed-off-by: Peter Kjellerstedt Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass index cba80bb1d4d..a54f316aa0a 100644 --- a/meta/classes/externalsrc.bbclass +++ b/meta/classes/externalsrc.bbclass @@ -252,6 +252,8 @@ def srctree_configure_hash_files(d): Get the list of files that should trigger do_configure to re-execute, based on the value of CONFIGURE_FILES """ + import fnmatch + in_files = (d.getVar('CONFIGURE_FILES') or '').split() out_items = [] search_files = [] @@ -263,8 +265,8 @@ def srctree_configure_hash_files(d): if search_files: s_dir = d.getVar('EXTERNALSRC') for root, _, files in os.walk(s_dir): - for f in files: - if f in search_files: + for p in search_files: + for f in fnmatch.filter(files, p): out_items.append('%s:True' % os.path.join(root, f)) return ' '.join(out_items)