# 'Fix' stable to make debian-cd and dpkg -BORGiE users happy
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: madison,v 1.4 2001-03-20 00:28:11 troup Exp $
+# $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
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');
#######################################################################################