+def check_override ():
+ global Subst;
+
+ # Only check section & priority on sourceful uploads
+ if not changes["architecture"].has_key("source"):
+ return;
+
+ summary = ""
+ for file in files.keys():
+ if not files[file].has_key("new") and files[file]["type"] == "deb":
+ section = files[file]["section"];
+ override_section = files[file]["override section"];
+ if section != override_section and section != "-":
+ # Ignore this; it's a common mistake and not worth whining about
+ if string.lower(section) == "non-us/main" and string.lower(override_section) == "non-us":
+ continue;
+ summary = summary + "%s: section is overridden from %s to %s.\n" % (file, section, override_section);
+ priority = files[file]["priority"];
+ override_priority = files[file]["override priority"];
+ if priority != override_priority and priority != "-":
+ summary = summary + "%s: priority is overridden from %s to %s.\n" % (file, priority, override_priority);
+
+ if summary == "":
+ return;
+
+ Subst["__SUMMARY__"] = summary;
+ mail_message = utils.TemplateSubst(Subst,open(Cnf["Dir::TemplatesDir"]+"/katie.override-disparity","r").read());
+ utils.send_mail (mail_message, "")
+
+#####################################################################################################################
+
+# Set up the per-package template substitution mappings
+
+def update_subst (changes_filename):
+ global Subst;
+
+ Subst["__ARCHITECTURE__"] = string.join(changes["architecture"].keys(), ' ' );
+ Subst["__CHANGES_FILENAME__"] = os.path.basename(changes_filename);
+ Subst["__FILE_CONTENTS__"] = changes["filecontents"];
+ Subst["__MAINTAINER_ADDRESS__"] = changes["maintainer822"];
+ Subst["__MAINTAINER__"] = changes["maintainer"];
+ Subst["__REJECT_MESSAGE__"] = reject_message;
+ Subst["__SOURCE__"] = changes["source"];
+ Subst["__VERSION__"] = changes["version"];
+