X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=katie.py;h=fc691a62b9f25e774deaa26d2f4822f6276f2977;hb=599caeee8541b68797a3b20262b40d179091f6b4;hp=fd44215acc83b27da74c99019e0a2c52e21f086c;hpb=6e2bf61fb7abe831e4bd434e58d271a1cb0f2750;p=dak.git diff --git a/katie.py b/katie.py index fd44215a..fc691a62 100644 --- a/katie.py +++ b/katie.py @@ -2,7 +2,7 @@ # Utility functions for katie # Copyright (C) 2001, 2002, 2003 James Troup -# $Id: katie.py,v 1.30 2003-02-21 19:19:07 troup Exp $ +# $Id: katie.py,v 1.32 2003-04-08 18:44:21 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 @@ -308,7 +308,7 @@ distribution."""; else: Subst["__STABLE_WARNING__"] = ""; mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/jennifer.bug-close"); - utils.send_mail (mail_message, ""); + utils.send_mail (mail_message); if action: self.Logger.log(["closing bugs"]+bugs); else: # NMU @@ -320,7 +320,7 @@ distribution."""; if action and control_message != "": Subst["__CONTROL_MESSAGE__"] = control_message; mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/jennifer.bug-nmu-fixed"); - utils.send_mail (mail_message, ""); + utils.send_mail (mail_message); if action: self.Logger.log(["setting bugs to fixed"]+bugs); summary += "\n"; @@ -353,7 +353,7 @@ distribution."""; if Cnf.get("Dinstall::TrackingServer") and changes["architecture"].has_key("source"): Subst["__ANNOUNCE_LIST_ADDRESS__"] = Subst["__ANNOUNCE_LIST_ADDRESS__"] + "\nBcc: %s@%s" % (changes["source"], Cnf["Dinstall::TrackingServer"]); mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/jennifer.announce"); - utils.send_mail (mail_message, ""); + utils.send_mail (mail_message); if Cnf.FindB("Dinstall::CloseBugs"): summary = self.close_bugs(summary, action); @@ -386,7 +386,7 @@ distribution."""; Subst["__SUITE__"] = ""; Subst["__SUMMARY__"] = summary; mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/jennifer.accepted"); - utils.send_mail(mail_message, "") + utils.send_mail(mail_message) self.announce(short_summary, 1) # Special support to enable clean auto-building of accepted packages @@ -471,7 +471,7 @@ distribution."""; Subst["__SUMMARY__"] = summary; mail_message = utils.TemplateSubst(Subst,self.Cnf["Dir::Templates"]+"/jennifer.override-disparity"); - utils.send_mail (mail_message, ""); + utils.send_mail(mail_message); ########################################################################### @@ -587,7 +587,7 @@ distribution."""; # Send the rejection mail if appropriate if not Cnf["Dinstall::Options::No-Mail"]: - utils.send_mail (reject_mail_message, ""); + utils.send_mail(reject_mail_message); self.Logger.log(["rejected", pkg.changes_file]); return 0; @@ -763,9 +763,16 @@ SELECT s.version, su.suite_name FROM source s, src_associations sa, suite su actual_size = int(files[dsc_file]["size"]); found = "%s in incoming" % (dsc_file) # Check the file does not already exist in the archive - q = self.projectB.query("SELECT f.size, f.md5sum FROM files f, location l WHERE (f.filename ~ '/%s$' OR f.filename = '%s') AND l.id = f.location" % (utils.regex_safe(dsc_file), dsc_file)); + q = self.projectB.query("SELECT f.size, f.md5sum FROM files f WHERE f.filename LIKE '%%%s%%'" % (dsc_file)); - # "It has not broken them. It has fixed a + ql = q.getresult(); + # Strip out anything that isn't '%s' or '/%s$' + for i in ql: + if i[0] != dsc_file and i[0][-(len(dsc_file)+1):] != '/'+dsc_file: + self.Logger.log(["check_dsc_against_db",i[0],dsc_file]); + ql.remove(i); + + # "[katie] has not broken them. [katie] has fixed a # brokenness. Your crappy hack exploited a bug in # the old dinstall. # @@ -774,7 +781,6 @@ SELECT s.version, su.suite_name FROM source s, src_associations sa, suite su # the same name and version.)" # -- ajk@ on d-devel@l.d.o - ql = q.getresult(); if ql: # Ignore exact matches for .orig.tar.gz match = 0; @@ -791,8 +797,13 @@ SELECT s.version, su.suite_name FROM source s, src_associations sa, suite su self.reject("can not overwrite existing copy of '%s' already in the archive." % (dsc_file)); elif dsc_file.endswith(".orig.tar.gz"): # Check in the pool - q = self.projectB.query("SELECT l.path, f.filename, l.type, f.id, l.id FROM files f, location l WHERE (f.filename ~ '/%s$' OR f.filename = '%s') AND l.id = f.location" % (utils.regex_safe(dsc_file), dsc_file)); + q = self.projectB.query("SELECT l.path, f.filename, l.type, f.id, l.id FROM files f, location l WHERE f.filename LIKE '%%%s%%' AND l.id = f.location" % (dsc_file)); ql = q.getresult(); + # Strip out anything that isn't '%s' or '/%s$' + for i in ql: + if i[1] != dsc_file and i[1][-(len(dsc_file)+1):] != '/'+dsc_file: + self.Logger.log(["check_dsc_against_db",i[1],dsc_file]); + ql.remove(i); if ql: # Unfortunately, we make get more than one