From 4486f7be0c09b03930c32055cf3e31e3826f7f85 Mon Sep 17 00:00:00 2001 From: James Troup Date: Thu, 21 Jun 2001 18:19:09 +0000 Subject: [PATCH] multiple maintainer and QA support. --- TODO | 2 -- katie | 53 ++++++++++++++++++++++++++++++++++++++++------- katie.conf | 1 + katie.conf-non-US | 1 + 4 files changed, 47 insertions(+), 10 deletions(-) diff --git a/TODO b/TODO index 388c6b63..0a051353 100644 --- a/TODO +++ b/TODO @@ -138,9 +138,7 @@ Less Urgent o aj's binary-all stuff (foo-doc depending on foo) (?) o heidi should report suite name not ID [aj] - o fubar and warn/error wrappers like in C (?) o generic way of saying isabinary and isadsc. (?) - o substitution stuff (cf. userdir-ldap) for announce, reject etc. o s/distribution/suite/g diff --git a/katie b/katie index 85d49d78..64963222 100755 --- a/katie +++ b/katie @@ -2,7 +2,7 @@ # Installs Debian packaes # Copyright (C) 2000, 2001 James Troup -# $Id: katie,v 1.45 2001-06-20 18:47:12 troup Exp $ +# $Id: katie,v 1.46 2001-06-21 18:19:09 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 @@ -64,6 +64,7 @@ orig_tar_id = None; orig_tar_location = ""; legacy_source_untouchable = {}; Subst = {}; +nmu = None; ######################################################################################### @@ -91,7 +92,43 @@ def check_signature (filename): return 0 return 1 -##################################################################################################################### +###################################################################################################### + +class nmu_p: + # Read in the group maintainer override file + def __init__ (self): + self.group_maint = {}; + if Cnf.get("Dinstall::GroupOverrideFilename"): + filename = Cnf["Dir::OverrideDir"] + Cnf["Dinstall::GroupOverrideFilename"]; + file = utils.open_file(filename, 'r'); + for line in file.readlines(): + line = string.strip(utils.re_comments.sub('', line)); + if line != "": + self.group_maint[line] = 1; + file.close(); + + def is_an_nmu (self, changes, dsc): + (dsc_rfc822, dsc_name, dsc_email) = utils.fix_maintainer (dsc.get("maintainer",Cnf["Dinstall::MyEmailAddress"])); + # changes["changedbyname"] == dsc_name is probably never true, but better safe than sorry + if dsc_name == changes["maintainername"] and (changes["changedbyname"] == "" or changes["changedbyname"] == dsc_name): + return 0; + + if dsc.has_key("maintainers"): + maintainers = string.split(dsc["maintainers"], ","); + maintainernames = {}; + for i in maintainers: + (rfc822, name, email) = utils.fix_maintainer (string.strip(i)); + maintainernames[name] = ""; + if maintainernames.has_key(changes["changedbyname"]): + return 0; + + # Some group maintained packages (e.g. Debian QA) are never NMU's + if self.group_maint.has_key(changes["maintainername"]): + return 0; + + return 1; + +###################################################################################################### # See if a given package is in the override table @@ -1124,12 +1161,9 @@ def announce (short_summary, action): mail_message = utils.TemplateSubst(Subst,open(Cnf["Dir::TemplatesDir"]+"/katie.announce","r").read()); utils.send_mail (mail_message, "") - (dsc_rfc822, dsc_name, dsc_email) = utils.fix_maintainer (dsc.get("maintainer",Cnf["Dinstall::MyEmailAddress"])); bugs = changes["closes"].keys() bugs.sort() - # changes["changedbyname"] == dsc_name is probably never true, but better - # safe than sorry - if dsc_name == changes["maintainername"] and (changes["changedbyname"] == "" or changes["changedbyname"] == dsc_name): + if not nmu.is_an_nmu(changes, dsc): summary = summary + "Closing bugs: " for bug in bugs: summary = summary + "%s " % (bug) @@ -1215,7 +1249,7 @@ def process_it (changes_file): ############################################################################### def main(): - global Cnf, projectB, install_bytes, new_ack_old, Subst + global Cnf, projectB, install_bytes, new_ack_old, Subst, nmu apt_pkg.init(); @@ -1277,7 +1311,7 @@ def main(): Subst = {} Subst["__ADMIN_ADDRESS__"] = Cnf["Dinstall::MyAdminAddress"]; Subst["__BUG_SERVER__"] = Cnf["Dinstall::BugServer"]; - bcc = "X-Katie: $Revision: 1.45 $" + bcc = "X-Katie: $Revision: 1.46 $" if Cnf.has_key("Dinstall::Bcc"): Subst["__BCC__"] = bcc + "\nBcc: %s" % (Cnf["Dinstall::Bcc"]); else: @@ -1285,6 +1319,9 @@ def main(): Subst["__DISTRO__"] = Cnf["Dinstall::MyDistribution"]; Subst["__KATIE_ADDRESS__"] = Cnf["Dinstall::MyEmailAddress"]; + # Read in the group-maint override file + nmu = nmu_p(); + # Sort the .changes files so that we process sourceful ones first changes_files.sort(utils.changes_compare); diff --git a/katie.conf b/katie.conf index ab9bcd0c..8a5ac8de 100644 --- a/katie.conf +++ b/katie.conf @@ -27,6 +27,7 @@ Dinstall NewAckList "/org/ftp.debian.org/katie/log"; LockFile "/org/ftp.debian.org/katie/lock"; Bcc "troup@auric.debian.org"; + GroupOverrideFilename "override.group-maint"; }; diff --git a/katie.conf-non-US b/katie.conf-non-US index e61c51a4..74019deb 100644 --- a/katie.conf-non-US +++ b/katie.conf-non-US @@ -27,6 +27,7 @@ Dinstall NewAckList "/org/non-us.debian.org/katie/log"; LockFile "/org/non-us.debian.org/katie/lock"; Bcc "troup@auric.debian.org"; + GroupOverrideFilename "override.group-maint"; }; -- 2.39.5