~ubuntu-security/ubuntu-cve-tracker/master

« back to all changes in this revision

Viewing changes to scripts/madison

  • Committer: Steve Beattie
  • Date: 2019-02-19 06:18:27 UTC
  • Revision ID: sbeattie@ubuntu.com-20190219061827-oh57fzcfc1u9dlfk
The ubuntu-cve-tracker project has been converted to git.

Please use 'git clone https://git.launchpad.net/ubuntu-cve-tracker' to
get the converted tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
2
 
# Really simple madison-like reporting tool that uses source_map data for
3
 
# reporting.  Note that it only reports the highest version's entry for
4
 
# a given source pkg's release.
5
 
#
6
 
# Copyright 2008-2010, Canonical Ltd.
7
 
# Author: Kees Cook <kees@ubuntu.com>
8
 
# Author: Jamie Strandboge <jamie@ubuntu.com>
9
 
import sys
10
 
import cve_lib
11
 
import optparse
12
 
 
13
 
parser = optparse.OptionParser()
14
 
parser.add_option("--release", help="Limit to comma-separates list of releases", metavar="NAME", action='store', default=None)
15
 
(opt, args) = parser.parse_args()
16
 
 
17
 
import source_map
18
 
info = source_map.load()
19
 
 
20
 
releases = None
21
 
if opt.release:
22
 
    releases = opt.release.split(',')
23
 
 
24
 
for source in args:
25
 
    answer = source_map.madison(info, source, releases)
26
 
 
27
 
    for name in sorted(answer.keys()):
28
 
        rel, component = name.split('/',1)
29
 
        pocket=''
30
 
        if '-' in rel:
31
 
            rel, pocket = rel.split('-',1)
32
 
        for pkg in sorted(answer[name].keys()):
33
 
            suffix=""
34
 
            if component in ['main','restricted'] and not cve_lib.is_supported(info, pkg, rel):
35
 
                suffix = "[unsupported]"
36
 
            print '%s | %s | %s%s' % (pkg, answer[name][pkg], name, suffix)