]> err.no Git - dak/commitdiff
* katie.conf (Alicia): Added an Alicia section with email address * templates...
authorDaniel Silverstone <dsilvers@debian.org>
Mon, 2 Feb 2004 23:50:18 +0000 (23:50 +0000)
committerDaniel Silverstone <dsilvers@debian.org>
Mon, 2 Feb 2004 23:50:18 +0000 (23:50 +0000)
alicia
docs/alicia.1.sgml
katie.conf
templates/alicia.bug-close [new file with mode: 0644]

diff --git a/alicia b/alicia
index 39fab4773caf131ac0cd6acfd6bccbc4d3929df7..28426a710ebe6110e991768575e69354e34338dc 100755 (executable)
--- a/alicia
+++ b/alicia
@@ -2,7 +2,7 @@
 
 # Microscopic modification and query tool for overrides in projectb
 # Copyright (C) 2004  Daniel Silverstone <dsilvers@digital-scurf.org>
-# $Id: alicia,v 1.2 2004-01-29 10:40:18 dsilvers Exp $
+# $Id: alicia,v 1.3 2004-02-02 23:50:18 dsilvers 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
@@ -50,6 +50,7 @@ def usage (exit_code=0):
 Make microchanges or microqueries of the overrides
 
   -h, --help                 show this help and exit
+  -d, --done=BUG#            send priority/section change as closure to bug#
   -n, --no-action            don't do anything
   -s, --suite                specify the suite to use
 """
@@ -61,6 +62,7 @@ def main ():
     Cnf = utils.get_conf()
 
     Arguments = [('h',"help","Alicia::Options::Help"),
+                 ('d',"done","Alicia::Options::Done", "HasArg"),
                  ('n',"no-action","Alicia::Options::No-Action"),
                  ('s',"suite","Alicia::Options::Suite", "HasArg"),
                  ];
@@ -83,7 +85,7 @@ def main ():
         utils.fubar("package name is a required argument.");
 
     package = arguments.pop(0);
-
+    suite = Options["Suite"]
     if arguments and len(arguments) > 2:
         utils.fubar("Too many arguments");
 
@@ -112,7 +114,7 @@ def main ():
        AND override.package = %s
        AND override.suite = suite.id
        AND suite.suite_name = %s
-    """ % (pg._quote(package,"str"), pg._quote(Options["Suite"],"str")));
+    """ % (pg._quote(package,"str"), pg._quote(suite,"str")));
 
     if q.ntuples() == 0:
         utils.fubar("Unable to find package %s" % (package));
@@ -160,6 +162,9 @@ def main ():
             print "I: Would change priority from %s to %s" % (oldpriority,newpriority);
         if newsection != oldsection:
             print "I: Would change section from %s to %s" % (oldsection,newsection);
+        if Options.has_key("Done"):
+            print "I: Would also close bug(s): %s" % (Options["Done"]);
+            
         sys.exit(0);
 
     if newpriority != oldpriority:
@@ -167,6 +172,11 @@ def main ():
     if newsection != oldsection:
         print "I: Will change section from %s to %s" % (oldsection,newsection);
 
+    if not Options.has_key("Done"):
+        utils.warn("No bugs to close have been specified. Noone will know you have done this.");
+    else:
+        print "I: Will close bug(s): %s" % (Options["Done"]);
+
     game_over();
 
     Logger = logging.Logger(Cnf, "alicia");
@@ -181,7 +191,7 @@ def main ():
            AND suite = (SELECT id FROM suite WHERE suite_name=%s)""" % (
             newprioid,
             pg._quote(package,"str"),
-            pg._quote(Options["Suite"],"str") ));
+            pg._quote(suite,"str") ));
         Logger.log(["changed priority",package,oldpriority,newpriority]);
 
     if newsection != oldsection:
@@ -192,10 +202,43 @@ def main ():
            AND suite = (SELECT id FROM suite WHERE suite_name=%s)""" % (
             newsecid,
             pg._quote(package,"str"),
-            pg._quote(Options["Suite"],"str") ));
+            pg._quote(suite,"str") ));
         Logger.log(["changed priority",package,oldsection,newsection]);
     projectB.query("COMMIT WORK");
 
+    if Options.has_key("Done"):
+        Subst = {};
+        Subst["__ALICIA_ADDRESS__"] = Cnf["Alicia::MyEmailAddress"];
+        Subst["__BUG_SERVER__"] = Cnf["Dinstall::BugServer"];
+        bcc = [];
+        if Cnf.Find("Dinstall::Bcc") != "":
+            bcc.append(Cnf["Dinstall::Bcc"]);
+        if Cnf.Find("Alicia::Bcc") != "":
+            bcc.append(Cnf["Alicia::Bcc"]);
+        if bcc:
+            Subst["__BCC__"] = "Bcc: " + ", ".join(bcc);
+        else:
+            Subst["__BCC__"] = "X-Filler: 42";
+        Subst["__CC__"] = "X-Katie: alicia $Revision: 1.3 $";
+        Subst["__ADMIN_ADDRESS__"] = Cnf["Dinstall::MyAdminAddress"];
+        Subst["__DISTRO__"] = Cnf["Dinstall::MyDistribution"];
+        Subst["__WHOAMI__"] = utils.whoami();
+
+        summary = "Concerning package %s...\n" % (package);
+        summary += "Operating on the %s suite\n" % (suite);
+        if newpriority != oldpriority:
+            summary += "Changed priority from %s to %s\n" % (oldpriority,newpriority);
+        if newsection != oldsection:
+            summary += "Changed section from %s to %s\n" % (oldsection,newsection);
+        Subst["__SUMMARY__"] = summary;
+
+        for bug in utils.split_args(Options["Done"]):
+            Subst["__BUG_NUMBER__"] = bug;
+            mail_message = utils.TemplateSubst(
+                Subst,Cnf["Dir::Templates"]+"/alicia.bug-close");
+            utils.send_mail(mail_message);
+            Logger.log(["closed bug",bug]);
+
     Logger.close();
 
     print "Done";
index 921119045f5de42da912bb422429079e1b8dd6ce..7661e540c2b05e79c76e8eed6adf32b2ef320bd1 100644 (file)
          <Para>Show help and then exit.</PARA>
        </LISTITEM>
       </VarListEntry>
+      <VarListEntry><term><option>-d/--done=<replaceable>BUG#</replaceable></option></>
+       <ListItem>
+         <Para>Close the listed bugs as part of adjusting the overrides</PARA>
+       </LISTITEM>
+      </VarListEntry>
       <VarListEntry><term><option>-n/--no-action</option></>
        <ListItem>
          <Para>Show what alicia would do but make no changes</PARA>
index 555d12f7918c1254dfde6c7708fad7b4d6a10543..29076232df06227a6efae2c31913cfb3e0cbe5a4 100644 (file)
@@ -33,6 +33,11 @@ Dinstall
    };
 };
 
+Alicia
+{
+   MyEmailAddress "Debian FTP Masters <ftpmaster@ftp-master.debian.org>";
+};
+
 Julia
 {
   ValidGID "800";
diff --git a/templates/alicia.bug-close b/templates/alicia.bug-close
new file mode 100644 (file)
index 0000000..63c00f0
--- /dev/null
@@ -0,0 +1,21 @@
+From: __ALICIA_ADDRESS__
+To: __BUG_NUMBER__-close@__BUG_SERVER__
+__CC__ 
+__BCC__
+Subject: Bug#__BUG_NUMBER__: fixed
+
+We believe that the bug you reported is now fixed; the following
+changes were made to the overrides...
+
+__SUMMARY__
+
+Thank you for reporting the bug, which will now be closed.  If you
+have further comments please address them to __BUG_NUMBER__@__BUG_SERVER__.
+
+This message was generated automatically; if you believe that there is
+a problem with it please contact the archive administrators by mailing
+__ADMIN_ADDRESS__.
+
+__DISTRO__ distribution maintenance software
+pp.
+__WHOAMI__ (the ftpmaster behind the curtain)