]> git.decadent.org.uk Git - dak.git/blobdiff - saffron
Add new top level directories
[dak.git] / saffron
diff --git a/saffron b/saffron
index a9e759b11699aacb51ce2cb7b7d72fa4a247a373..a11b902eaa59e287a3d39405d80fe7b7d5932aa1 100755 (executable)
--- 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 <james@nocrew.org>
-# $Id: saffron,v 1.1 2003-01-02 18:06:19 troup Exp $
+# Copyright (C) 2000, 2001, 2002, 2003  James Troup <james@nocrew.org>
+# $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
 
 ################################################################################
 
+# <aj>    can we change the standards instead?
+# <neuro> standards?
+# <aj>    whatever we're not conforming to
+# <aj>    if there's no written standard, why don't we declare linux as
+#         the defacto standard
+# <aj>    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