X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=saffron;h=a11b902eaa59e287a3d39405d80fe7b7d5932aa1;hb=9540d873fa78598454af57f5f8a4875969ed0439;hp=a9e759b11699aacb51ce2cb7b7d72fa4a247a373;hpb=f6386a74a3399e05382412c0eb23d9b301f6e6d4;p=dak.git diff --git a/saffron b/saffron index a9e759b1..a11b902e 100755 --- a/saffron +++ b/saffron @@ -1,8 +1,8 @@ #!/usr/bin/env python # Various statistical pr0nography fun and games -# Copyright (C) 2000, 2001, 2002 James Troup -# $Id: saffron,v 1.1 2003-01-02 18:06:19 troup Exp $ +# Copyright (C) 2000, 2001, 2002, 2003 James Troup +# $Id: saffron,v 1.3 2005-11-15 09:50:32 ajt 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 @@ -20,6 +20,17 @@ ################################################################################ +# can we change the standards instead? +# standards? +# whatever we're not conforming to +# if there's no written standard, why don't we declare linux as +# the defacto standard +# go us! + +# [aj's attempt to avoid ABI changes for released architecture(s)] + +################################################################################ + import pg, sys; import utils; import apt_pkg; @@ -54,6 +65,8 @@ SELECT a.arch_string as Architecture, sum(f.size) WHERE a.id=b.architecture AND f.id=b.file GROUP BY a.arch_string"""); print q; + q = projectB.query("SELECT sum(size) FROM files WHERE filename ~ '.(diff.gz|tar.gz|dsc)$'"); + print q; ################################################################################ @@ -96,15 +109,21 @@ def longest(list): return longest; def suite_sort(a, b): - a_priority = int(Cnf["Suite::%s::Priority" % (a)]); - b_priority = int(Cnf["Suite::%s::Priority" % (b)]); + if Cnf.has_key("Suite::%s::Priority" % (a)): + a_priority = int(Cnf["Suite::%s::Priority" % (a)]); + else: + a_priority = 0; + if Cnf.has_key("Suite::%s::Priority" % (b)): + b_priority = int(Cnf["Suite::%s::Priority" % (b)]); + else: + b_priority = 0; return cmp(a_priority, b_priority); def output_format(suite): output_suite = []; for word in suite.split("-"): output_suite.append(word[0]); - return output_suite.join("-"); + return "-".join(output_suite); # Obvious query with GROUP BY and mapped names -> 50 seconds # GROUP BY but ids instead of suite/architecture names -> 28 seconds