X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=madison;h=7774daec7fd450cf8838d6ac287ebb00aaf6f1b9;hb=f642ffe76ae209cebf414bfd3b68b4486d64bbc6;hp=1bc0da15d104ca76dbec768ee5d33ed2dcbb6011;hpb=016c82f5c0b8185a9d2a7824f6b0af2dddde0741;p=dak.git diff --git a/madison b/madison index 1bc0da15..7774daec 100755 --- a/madison +++ b/madison @@ -1,8 +1,8 @@ #!/usr/bin/env python # 'Fix' stable to make debian-cd and dpkg -BORGiE users happy -# Copyright (C) 2000 James Troup -# $Id: madison,v 1.2 2001-01-27 02:51:00 troup Exp $ +# Copyright (C) 2000, 2001 James Troup +# $Id: madison,v 1.5 2001-03-21 06:26:19 troup Exp $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ def main (): packages = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv); - projectB = pg.connect('projectb', Cnf["DB::Host"], int(Cnf["DB::Port"]), None, None, Cnf["DB::ROUser"]); + projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]), None, None, Cnf["DB::ROUser"]); db_access.init(Cnf, projectB); @@ -62,23 +62,26 @@ def main (): version = i[1]; architecture = i[2]; suite = i[3]; - key = (version, suite); - if not d.has_key(key): - d[key] = []; - d[key].append(architecture); + if not d.has_key(version): + d[version] = {}; + if not d[version].has_key(suite): + d[version][suite] = []; + d[version][suite].append(architecture); - keys = d.keys(); - keys.sort(); - for i in keys: - (version, suite) = i; - sys.stdout.write("%10s | %10s | %13s | " % (package, version, suite)); - count = 0; - for arch in d[i]: - if count > 0: - sys.stdout.write(', '); - sys.stdout.write(arch); - count = count + 1; - sys.stdout.write('\n'); + versions = d.keys(); + versions.sort(apt_pkg.VersionCompare); + for version in versions: + suites = d[version].keys(); + suites.sort(); + for suite in suites: + sys.stdout.write("%10s | %10s | %13s | " % (package, version, suite)); + count = 0; + for arch in d[version][suite]: + if count > 0: + sys.stdout.write(', '); + sys.stdout.write(arch); + count = count + 1; + sys.stdout.write('\n'); #######################################################################################