summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/cve-check.bbclass10
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass
index d843e7c4ac..646cc879dd 100644
--- a/meta/classes/cve-check.bbclass
+++ b/meta/classes/cve-check.bbclass
@@ -206,7 +206,7 @@ def check_cves(d, patched_cves):
206 """ 206 """
207 Connect to the NVD database and find unpatched cves. 207 Connect to the NVD database and find unpatched cves.
208 """ 208 """
209 from distutils.version import LooseVersion 209 from oe.cve_check import Version
210 210
211 pn = d.getVar("PN") 211 pn = d.getVar("PN")
212 real_pv = d.getVar("PV") 212 real_pv = d.getVar("PV")
@@ -263,8 +263,8 @@ def check_cves(d, patched_cves):
263 else: 263 else:
264 if operator_start: 264 if operator_start:
265 try: 265 try:
266 vulnerable_start = (operator_start == '>=' and LooseVersion(pv) >= LooseVersion(version_start)) 266 vulnerable_start = (operator_start == '>=' and Version(pv) >= Version(version_start))
267 vulnerable_start |= (operator_start == '>' and LooseVersion(pv) > LooseVersion(version_start)) 267 vulnerable_start |= (operator_start == '>' and Version(pv) > Version(version_start))
268 except: 268 except:
269 bb.warn("%s: Failed to compare %s %s %s for %s" % 269 bb.warn("%s: Failed to compare %s %s %s for %s" %
270 (product, pv, operator_start, version_start, cve)) 270 (product, pv, operator_start, version_start, cve))
@@ -274,8 +274,8 @@ def check_cves(d, patched_cves):
274 274
275 if operator_end: 275 if operator_end:
276 try: 276 try:
277 vulnerable_end = (operator_end == '<=' and LooseVersion(pv) <= LooseVersion(version_end)) 277 vulnerable_end = (operator_end == '<=' and Version(pv) <= Version(version_end) )
278 vulnerable_end |= (operator_end == '<' and LooseVersion(pv) < LooseVersion(version_end)) 278 vulnerable_end |= (operator_end == '<' and Version(pv) < Version(version_end) )
279 except: 279 except:
280 bb.warn("%s: Failed to compare %s %s %s for %s" % 280 bb.warn("%s: Failed to compare %s %s %s for %s" %
281 (product, pv, operator_end, version_end, cve)) 281 (product, pv, operator_end, version_end, cve))