From: Paul Barker Date: Thu, 19 Mar 2026 16:04:39 +0000 (+0000) Subject: checklayer: Fix regex in get_signatures X-Git-Tag: yocto-6.0_M3~209 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2f7052cf832a4869574f66e33efbe5bf38301e1;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git checklayer: Fix regex in get_signatures After commit 11373def3171 ("sstatesig/populate_sdk_ext: Improve unihash cache handling") in openembedded-core, the locked-sigs.inc file may contain unihash map entries as well as a list of locked sigs. The unihash map entries consist of four fields separated by `:` - pn, task, task hash and unihash. The current regex in get_signatures cannot parse these correctly, it grabs the first 3 elements into when there should only be two elements, leading to an error: Traceback (most recent call last): File "/srv/pokybuild/yocto-worker/check-layer/build/layers/openembedded-core/scripts/yocto-check-layer", line 252, in ret = main() File "/srv/pokybuild/yocto-worker/check-layer/build/layers/openembedded-core/scripts/yocto-check-layer", line 215, in main td['sigs'], td['tunetasks'] = get_signatures(td['builddir']) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ File "/srv/pokybuild/yocto-worker/check-layer/build/layers/openembedded-core/scripts/lib/checklayer/__init__.py", line 340, in get_signatures (recipe, task) = s.group('task').split(':') ^^^^^^^^^^^^^^ ValueError: too many values to unpack (expected 2) Modify the regex so that it doesn't accidentally pick up the third field of the unihash map entries. Signed-off-by: Paul Barker Signed-off-by: Richard Purdie --- diff --git a/scripts/lib/checklayer/__init__.py b/scripts/lib/checklayer/__init__.py index b70cef1b14..15459b6e04 100644 --- a/scripts/lib/checklayer/__init__.py +++ b/scripts/lib/checklayer/__init__.py @@ -324,7 +324,7 @@ def get_signatures(builddir, failsafe=False, machine=None, extravars=None): else: raise - sig_regex = re.compile(r"^(?P.*:.*):(?P.*) .$") + sig_regex = re.compile(r"^(?P[^:]*:[^:]*):(?P.*) .$") tune_regex = re.compile(r"(^|\s)SIGGEN_LOCKEDSIGS_t-(?P\S*)\s*=\s*") current_tune = None with open(sigs_file, 'r') as f: