# Installs Debian packaes
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $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
orig_tar_location = "";
legacy_source_untouchable = {};
Subst = {};
+nmu = None;
#########################################################################################
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
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)
###############################################################################
def main():
- global Cnf, projectB, install_bytes, new_ack_old, Subst
+ global Cnf, projectB, install_bytes, new_ack_old, Subst, nmu
apt_pkg.init();
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:
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);