]> git.decadent.org.uk Git - dak.git/blobdiff - katie.py
* vars: external-overrides variable added* cron.daily: Update testing/unstable Task...
[dak.git] / katie.py
index 23e1d6b6644ae83d93601a30714bd4af5dd39e64..55e49e08f00e446c1a28c58f8e90cff65c61a538 100644 (file)
--- a/katie.py
+++ b/katie.py
@@ -2,7 +2,7 @@
 
 # Utility functions for katie
 # Copyright (C) 2001, 2002, 2003  James Troup <james@nocrew.org>
-# $Id: katie.py,v 1.37 2003-08-09 02:49:35 rdonald Exp $
+# $Id: katie.py,v 1.40 2003-09-17 23:36:17 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
@@ -325,8 +325,8 @@ distribution.""";
                            Subst["__STABLE_WARNING__"] = "";
                            mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/jennifer.bug-close");
                            utils.send_mail (mail_message);
-                       if action:
-                           self.Logger.log(["closing bugs"]+bugs);
+                if action:
+                    self.Logger.log(["closing bugs"]+bugs);
 
        else:                     # NMU
             summary += "Setting bugs to severity fixed: ";
@@ -625,8 +625,20 @@ distribution.""";
                que = "SELECT s.version FROM source s WHERE s.source = '%s'" % \
                    (package)
            else:
-               suite_id = db_access.get_suite_id(suite);
-               que = "SELECT s.version FROM source s JOIN src_associations sa ON (s.id = sa.source) WHERE sa.suite = %d AND s.source = '%s'" % (suite_id, package)
+               # source must exist in suite X, or in some other suite that's
+               # mapped to X, recursively... silent-maps are counted too,
+               # unreleased-maps aren't.
+               maps = self.Cnf.ValueList("SuiteMappings")[:]
+               maps.reverse()
+               maps = [ m.split() for m in maps ]
+               maps = [ (x[1], x[2]) for x in maps 
+                               if x[0] == "map" or x[0] == "silent-map" ]
+               s = [suite]
+               for x in maps:
+                       if x[1] in s and x[0] not in s:
+                               s.append(x[0])
+               
+               que = "SELECT s.version FROM source s JOIN src_associations sa ON (s.id = sa.source) JOIN suite su ON (sa.suite = su.id) WHERE s.source = '%s' AND (%s)" % (package, string.join(["su.suite_name = '%s'" % a for a in s], " OR "));
             q = self.projectB.query(que)
 
             # Reduce the query results to a list of version numbers
@@ -752,7 +764,7 @@ SELECT b.id FROM binaries b, architecture a
                                    files[file]["version"],
                                    files[file]["architecture"]))
         if q.getresult():
-            self.reject("can not overwrite existing copy of '%s' already in the archive." % (file));
+            self.reject("%s: can not overwrite existing copy already in the archive." % (file));
 
         return self.reject_message;