diff options
author | Florian Weimer <fw@deneb.enyo.de> | 2011-04-24 18:23:55 +0000 |
---|---|---|
committer | Florian Weimer <fw@deneb.enyo.de> | 2011-04-24 18:23:55 +0000 |
commit | f310d75d0de14a70185a3d1a3ee84f04348271a6 (patch) | |
tree | 464c8b00d43f9b37eaca3ee81629279c550c781d /bin | |
parent | 56b712a7257fb2c0af6ca53696cd082e14eedf86 (diff) |
bin/gen_DSA.py: add version information to data/DSA/list
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@16590 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/gen-DSA.py | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/bin/gen-DSA.py b/bin/gen-DSA.py index 8adeec3309..9646ac6262 100755 --- a/bin/gen-DSA.py +++ b/bin/gen-DSA.py @@ -154,13 +154,18 @@ def checklist(): print >>sys.stderr, "DSA already exists:", repr(opt_dsaid) sys.exit(1) -def newdsalist(months=" Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split()): +def fordsalist(versions, + months=" Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split()): lines = ["[{0:0} {1} {2}] DSA-{3} {4} - {5}\n".format( tm.tm_mday, months[tm.tm_mon], tm.tm_year, opt_dsaid, opt_package, opt_vulnerability)] if opt_cve: lines.append("\t{" + " ".join(opt_cve) + "}\n") - lines = lines + list(file(dsa_list_path)) + for rel, ver in versions.items(): + rel = debian_support.releasecodename(rel) + if ver: + lines.append("\t[{0}] - {1} {2}\n".format( + rel, opt_package, ver)) return lines def checkfile(): @@ -221,7 +226,7 @@ def searchlist(buglist, package, codename): if versions: versions.sort() return str(versions[-1]) - return "<missing>" + return None parsecommand() checklist() @@ -229,7 +234,7 @@ checkfile() queue = secmaster.listqueue() stable_version = search_queue(queue, opt_package, "stable") -oldstable_version = search_queue(queue, opt_package, "oldstable", "<missing>") +oldstable_version = search_queue(queue, opt_package, "oldstable", False) testing_version = search_queue(queue, opt_package, "testing", False) buglist = searchlist_bugs(opt_cve) @@ -251,17 +256,23 @@ template = filledtemplate({ "OLDSTABLE" : debian_support.releasecodename("oldstable"), "STABLE" : debian_support.releasecodename("stable"), "TESTING" : debian_support.releasecodename("testing"), - "OLDSTABLE_VERSION" : oldstable_version, + "OLDSTABLE_VERSION" : oldstable_version or "<missing>", "STABLE_VERSION" : stable_version, - "TESTING_VERSION" : testing_version, - "UNSTABLE_VERSION" : unstable_version, + "TESTING_VERSION" : testing_version or "<missing>", + "UNSTABLE_VERSION" : unstable_version or "<missing>", "SPACEDDEBFULLNAME" : gecos().rjust(24), }) +updatedlist = fordsalist({ + "stable" : stable_version, + "oldstable" : oldstable_version + }) if opt_save: - updatedlist = newdsalist() out = file(dsa_file, "w+") out.write(template) out.close() - debian_support.replaceFile(updatedlist, dsa_list_path) + debian_support.replaceFile(updatedlist + list(file(dsa_list_path)), + dsa_list_path) else: - print template, + print template + for line in updatedlist: + print "|", line, |