X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fqueue.py;h=c5e6ca74c7b8103efa7c342adacdbcdf291c5035;hb=d34b076f5fd723fc99fd03fc44de9ec30e387a63;hp=d89284a3f17b4754fc5fd8c5d725d1f44d24962a;hpb=0e17fb050fa7003f24f3c1836013decf84b986da;p=dak.git diff --git a/daklib/queue.py b/daklib/queue.py index d89284a3..c5e6ca74 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -337,8 +337,9 @@ class Upload(object): if self.pkg.changes.has_key('fingerprint'): session = DBConn().session() fpr = get_fingerprint(self.pkg.changes['fingerprint'], session) - if self.check_if_upload_is_sponsored("%s@debian.org" % fpr.uid.uid, fpr.uid.name): - self.Subst["__MAINTAINER_TO__"] += ", %s" % self.pkg.changes["sponsoremail"] + if fpr and self.check_if_upload_is_sponsored("%s@debian.org" % fpr.uid.uid, fpr.uid.name): + if self.pkg.changes.has_key("sponsoremail"): + self.Subst["__MAINTAINER_TO__"] += ", %s" % self.pkg.changes["sponsoremail"] session.close() if cnf.has_key("Dinstall::TrackingServer") and self.pkg.changes.has_key("source"): @@ -352,6 +353,7 @@ class Upload(object): self.Subst["__REJECT_MESSAGE__"] = self.package_info() self.Subst["__SOURCE__"] = self.pkg.changes.get("source", "Unknown") self.Subst["__VERSION__"] = self.pkg.changes.get("version", "Unknown") + self.Subst["__SUITE__"] = ", ".join(self.pkg.changes["distribution"]) ########################################################################### def load_changes(self, filename): @@ -1937,7 +1939,6 @@ distribution.""" UrgencyLog().log(self.pkg.dsc["source"], self.pkg.dsc["version"], self.pkg.changes["urgency"]) self.update_subst() - self.Subst["__SUITE__"] = "" self.Subst["__SUMMARY__"] = summary mail_message = utils.TemplateSubst(self.Subst, os.path.join(cnf["Dir::Templates"], 'process-unchecked.accepted')) @@ -2618,45 +2619,6 @@ distribution.""" if not self.in_override_p(entry["package"], entry["component"], suite, entry.get("dbtype",""), checkfile, session): self.rejects.append("%s is NEW for %s." % (checkfile, suite)) - ################################################################################ - # This is not really a reject, but an unaccept, but since a) the code for - # that is non-trivial (reopen bugs, unannounce etc.), b) this should be - # extremely rare, for now we'll go with whining at our admin folks... - - def do_unaccept(self): - cnf = Config() - - self.update_subst() - self.Subst["__REJECTOR_ADDRESS__"] = cnf["Dinstall::MyEmailAddress"] - self.Subst["__REJECT_MESSAGE__"] = self.package_info() - self.Subst["__CC__"] = "Cc: " + cnf["Dinstall::MyEmailAddress"] - self.Subst["__BCC__"] = "X-DAK: dak process-accepted" - if cnf.has_key("Dinstall::Bcc"): - self.Subst["__BCC__"] += "\nBcc: %s" % (cnf["Dinstall::Bcc"]) - - template = os.path.join(cnf["Dir::Templates"], "process-accepted.unaccept") - - reject_mail_message = utils.TemplateSubst(self.Subst, template) - - # Write the rejection email out as the .reason file - reason_filename = os.path.basename(self.pkg.changes_file[:-8]) + ".reason" - reject_filename = os.path.join(cnf["Dir::Queue::Reject"], reason_filename) - - # If we fail here someone is probably trying to exploit the race - # so let's just raise an exception ... - if os.path.exists(reject_filename): - os.unlink(reject_filename) - - fd = os.open(reject_filename, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0644) - os.write(fd, reject_mail_message) - os.close(fd) - - utils.send_mail(reject_mail_message) - - del self.Subst["__REJECTOR_ADDRESS__"] - del self.Subst["__REJECT_MESSAGE__"] - del self.Subst["__CC__"] - ################################################################################ # If any file of an upload has a recent mtime then chances are good # the file is still being uploaded.