summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-03-16 11:07:41 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-03-16 11:15:33 +0100
commit690e114ba85eec8693957d204079d9b770ffec5c (patch)
tree312f5aa1b4371ea6abf490e8d5ad339f0b8013c4
parent87c53fe1e5dc6f011f6b2397e95ce1d0dd093dea (diff)
oe_audit.py: Print only vulnerabe software
-rwxr-xr-xcontrib/qa/oe_audit.py32
1 files changed, 31 insertions, 1 deletions
diff --git a/contrib/qa/oe_audit.py b/contrib/qa/oe_audit.py
index 71658029da..6a820cd618 100755
--- a/contrib/qa/oe_audit.py
+++ b/contrib/qa/oe_audit.py
@@ -1,5 +1,7 @@
#!/usr/bin/env python
+import bb
+
def read_available(filename):
"""
Parses the output of bitbake -s
@@ -212,6 +214,8 @@ def strip_bsd_version(bsd_version):
FreeBSD is adding ,1 for revisions.. remove that
"""
split = bsd_version.rsplit(',', 1)
+ split = split[0]
+ split = split.rsplit('_', 1)
return split[0]
def compare_versions(oe, freebsd, not_known):
@@ -223,11 +227,37 @@ def compare_versions(oe, freebsd, not_known):
oe_version = strip_oe_version(oe[oe_name])
for ver in freebsd[bsd_name]:
+ affected = True
str = []
for (cmp, vers) in ver.versions:
bsd_ver = strip_bsd_version(vers)
+ cmp_res = bb.utils.vercmp(('0', oe_version, 'r0'), ('0', bsd_ver, 'r0'))
+ if cmp == '<':
+ if cmp_res >= 0:
+ affected = False
+ pass
+ elif cmp == '<=':
+ if cmp_res > 0:
+ affected = False
+ pass
+ elif cmp == '>':
+ if cmp_res <= 0:
+ affected = False
+ pass
+ elif cmp == '>=':
+ if cmp_res < 0:
+ affected = False
+ pass
+ elif cmp == '=':
+ if cmp_res > 0:
+ affected = False
+ else:
+ print cmp
+ assert True
+
str.append("%s %s %s %s" % (oe_name, oe_version, cmp, bsd_ver))
- print " && ".join(str), ver.link
+ if affected:
+ print " && ".join(str), ver.link
for package in freebsd.keys():
# handle the various versions of OE packages