From 0523d95c484a1ec15c2203e22680945fcaa2a35b Mon Sep 17 00:00:00 2001 From: James Troup Date: Fri, 8 Jun 2001 00:22:10 +0000 Subject: [PATCH] Sort architectures in madison. --- madison | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/madison b/madison index 991a5e64..02696011 100755 --- a/madison +++ b/madison @@ -2,7 +2,7 @@ # 'Fix' stable to make debian-cd and dpkg -BORGiE users happy # Copyright (C) 2000, 2001 James Troup -# $Id: madison,v 1.6 2001-04-03 10:03:30 troup Exp $ +# $Id: madison,v 1.7 2001-06-08 00:22:10 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 @@ -36,6 +36,18 @@ projectB = None; ################################################################################ +def arch_compare (a, b): + if a == "source" and b == "source": + return 0; + elif a == "source": + return -1; + elif b == "source": + return 1; + + return cmp (a, b); + +################################################################################ + def main (): global Cnf, projectB; @@ -95,7 +107,9 @@ def main (): for suite in suites: sys.stdout.write("%10s | %10s | %13s | " % (package, version, suite)); count = 0; - for arch in d[version][suite]: + arches = d[version][suite]; + arches.sort(arch_compare); + for arch in arches: if count > 0: sys.stdout.write(', '); sys.stdout.write(arch); -- 2.39.5