-# Copyright (C) 2001, 2002 James Troup <james@nocrew.org>
-# $Id: katie.py,v 1.26 2002-08-26 18:07:24 ajt Exp $
+# Copyright (C) 2001, 2002, 2003 James Troup <james@nocrew.org>
+# $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
# 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
filename = Cnf["Dir::Override"] + Cnf["Dinstall::GroupOverrideFilename"];
file = utils.open_file(filename);
for line in file.readlines():
filename = Cnf["Dir::Override"] + Cnf["Dinstall::GroupOverrideFilename"];
file = utils.open_file(filename);
for line in file.readlines():
- (dsc_rfc822, dsc_name, dsc_email) = utils.fix_maintainer (lower(dsc.get("maintainer",Cnf["Dinstall::MyEmailAddress"])));
+ (dsc_rfc822, dsc_name, dsc_email) = utils.fix_maintainer (dsc.get("maintainer",Cnf["Dinstall::MyEmailAddress"]).lower());
- if dsc_name == lower(changes["maintainername"]) and \
- (changes["changedby822"] == "" or lower(changes["changedbyname"]) == dsc_name):
+ if dsc_name == changes["maintainername"].lower() and \
+ (changes["changedby822"] == "" or changes["changedbyname"].lower() == dsc_name):
if not changes.has_key("maintainer822"):
changes["maintainer822"] = self.Cnf["Dinstall::MyEmailAddress"];
if not changes.has_key("maintainer822"):
changes["maintainer822"] = self.Cnf["Dinstall::MyEmailAddress"];
Subst["__CHANGES_FILENAME__"] = os.path.basename(self.pkg.changes_file);
Subst["__FILE_CONTENTS__"] = changes.get("filecontents", "");
Subst["__CHANGES_FILENAME__"] = os.path.basename(self.pkg.changes_file);
Subst["__FILE_CONTENTS__"] = changes.get("filecontents", "");
Subst["__MAINTAINER_TO__"] = changes["maintainer822"];
Subst["__MAINTAINER__"] = changes.get("maintainer", "Unknown");
if self.Cnf.has_key("Dinstall::TrackingServer") and changes.has_key("source"):
Subst["__MAINTAINER_TO__"] = changes["maintainer822"];
Subst["__MAINTAINER__"] = changes.get("maintainer", "Unknown");
if self.Cnf.has_key("Dinstall::TrackingServer") and changes.has_key("source"):
else:
files[file]["pool name"] = utils.poolify (changes["source"], files[file]["component"])
destination = self.Cnf["Dir::PoolRoot"] + files[file]["pool name"] + file
else:
files[file]["pool name"] = utils.poolify (changes["source"], files[file]["component"])
destination = self.Cnf["Dir::PoolRoot"] + files[file]["pool name"] + file
else:
Subst["__STABLE_WARNING__"] = "";
mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/jennifer.bug-close");
else:
Subst["__STABLE_WARNING__"] = "";
mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/jennifer.bug-close");
if action and control_message != "":
Subst["__CONTROL_MESSAGE__"] = control_message;
mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/jennifer.bug-nmu-fixed");
if action and control_message != "":
Subst["__CONTROL_MESSAGE__"] = control_message;
mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/jennifer.bug-nmu-fixed");
if action:
Subst["__ANNOUNCE_LIST_ADDRESS__"] = list;
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");
if action:
Subst["__ANNOUNCE_LIST_ADDRESS__"] = list;
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");
if Cnf.FindB("Dinstall::CloseBugs"):
summary = self.close_bugs(summary, action);
if Cnf.FindB("Dinstall::CloseBugs"):
summary = self.close_bugs(summary, action);
file_keys = files.keys();
for file in file_keys:
utils.move(file, Cnf["Dir::Queue::Accepted"]);
file_keys = files.keys();
for file in file_keys:
utils.move(file, Cnf["Dir::Queue::Accepted"]);
Subst["__SUITE__"] = "";
Subst["__SUMMARY__"] = summary;
mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/jennifer.accepted");
Subst["__SUITE__"] = "";
Subst["__SUMMARY__"] = summary;
mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/jennifer.accepted");
self.announce(short_summary, 1)
# Special support to enable clean auto-building of accepted packages
self.announce(short_summary, 1)
# Special support to enable clean auto-building of accepted packages
filename = dsc_file;
dest = os.path.join(dest_dir, filename);
# If it doesn't exist, create a symlink
filename = dsc_file;
dest = os.path.join(dest_dir, filename);
# If it doesn't exist, create a symlink
if not files[file].has_key("new") and files[file]["type"] == "deb":
section = files[file]["section"];
override_section = files[file]["override section"];
if not files[file].has_key("new") and files[file]["type"] == "deb":
section = files[file]["section"];
override_section = files[file]["override section"];
- summary = summary + "%s: section is overridden from %s to %s.\n" % (file, section, override_section);
+ summary += "%s: package says section is %s, override says %s.\n" % (file, section, override_section);
priority = files[file]["priority"];
override_priority = files[file]["override priority"];
if priority != override_priority and priority != "-":
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);
+ summary += "%s: package says priority is %s, override says %s.\n" % (file, priority, override_priority);
if summary == "":
return;
Subst["__SUMMARY__"] = summary;
mail_message = utils.TemplateSubst(Subst,self.Cnf["Dir::Templates"]+"/jennifer.override-disparity");
if summary == "":
return;
Subst["__SUMMARY__"] = summary;
mail_message = utils.TemplateSubst(Subst,self.Cnf["Dir::Templates"]+"/jennifer.override-disparity");
- def force_move (self, files):
- """Forcefully move files from the current directory to the reject
- directory. If any file already exists it will be moved to the
- morgue to make way for the new file."""
+ def force_reject (self, files):
+ """Forcefully move files from the current directory to the
+ reject directory. If any file already exists in the reject
+ directory it will be moved to the morgue to make way for
+ the new file."""
while answer == 'E':
os.system("%s %s" % (editor, temp_filename))
file = utils.open_file(temp_filename);
while answer == 'E':
os.system("%s %s" % (editor, temp_filename))
file = utils.open_file(temp_filename);
prompt = "[R]eject, Edit, Abandon, Quit ?"
answer = "XXX";
prompt = "[R]eject, Edit, Abandon, Quit ?"
answer = "XXX";
# If we fail here someone is probably trying to exploit the race
# so let's just raise an exception ...
# If we fail here someone is probably trying to exploit the race
# so let's just raise an exception ...
component = component[7:];
q = self.projectB.query("SELECT s.section, p.priority FROM override o, section s, priority p WHERE package = '%s' AND suite = %s AND component = %s AND type = %s AND o.section = s.id AND o.priority = p.id"
component = component[7:];
q = self.projectB.query("SELECT s.section, p.priority FROM override o, section s, priority p WHERE package = '%s' AND suite = %s AND component = %s AND type = %s AND o.section = s.id AND o.priority = p.id"
# Unlike other rejects we add new lines first to avoid trailing
# new lines when this message is passed back up to a caller.
if self.reject_message:
# Unlike other rejects we add new lines first to avoid trailing
# new lines when this message is passed back up to a caller.
if self.reject_message:
- must_be_newer_than = map(lower, self.Cnf.ValueList("Suite::%s::VersionChecks::MustBeNewerThan" % (target_suite)));
- must_be_older_than = map(lower, self.Cnf.ValueList("Suite::%s::VersionChecks::MustBeOlderThan" % (target_suite)));
+ must_be_newer_than = map(string.lower, self.Cnf.ValueList("Suite::%s::VersionChecks::MustBeNewerThan" % (target_suite)));
+ must_be_older_than = map(string.lower, self.Cnf.ValueList("Suite::%s::VersionChecks::MustBeOlderThan" % (target_suite)));
# Enforce "must be newer than target suite" even if conffile omits it
if target_suite not in must_be_newer_than:
must_be_newer_than.append(target_suite);
# Enforce "must be newer than target suite" even if conffile omits it
if target_suite not in must_be_newer_than:
must_be_newer_than.append(target_suite);
actual_size = int(files[dsc_file]["size"]);
found = "%s in incoming" % (dsc_file)
# Check the file does not already exist in the archive
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
- 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));