]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
checklayer: Fix regex in get_signatures
authorPaul Barker <paul@pbarker.dev>
Thu, 19 Mar 2026 16:04:39 +0000 (16:04 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 24 Mar 2026 14:47:36 +0000 (14:47 +0000)
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 <task> 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 <module>
        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 <paul@pbarker.dev>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/checklayer/__init__.py

index b70cef1b1441108af26814de8c0133a15c94a30a..15459b6e04865d15f5a4ce2c87ad4d6c6a88cb4b 100644 (file)
@@ -324,7 +324,7 @@ def get_signatures(builddir, failsafe=False, machine=None, extravars=None):
         else:
             raise
 
-    sig_regex = re.compile(r"^(?P<task>.*:.*):(?P<hash>.*) .$")
+    sig_regex = re.compile(r"^(?P<task>[^:]*:[^:]*):(?P<hash>.*) .$")
     tune_regex = re.compile(r"(^|\s)SIGGEN_LOCKEDSIGS_t-(?P<tune>\S*)\s*=\s*")
     current_tune = None
     with open(sigs_file, 'r') as f: