X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fqueue.py;h=a4914aa3c5b800614db81eb52b7122c097eb3b6f;hb=4d01e28a80b0fa8dae0a0395201469eab2e799e0;hp=8d814e86c077828c2e7187f3de2e04416cb1d47a;hpb=26ec44d74f944fd93a7c136cd754d6931cb04c00;p=dak.git diff --git a/daklib/queue.py b/daklib/queue.py index 8d814e86..a4914aa3 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -329,8 +329,18 @@ class Upload(object): self.Subst["__MAINTAINER_TO__"] = self.pkg.changes["maintainer2047"] self.Subst["__MAINTAINER__"] = self.pkg.changes.get("maintainer", "Unknown") - if "sponsoremail" in self.pkg.changes: - self.Subst["__MAINTAINER_TO__"] += ", %s" % self.pkg.changes["sponsoremail"] + # Process policy doesn't set the fingerprint field and I don't want to make it + # do it for now as I don't want to have to deal with the case where we accepted + # the package into PU-NEW, but the fingerprint has gone away from the keyring in + # the meantime so the package will be remarked as rejectable. Urgh. + # TODO: Fix this properly + 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): + 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"): self.Subst["__MAINTAINER_TO__"] += "\nBcc: %s@%s" % (self.pkg.changes["source"], cnf["Dinstall::TrackingServer"]) @@ -343,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__"] = self.pkg.changes.get("distribution", "Unknown") ########################################################################### def load_changes(self, filename): @@ -1928,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')) @@ -2609,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.