diff options
author | Bjoern Tropf <asym@gentoo.org> | 2010-01-14 14:42:29 +0100 |
---|---|---|
committer | Bjoern Tropf <asym@gentoo.org> | 2010-01-14 14:42:29 +0100 |
commit | c5702bcaa14eed1a557434e2acbfe3499c41719b (patch) | |
tree | db095a4df0e603291d011c2f7a4a6fee48cbd099 | |
parent | kernel-check 0.3.17 (diff) | |
download | kernel-check-c5702bcaa14eed1a557434e2acbfe3499c41719b.tar.gz kernel-check-c5702bcaa14eed1a557434e2acbfe3499c41719b.tar.bz2 kernel-check-c5702bcaa14eed1a557434e2acbfe3499c41719b.zip |
Add two spinner.update() calls
Change output
-rwxr-xr-x | pym/kernelcheck/kernelcheck.py | 13 | ||||
-rw-r--r-- | pym/kernelcheck/lib/kernellib.py | 14 |
2 files changed, 22 insertions, 5 deletions
diff --git a/pym/kernelcheck/kernelcheck.py b/pym/kernelcheck/kernelcheck.py index 3f066cb..6271f5f 100755 --- a/pym/kernelcheck/kernelcheck.py +++ b/pym/kernelcheck/kernelcheck.py @@ -186,13 +186,24 @@ def print_summary(vullist, kernel_updates): if 'A:P' in cve.vector or 'A:C' in cve.vector: cvetype += '%s%s' % (' ', blue('-availability')) + #TODO add pending identifier + if ' PENDING ' in cve.desc and '0000-00-00' == cve.published: + cvetype = '(%s%%)' % colorize('WARN', 'pending') + + if 'GENERIC-MAP-NOMATCH' == cve.cve: + cve.cve = 'CVE-0000-0000' + cvetype = '(%s%%)' % colorize('WARN', 'nomatch') + + if cve.score == '10.0': + cve.score = '10.' + index = str() if repr(item.fixed) in kernel_updates: index = teal('[%s]' % kernel_updates[repr(item.fixed)]) print('[%s %26s] %s %s TYPE="%s" %s') % (darkgreen('bugid'), colorize('GOOD', item.bugid), darkgreen(cve.cve), - blue('[%4s]' % cve.score), cvetype, index) + blue('[%3s]' % cve.score), cvetype, index) def print_bug(bugid): diff --git a/pym/kernelcheck/lib/kernellib.py b/pym/kernelcheck/lib/kernellib.py index e593d02..9ad1a55 100644 --- a/pym/kernelcheck/lib/kernellib.py +++ b/pym/kernelcheck/lib/kernellib.py @@ -398,13 +398,16 @@ def extract_genpatch(ebuild, directory, sources): return genpatch -def parse_cve_files(directory): +def parse_cve_files(directory, spinner=None): 'Returns all bug files as list' files = list() if (os.path.exists(directory)): for item in os.listdir(directory): + if spinner: + spinner.update() + try: cve_file = read_cve_file(directory, item) if cve_file is not None: @@ -430,7 +433,7 @@ def find_cve(cve, directory): def eval_cve_files(directory, kernel, spinner=None): 'Returns a vulnerabilty evaluation' - files = parse_cve_files(directory) + files = parse_cve_files(directory, spinner) if not files: return None @@ -627,7 +630,7 @@ def extract_version(release): return kernel -def all_version(source): +def all_version(source, spinner=None): """ Given a kernel source name (e.g. vanilla), returns a Kernel object for the latest revision in the tree, or None if none exists. """ @@ -638,6 +641,9 @@ def all_version(source): 'sys-kernel/%s-sources' % source) for item in matches: + if spinner: + spinner.update() + best = portage.versions.catpkgsplit(item) if not best: continue @@ -657,7 +663,7 @@ def eval_kernel_updates(kernel, kernel_eval, spinner): index = 0 kernel_dict = dict() - for compare in all_version(kernel.source): + for compare in all_version(kernel.source, spinner): if compare.version > kernel.version or \ (compare.version == kernel.version and \ compare.revision > kernel.revision): |