diff mbox series

[walnascar,08/17] insane.bbclass: Report all invalid PACKAGECONFIGs for a recipe at once

Message ID c311d5ddc102f26ac1813c540520175cfed3a5a6.1746804035.git.steve@sakoman.com
State RFC
Delegated to: Steve Sakoman
Headers show
Series [walnascar,01/17] qemu 8.2.7: ignore CVE-2023-1386 | expand

Commit Message

Steve Sakoman May 9, 2025, 3:23 p.m. UTC
From: Peter Kjellerstedt <pkj@axis.com>

Rather than reporting each invalid PACKAGECONFIG with a separate error
message, report them all with one error message.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/classes-global/insane.bbclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass
index 748de050e0..cd26bf5eb9 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -1469,10 +1469,10 @@  python do_recipe_qa() {
         pkgconfigs = (d.getVar("PACKAGECONFIG") or "").split()
         if pkgconfigs:
             pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
-            for pkgconfig in pkgconfigs:
-                if pkgconfig not in pkgconfigflags:
-                    error_msg = "%s: invalid PACKAGECONFIG: %s" % (pn, pkgconfig)
-                    oe.qa.handle_error("invalid-packageconfig", error_msg, d)
+            invalid_pkgconfigs = set(pkgconfigs) - set(pkgconfigflags)
+            if invalid_pkgconfigs:
+                error_msg = "%s: invalid PACKAGECONFIG(s): %s" % (pn, " ".join(sorted(invalid_pkgconfigs)))
+                oe.qa.handle_error("invalid-packageconfig", error_msg, d)
 
     pn = d.getVar('PN')
     test_missing_metadata(pn, d)