]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
patchtest: fix lic_files_chksum test regex
authorTrevor Gamblin <tgamblin@baylibre.com>
Fri, 20 Oct 2023 14:42:02 +0000 (10:42 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 20 Oct 2023 16:02:10 +0000 (17:02 +0100)
the test_lic_files_chksum_modified_not_mentioned test in patchtest
wasn't picking up on 'License-Update:' tags correctly. Use pyparsing's
AtLineStart class to simplify the regex setup and search.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/patchtest/tests/test_metadata_lic_files_chksum.py

index cb3e7c9d341b7af77850fc565e781f38744a30b2..fa4a28c7b22c29c23bab99d88ac1afd0d0d6bb8c 100644 (file)
@@ -12,8 +12,7 @@ class LicFilesChkSum(base.Metadata):
     metadata = 'LIC_FILES_CHKSUM'
     license  = 'LICENSE'
     closed   = 'CLOSED'
-    lictag   = 'License-Update'
-    lictag_re  = pyparsing.Regex("^%s:" % lictag)
+    lictag_re  = pyparsing.AtLineStart("License-Update:")
 
     def test_lic_files_chksum_presence(self):
         if not self.added:
@@ -71,5 +70,5 @@ class LicFilesChkSum(base.Metadata):
                     if self.lictag_re.search_string(commit.commit_message):
                        break
                 else:
-                    self.fail('LIC_FILES_CHKSUM changed on target %s but there is no "%s" tag in commit message. Include it with a brief description' % (pn, self.lictag),
+                    self.fail('LIC_FILES_CHKSUM changed on target %s but there is no "License-Update:" tag in commit message. Include it with a brief description' % pn,
                               data=[('Current checksum', pretest), ('New checksum', test)])