summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorFlorian Weimer <fw@deneb.enyo.de>2011-04-24 17:52:21 +0000
committerFlorian Weimer <fw@deneb.enyo.de>2011-04-24 17:52:21 +0000
commit629f9972c0aa1870f1931c1828d3a8932fb4ef5e (patch)
treeee81b07ceea519ab3f695a1c17814f0d754c7983 /bin
parent0120034e32e9d148a5651c03c4f69cf7cafe780d (diff)
bin/gen_DSA.py: fill in version information for stable and oldstable
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@16588 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin')
-rwxr-xr-xbin/gen-DSA.py35
1 files changed, 30 insertions, 5 deletions
diff --git a/bin/gen-DSA.py b/bin/gen-DSA.py
index aab1a2eb5f..83e458c247 100755
--- a/bin/gen-DSA.py
+++ b/bin/gen-DSA.py
@@ -39,8 +39,9 @@ from pwd import getpwuid
import re
import time
-import debian_support
import bugs
+import debian_support
+import secmaster
def parsecommand():
args = sys.argv[1:]
@@ -169,9 +170,33 @@ def checkfile():
print >>sys.stderr, "DSA file already exists:", repr(dsa_file)
sys.exit(1)
+def search_queue(queue, package, codename, missing=None):
+ """Search QUEUE for PACKAGE in distribution CODENAME.
+ Returns MISSING if not found (or raises exception of None).
+ If found, returns the maximum version number encountered.
+ """
+ cname = debian_support.releasecodename(codename)
+ versions = [debian_support.Version(pkg.source_version)
+ for pkg, dists in queue
+ if pkg.source == package and cname in dists]
+ if versions:
+ versions.sort()
+ return str(versions[-1])
+ if missing is None:
+ raise IOError("could not find version for package {0!r} in {1!r}".
+ format(package, codename))
+ return missing
+
parsecommand()
checklist()
checkfile()
+
+queue = secmaster.listqueue()
+stable_version = search_queue(queue, opt_package, "stable")
+oldstable_version = search_queue(queue, opt_package, "oldstable", "<missing>")
+testing_version = search_queue(queue, opt_package, "testing", "<missing>")
+unstable_version = search_queue(queue, opt_package, "unstable", "<missing>")
+
template = filledtemplate({
"DEBFULLNAME" : gecos(),
"DEBEMAIL" : debemail(),
@@ -186,10 +211,10 @@ template = filledtemplate({
"OLDSTABLE" : debian_support.releasecodename("oldstable"),
"STABLE" : debian_support.releasecodename("stable"),
"TESTING" : debian_support.releasecodename("testing"),
- "OLDSTABLE_VERSION" : "$OLDSTABLE_VERSION",
- "STABLE_VERSION" : "$STABLE_VERSION",
- "TESTING_VERSION" : "$TESTING_VERSION",
- "UNSTABLE_VERSION" : "$UNSTABLE_VERSION",
+ "OLDSTABLE_VERSION" : oldstable_version,
+ "STABLE_VERSION" : stable_version,
+ "TESTING_VERSION" : testing_version,
+ "UNSTABLE_VERSION" : unstable_version,
"SPACEDDEBFULLNAME" : gecos().rjust(24),
})
if opt_save:

© 2014-2024 Faster IT GmbH | imprint | privacy policy