support/scripts/pkg-stats: properly ignore CVEs in <pkg>_IGNORE_CVES
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 18 Feb 2020 23:35:26 +0000 (00:35 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Wed, 19 Feb 2020 07:22:09 +0000 (08:22 +0100)
It seems like throughout the series that the CVE pkg-stats support
went through, the support for ignoring CVEs in the per-package
<pkg>_IGNORE_CVES variable was forgotten.

Let's re-introduce this, which is now very simple thanks to the CVE
class, its .identifier() propertly and the .is_cve_ignored() method of
the Package class

Cc: Titouan Christophe <titouan.christophe@railnova.eu>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
support/scripts/pkg-stats

index 920a2be15839ec0860f23c2f1122b07311108d8c..c113cf9606f958960f0e8cc0408a1ed4aad64968 100755 (executable)
@@ -259,6 +259,9 @@ class CVE:
         True if the Buildroot Package object passed as argument is affected
         by this CVE.
         """
+        if br_pkg.is_cve_ignored(self.identifier):
+            return False
+
         for product in self.each_product():
             if product['product_name'] != br_pkg.name:
                 continue