-import errno, fcntl, os, sys, time, re;
-import apt_pkg;
-import db_access, katie, logging, utils;
+import errno, fcntl, os, sys, time, re
+import apt_pkg
+import db_access, katie, logging, utils
"Urgency Logger object"
def __init__ (self, Cnf):
"Initialize a new Urgency Logger object"
"Urgency Logger object"
def __init__ (self, Cnf):
"Initialize a new Urgency Logger object"
- umask = os.umask(00000);
- os.makedirs(self.log_dir, 02775);
+ umask = os.umask(00000)
+ os.makedirs(self.log_dir, 02775)
- self.log_filename = "%s/.install-urgencies-%s.new" % (self.log_dir, self.timestamp);
- self.log_file = utils.open_file(self.log_filename, 'w');
- self.writes = 0;
+ self.log_filename = "%s/.install-urgencies-%s.new" % (self.log_dir, self.timestamp)
+ self.log_file = utils.open_file(self.log_filename, 'w')
+ self.writes = 0
def log (self, source, version, urgency):
"Log an event"
def log (self, source, version, urgency):
"Log an event"
- new_filename = "%s/install-urgencies-%s" % (self.log_dir, self.timestamp);
- utils.move(self.log_filename, new_filename);
+ new_filename = "%s/install-urgencies-%s" % (self.log_dir, self.timestamp)
+ utils.move(self.log_filename, new_filename)
###############################################################################
def reject (str, prefix="Rejected: "):
###############################################################################
def reject (str, prefix="Rejected: "):
# Recheck anything that relies on the database; since that's not
# frozen between accept and our run time.
# Recheck anything that relies on the database; since that's not
# frozen between accept and our run time.
# The .orig.tar.gz can disappear out from under us is it's a
# duplicate of one in the archive.
if not files.has_key(file):
# The .orig.tar.gz can disappear out from under us is it's a
# duplicate of one in the archive.
if not files.has_key(file):
if not changes["architecture"].has_key("source") \
and not Katie.source_exists(source_package, source_version, changes["distribution"].keys()):
if not changes["architecture"].has_key("source") \
and not Katie.source_exists(source_package, source_version, changes["distribution"].keys()):
# Version and file overwrite checks
if not installing_to_stable:
if files[file]["type"] == "deb":
# Version and file overwrite checks
if not installing_to_stable:
if files[file]["type"] == "deb":
- reject(Katie.check_source_against_db(file), "");
- (reject_msg, is_in_incoming) = Katie.check_dsc_against_db(file);
- reject(reject_msg, "");
+ reject(Katie.check_source_against_db(file), "")
+ (reject_msg, is_in_incoming) = Katie.check_dsc_against_db(file)
+ reject(reject_msg, "")
# Check the package is still in the override tables
for suite in changes["distribution"].keys():
if not Katie.in_override_p(files[file]["package"], files[file]["component"], suite, files[file].get("dbtype",""), file):
# Check the package is still in the override tables
for suite in changes["distribution"].keys():
if not Katie.in_override_p(files[file]["package"], files[file]["component"], suite, files[file].get("dbtype",""), file):
- global Cnf, Options, Katie, projectB, changes, dsc, dsc_files, files, pkg, Subst;
+ global Cnf, Options, Katie, projectB, changes, dsc, dsc_files, files, pkg, Subst
('n',"no-action","Dinstall::Options::No-Action"),
('p',"no-lock", "Dinstall::Options::No-Lock"),
('s',"no-mail", "Dinstall::Options::No-Mail"),
('n',"no-action","Dinstall::Options::No-Action"),
('p',"no-lock", "Dinstall::Options::No-Lock"),
('s',"no-mail", "Dinstall::Options::No-Mail"),
for i in ["automatic", "help", "no-action", "no-lock", "no-mail", "version"]:
if not Cnf.has_key("Dinstall::Options::%s" % (i)):
for i in ["automatic", "help", "no-action", "no-lock", "no-mail", "version"]:
if not Cnf.has_key("Dinstall::Options::%s" % (i)):
- changes = Katie.pkg.changes;
- dsc = Katie.pkg.dsc;
- dsc_files = Katie.pkg.dsc_files;
- files = Katie.pkg.files;
- pkg = Katie.pkg;
- Subst = Katie.Subst;
+ changes = Katie.pkg.changes
+ dsc = Katie.pkg.dsc
+ dsc_files = Katie.pkg.dsc_files
+ files = Katie.pkg.files
+ pkg = Katie.pkg
+ Subst = Katie.Subst
(prompt, answer) = ("", "XXX")
if Options["No-Action"] or Options["Automatic"]:
answer = 'S'
if reject_message.find("Rejected") != -1:
(prompt, answer) = ("", "XXX")
if Options["No-Action"] or Options["Automatic"]:
answer = 'S'
if reject_message.find("Rejected") != -1:
- print "REJECT\n" + reject_message,;
- prompt = "[R]eject, Skip, Quit ?";
+ print "REJECT\n" + reject_message,
+ prompt = "[R]eject, Skip, Quit ?"
- print reject_message + summary,;
- prompt = "[I]nstall, Skip, Quit ?";
+ print reject_message + summary,
+ prompt = "[I]nstall, Skip, Quit ?"
- Subst["__REJECTOR_ADDRESS__"] = Cnf["Dinstall::MyEmailAddress"];
- Subst["__REJECT_MESSAGE__"] = reject_message;
- Subst["__CC__"] = "Cc: " + Cnf["Dinstall::MyEmailAddress"];
- reject_mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/kelly.unaccept");
+ Subst["__REJECTOR_ADDRESS__"] = Cnf["Dinstall::MyEmailAddress"]
+ Subst["__REJECT_MESSAGE__"] = reject_message
+ Subst["__CC__"] = "Cc: " + Cnf["Dinstall::MyEmailAddress"]
+ reject_mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/kelly.unaccept")
- reason_filename = os.path.basename(pkg.changes_file[:-8]) + ".reason";
- reject_filename = Cnf["Dir::Queue::Reject"] + '/' + reason_filename;
+ reason_filename = os.path.basename(pkg.changes_file[:-8]) + ".reason"
+ reject_filename = 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):
# 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);
+ 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);
- Logger.log(["unaccepted", pkg.changes_file]);
+ utils.send_mail(reject_mail_message)
+ Logger.log(["unaccepted", pkg.changes_file])
version = dsc["version"] # NB: not files[file]["version"], that has no epoch
maintainer = dsc["maintainer"]
maintainer = maintainer.replace("'", "\\'")
version = dsc["version"] # NB: not files[file]["version"], that has no epoch
maintainer = dsc["maintainer"]
maintainer = maintainer.replace("'", "\\'")
- maintainer_id = db_access.get_or_set_maintainer_id(maintainer);
- fingerprint_id = db_access.get_or_set_fingerprint_id(dsc["fingerprint"]);
- install_date = time.strftime("%Y-%m-%d");
- filename = files[file]["pool name"] + file;
- dsc_component = files[file]["component"];
- dsc_location_id = files[file]["location id"];
+ maintainer_id = db_access.get_or_set_maintainer_id(maintainer)
+ fingerprint_id = db_access.get_or_set_fingerprint_id(dsc["fingerprint"])
+ install_date = time.strftime("%Y-%m-%d")
+ filename = files[file]["pool name"] + file
+ dsc_component = files[file]["component"]
+ dsc_location_id = files[file]["location id"]
if not files[file].has_key("files id") or not files[file]["files id"]:
files[file]["files id"] = db_access.set_files_id (filename, files[file]["size"], files[file]["md5sum"], dsc_location_id)
projectB.query("INSERT INTO source (source, version, maintainer, file, install_date, sig_fpr) VALUES ('%s', '%s', %d, %d, '%s', %s)"
if not files[file].has_key("files id") or not files[file]["files id"]:
files[file]["files id"] = db_access.set_files_id (filename, files[file]["size"], files[file]["md5sum"], dsc_location_id)
projectB.query("INSERT INTO source (source, version, maintainer, file, install_date, sig_fpr) VALUES ('%s', '%s', %d, %d, '%s', %s)"
- % (package, version, maintainer_id, files[file]["files id"], install_date, fingerprint_id));
+ % (package, version, maintainer_id, files[file]["files id"], install_date, fingerprint_id))
projectB.query("INSERT INTO src_associations (suite, source) VALUES (%d, currval('source_id_seq'))" % (suite_id))
# Add the source files to the DB (files and dsc_files)
projectB.query("INSERT INTO src_associations (suite, source) VALUES (%d, currval('source_id_seq'))" % (suite_id))
# Add the source files to the DB (files and dsc_files)
- projectB.query("INSERT INTO dsc_files (source, file) VALUES (currval('source_id_seq'), %d)" % (files[file]["files id"]));
+ projectB.query("INSERT INTO dsc_files (source, file) VALUES (currval('source_id_seq'), %d)" % (files[file]["files id"]))
# If the .orig.tar.gz is already in the pool, it's
# files id is stored in dsc_files by check_dsc().
# If the .orig.tar.gz is already in the pool, it's
# files id is stored in dsc_files by check_dsc().
- files_id = db_access.get_files_id(filename, dsc_files[dsc_file]["size"], dsc_files[dsc_file]["md5sum"], dsc_location_id);
+ files_id = db_access.get_files_id(filename, dsc_files[dsc_file]["size"], dsc_files[dsc_file]["md5sum"], dsc_location_id)
- files_id = db_access.set_files_id (filename, dsc_files[dsc_file]["size"], dsc_files[dsc_file]["md5sum"], dsc_location_id);
- projectB.query("INSERT INTO dsc_files (source, file) VALUES (currval('source_id_seq'), %d)" % (files_id));
+ files_id = db_access.set_files_id (filename, dsc_files[dsc_file]["size"], dsc_files[dsc_file]["md5sum"], dsc_location_id)
+ projectB.query("INSERT INTO dsc_files (source, file) VALUES (currval('source_id_seq'), %d)" % (files_id))
version = files[file]["version"]
maintainer = files[file]["maintainer"]
maintainer = maintainer.replace("'", "\\'")
version = files[file]["version"]
maintainer = files[file]["maintainer"]
maintainer = maintainer.replace("'", "\\'")
- maintainer_id = db_access.get_or_set_maintainer_id(maintainer);
- fingerprint_id = db_access.get_or_set_fingerprint_id(changes["fingerprint"]);
+ maintainer_id = db_access.get_or_set_maintainer_id(maintainer)
+ fingerprint_id = db_access.get_or_set_fingerprint_id(changes["fingerprint"])
- files[file]["location id"] = db_access.get_location_id(Cnf["Dir::Pool"],files[file]["component"],utils.where_am_i());
+ files[file]["location id"] = db_access.get_location_id(Cnf["Dir::Pool"],files[file]["component"],utils.where_am_i())
if not files[file].has_key("files id") or not files[file]["files id"]:
files[file]["files id"] = db_access.set_files_id (filename, files[file]["size"], files[file]["md5sum"], files[file]["location id"])
if not files[file].has_key("files id") or not files[file]["files id"]:
files[file]["files id"] = db_access.set_files_id (filename, files[file]["size"], files[file]["md5sum"], files[file]["location id"])
if source_id:
projectB.query("INSERT INTO binaries (package, version, maintainer, source, architecture, file, type, sig_fpr) VALUES ('%s', '%s', %d, %d, %d, %d, '%s', %d)"
if source_id:
projectB.query("INSERT INTO binaries (package, version, maintainer, source, architecture, file, type, sig_fpr) VALUES ('%s', '%s', %d, %d, %d, %d, '%s', %d)"
- % (package, version, maintainer_id, source_id, architecture_id, files[file]["files id"], type, fingerprint_id));
+ % (package, version, maintainer_id, source_id, architecture_id, files[file]["files id"], type, fingerprint_id))
else:
projectB.query("INSERT INTO binaries (package, version, maintainer, architecture, file, type, sig_fpr) VALUES ('%s', '%s', %d, %d, %d, '%s', %d)"
else:
projectB.query("INSERT INTO binaries (package, version, maintainer, architecture, file, type, sig_fpr) VALUES ('%s', '%s', %d, %d, %d, '%s', %d)"
- % (package, version, maintainer_id, architecture_id, files[file]["files id"], type, fingerprint_id));
+ % (package, version, maintainer_id, architecture_id, files[file]["files id"], type, fingerprint_id))
- suite_id = db_access.get_suite_id(suite);
- projectB.query("INSERT INTO bin_associations (suite, bin) VALUES (%d, currval('binaries_id_seq'))" % (suite_id));
+ suite_id = db_access.get_suite_id(suite)
+ projectB.query("INSERT INTO bin_associations (suite, bin) VALUES (%d, currval('binaries_id_seq'))" % (suite_id))
# If the .orig.tar.gz is in a legacy directory we need to poolify
# it, so that apt-get source (and anything else that goes by the
# "Directory:" field in the Sources.gz file) works.
# If the .orig.tar.gz is in a legacy directory we need to poolify
# it, so that apt-get source (and anything else that goes by the
# "Directory:" field in the Sources.gz file) works.
- orig_tar_id = Katie.pkg.orig_tar_id;
- orig_tar_location = Katie.pkg.orig_tar_location;
- legacy_source_untouchable = Katie.pkg.legacy_source_untouchable;
+ orig_tar_id = Katie.pkg.orig_tar_id
+ orig_tar_location = Katie.pkg.orig_tar_location
+ legacy_source_untouchable = Katie.pkg.legacy_source_untouchable
- q = projectB.query("SELECT DISTINCT ON (f.id) l.path, f.filename, f.id as files_id, df.source, df.id as dsc_files_id, f.size, f.md5sum FROM files f, dsc_files df, location l WHERE df.source IN (SELECT source FROM dsc_files WHERE file = %s) AND f.id = df.file AND l.id = f.location AND (l.type = 'legacy' OR l.type = 'legacy-mixed')" % (orig_tar_id));
- qd = q.dictresult();
+ q = projectB.query("SELECT DISTINCT ON (f.id) l.path, f.filename, f.id as files_id, df.source, df.id as dsc_files_id, f.size, f.md5sum FROM files f, dsc_files df, location l WHERE df.source IN (SELECT source FROM dsc_files WHERE file = %s) AND f.id = df.file AND l.id = f.location AND (l.type = 'legacy' OR l.type = 'legacy-mixed')" % (orig_tar_id))
+ qd = q.dictresult()
for qid in qd:
# Is this an old upload superseded by a newer -sa upload? (See check_dsc() for details)
if legacy_source_untouchable.has_key(qid["files_id"]):
for qid in qd:
# Is this an old upload superseded by a newer -sa upload? (See check_dsc() for details)
if legacy_source_untouchable.has_key(qid["files_id"]):
- legacy_filename = qid["path"] + qid["filename"];
- pool_location = utils.poolify (changes["source"], files[file]["component"]);
- pool_filename = pool_location + os.path.basename(qid["filename"]);
+ legacy_filename = qid["path"] + qid["filename"]
+ pool_location = utils.poolify (changes["source"], files[file]["component"])
+ pool_filename = pool_location + os.path.basename(qid["filename"])
- q = projectB.query("UPDATE files SET filename = '%s', location = '%s' WHERE id = '%s'" % (pool_filename, dsc_location_id, qid["files_id"]));
+ q = projectB.query("UPDATE files SET filename = '%s', location = '%s' WHERE id = '%s'" % (pool_filename, dsc_location_id, qid["files_id"]))
# If this is a sourceful diff only upload that is moving non-legacy
# cross-component we need to copy the .orig.tar.gz into the new
# If this is a sourceful diff only upload that is moving non-legacy
# cross-component we need to copy the .orig.tar.gz into the new
#
if changes["architecture"].has_key("source") and orig_tar_id and \
orig_tar_location != "legacy" and orig_tar_location != dsc_location_id:
#
if changes["architecture"].has_key("source") and orig_tar_id and \
orig_tar_location != "legacy" and orig_tar_location != dsc_location_id:
- q = projectB.query("SELECT l.path, f.filename, f.size, f.md5sum FROM files f, location l WHERE f.id = %s AND f.location = l.id" % (orig_tar_id));
- ql = q.getresult()[0];
- old_filename = ql[0] + ql[1];
- file_size = ql[2];
- file_md5sum = ql[3];
- new_filename = utils.poolify(changes["source"], dsc_component) + os.path.basename(old_filename);
- new_files_id = db_access.get_files_id(new_filename, file_size, file_md5sum, dsc_location_id);
+ q = projectB.query("SELECT l.path, f.filename, f.size, f.md5sum FROM files f, location l WHERE f.id = %s AND f.location = l.id" % (orig_tar_id))
+ ql = q.getresult()[0]
+ old_filename = ql[0] + ql[1]
+ file_size = ql[2]
+ file_md5sum = ql[3]
+ new_filename = utils.poolify(changes["source"], dsc_component) + os.path.basename(old_filename)
+ new_files_id = db_access.get_files_id(new_filename, file_size, file_md5sum, dsc_location_id)
- utils.copy(old_filename, Cnf["Dir::Pool"] + new_filename);
- new_files_id = db_access.set_files_id(new_filename, file_size, file_md5sum, dsc_location_id);
- projectB.query("UPDATE dsc_files SET file = %s WHERE source = %s AND file = %s" % (new_files_id, source_id, orig_tar_id));
+ utils.copy(old_filename, Cnf["Dir::Pool"] + new_filename)
+ new_files_id = db_access.set_files_id(new_filename, file_size, file_md5sum, dsc_location_id)
+ projectB.query("UPDATE dsc_files SET file = %s WHERE source = %s AND file = %s" % (new_files_id, source_id, orig_tar_id))
- destination = Cnf["Dir::Pool"] + files[file]["pool name"] + file;
- utils.move(file, destination);
- Logger.log(["installed", file, files[file]["type"], files[file]["size"], files[file]["architecture"]]);
- install_bytes += float(files[file]["size"]);
+ destination = Cnf["Dir::Pool"] + files[file]["pool name"] + file
+ utils.move(file, destination)
+ Logger.log(["installed", file, files[file]["type"], files[file]["size"], files[file]["architecture"]])
+ install_bytes += float(files[file]["size"])
# Move the .changes into the 'done' directory
utils.move (pkg.changes_file,
# Move the .changes into the 'done' directory
utils.move (pkg.changes_file,
for suite in changes["distribution"].keys():
if suite not in Cnf.ValueList("Dinstall::QueueBuildSuites"):
for suite in changes["distribution"].keys():
if suite not in Cnf.ValueList("Dinstall::QueueBuildSuites"):
- continue;
- now_date = time.strftime("%Y-%m-%d %H:%M");
- suite_id = db_access.get_suite_id(suite);
- dest_dir = Cnf["Dir::QueueBuild"];
+ continue
+ now_date = time.strftime("%Y-%m-%d %H:%M")
+ suite_id = db_access.get_suite_id(suite)
+ dest_dir = Cnf["Dir::QueueBuild"]
- projectB.query("UPDATE queue_build SET in_queue = 'f', last_used = '%s' WHERE filename = '%s' AND suite = %s" % (now_date, dest, suite_id));
+ projectB.query("UPDATE queue_build SET in_queue = 'f', last_used = '%s' WHERE filename = '%s' AND suite = %s" % (now_date, dest, suite_id))
if not Cnf.FindB("Dinstall::SecurityQueueBuild"):
# Update the symlink to point to the new location in the pool
if not Cnf.FindB("Dinstall::SecurityQueueBuild"):
# Update the symlink to point to the new location in the pool
- pool_location = utils.poolify (changes["source"], files[file]["component"]);
- src = os.path.join(Cnf["Dir::Pool"], pool_location, os.path.basename(file));
+ pool_location = utils.poolify (changes["source"], files[file]["component"])
+ src = os.path.join(Cnf["Dir::Pool"], pool_location, os.path.basename(file))
# Update last_used on any non-upload .orig.tar.gz symlink
if orig_tar_id:
# Determine the .orig.tar.gz file name
for dsc_file in dsc_files.keys():
if dsc_file.endswith(".orig.tar.gz"):
# Update last_used on any non-upload .orig.tar.gz symlink
if orig_tar_id:
# Determine the .orig.tar.gz file name
for dsc_file in dsc_files.keys():
if dsc_file.endswith(".orig.tar.gz"):
- projectB.query("UPDATE queue_build SET in_queue = 'f', last_used = '%s' WHERE filename = '%s' AND suite = %s" % (now_date, orig_tar_gz, suite_id));
- projectB.query("COMMIT WORK");
+ projectB.query("UPDATE queue_build SET in_queue = 'f', last_used = '%s' WHERE filename = '%s' AND suite = %s" % (now_date, orig_tar_gz, suite_id))
+ projectB.query("COMMIT WORK")
################################################################################
def stable_install (summary, short_summary):
################################################################################
def stable_install (summary, short_summary):
# Begin a transaction; if we bomb out anywhere between here and
# the COMMIT WORK below, the DB won't be changed.
# Begin a transaction; if we bomb out anywhere between here and
# the COMMIT WORK below, the DB won't be changed.
# Add the source to stable (and remove it from proposed-updates)
for file in files.keys():
if files[file]["type"] == "dsc":
# Add the source to stable (and remove it from proposed-updates)
for file in files.keys():
if files[file]["type"] == "dsc":
version = dsc["version"]; # NB: not files[file]["version"], that has no epoch
q = projectB.query("SELECT id FROM source WHERE source = '%s' AND version = '%s'" % (package, version))
version = dsc["version"]; # NB: not files[file]["version"], that has no epoch
q = projectB.query("SELECT id FROM source WHERE source = '%s' AND version = '%s'" % (package, version))
- utils.fubar("[INTERNAL ERROR] couldn't find '%s' (%s) in source table." % (package, version));
- source_id = ql[0][0];
- suite_id = db_access.get_suite_id('proposed-updates');
- projectB.query("DELETE FROM src_associations WHERE suite = '%s' AND source = '%s'" % (suite_id, source_id));
- suite_id = db_access.get_suite_id('stable');
- projectB.query("INSERT INTO src_associations (suite, source) VALUES ('%s', '%s')" % (suite_id, source_id));
+ utils.fubar("[INTERNAL ERROR] couldn't find '%s' (%s) in source table." % (package, version))
+ source_id = ql[0][0]
+ suite_id = db_access.get_suite_id('proposed-updates')
+ projectB.query("DELETE FROM src_associations WHERE suite = '%s' AND source = '%s'" % (suite_id, source_id))
+ suite_id = db_access.get_suite_id('stable')
+ projectB.query("INSERT INTO src_associations (suite, source) VALUES ('%s', '%s')" % (suite_id, source_id))
# Add the binaries to stable (and remove it/them from proposed-updates)
for file in files.keys():
if files[file]["type"] == "deb":
binNMU = 0
# Add the binaries to stable (and remove it/them from proposed-updates)
for file in files.keys():
if files[file]["type"] == "deb":
binNMU = 0
- package = files[file]["package"];
- version = files[file]["version"];
- architecture = files[file]["architecture"];
- q = projectB.query("SELECT b.id FROM binaries b, architecture a WHERE b.package = '%s' AND b.version = '%s' AND (a.arch_string = '%s' OR a.arch_string = 'all') AND b.architecture = a.id" % (package, version, architecture));
- ql = q.getresult();
+ package = files[file]["package"]
+ version = files[file]["version"]
+ architecture = files[file]["architecture"]
+ q = projectB.query("SELECT b.id FROM binaries b, architecture a WHERE b.package = '%s' AND b.version = '%s' AND (a.arch_string = '%s' OR a.arch_string = 'all') AND b.architecture = a.id" % (package, version, architecture))
+ ql = q.getresult()
- suite_id = db_access.get_suite_id('proposed-updates');
- que = "SELECT b.version FROM binaries b JOIN bin_associations ba ON (b.id = ba.bin) JOIN suite su ON (ba.suite = su.id) WHERE b.package = '%s' AND (ba.suite = '%s')" % (package, suite_id);
+ suite_id = db_access.get_suite_id('proposed-updates')
+ que = "SELECT b.version FROM binaries b JOIN bin_associations ba ON (b.id = ba.bin) JOIN suite su ON (ba.suite = su.id) WHERE b.package = '%s' AND (ba.suite = '%s')" % (package, suite_id)
- utils.fubar("[INTERNAL ERROR] couldn't find '%s' (%s for %s architecture) in binaries table." % (package, version, architecture));
+ utils.fubar("[INTERNAL ERROR] couldn't find '%s' (%s for %s architecture) in binaries table." % (package, version, architecture))
- binary_id = ql[0][0];
- suite_id = db_access.get_suite_id('proposed-updates');
- projectB.query("DELETE FROM bin_associations WHERE suite = '%s' AND bin = '%s'" % (suite_id, binary_id));
- suite_id = db_access.get_suite_id('stable');
- projectB.query("INSERT INTO bin_associations (suite, bin) VALUES ('%s', '%s')" % (suite_id, binary_id));
+ binary_id = ql[0][0]
+ suite_id = db_access.get_suite_id('proposed-updates')
+ projectB.query("DELETE FROM bin_associations WHERE suite = '%s' AND bin = '%s'" % (suite_id, binary_id))
+ suite_id = db_access.get_suite_id('stable')
+ projectB.query("INSERT INTO bin_associations (suite, bin) VALUES ('%s', '%s')" % (suite_id, binary_id))
- new_changelog_filename = Cnf["Dir::Root"] + Cnf["Suite::Stable::ChangeLogBase"] + ".ChangeLog";
- changelog_filename = Cnf["Dir::Root"] + Cnf["Suite::Stable::ChangeLogBase"] + "ChangeLog";
+ new_changelog_filename = Cnf["Dir::Root"] + Cnf["Suite::Stable::ChangeLogBase"] + ".ChangeLog"
+ changelog_filename = Cnf["Dir::Root"] + Cnf["Suite::Stable::ChangeLogBase"] + "ChangeLog"
- new_changelog.write("stable/%s/binary-%s/%s\n" % (files[file]["component"], files[file]["architecture"], file));
+ new_changelog.write("stable/%s/binary-%s/%s\n" % (files[file]["component"], files[file]["architecture"], file))
- new_changelog.write("%s\n" % (file));
- chop_changes = katie.re_fdnic.sub("\n", changes["changes"]);
- new_changelog.write(chop_changes + '\n\n');
+ new_changelog.write("%s\n" % (file))
+ chop_changes = katie.re_fdnic.sub("\n", changes["changes"])
+ new_changelog.write(chop_changes + '\n\n')
- os.unlink(changelog_filename);
- utils.move(new_changelog_filename, changelog_filename);
+ os.unlink(changelog_filename)
+ utils.move(new_changelog_filename, changelog_filename)
- Subst["__SUITE__"] = " into stable";
- Subst["__SUMMARY__"] = summary;
- mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/kelly.installed");
- utils.send_mail(mail_message);
+ Subst["__SUITE__"] = " into stable"
+ Subst["__SUMMARY__"] = summary
+ mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/kelly.installed")
+ utils.send_mail(mail_message)
Katie.announce(short_summary, 1)
# Finally remove the .katie file
Katie.announce(short_summary, 1)
# Finally remove the .katie file
################################################################################
def process_it (changes_file):
################################################################################
def process_it (changes_file):
# Absolutize the filename to avoid the requirement of being in the
# same directory as the .changes file.
# Absolutize the filename to avoid the requirement of being in the
# same directory as the .changes file.
- old = Katie.pkg.changes_file;
- Katie.pkg.changes_file = os.path.basename(old);
- os.chdir(Cnf["Suite::Proposed-Updates::CopyKatie"]);
+ old = Katie.pkg.changes_file
+ Katie.pkg.changes_file = os.path.basename(old)
+ os.chdir(Cnf["Suite::Proposed-Updates::CopyKatie"])
- global projectB, Logger, Urgency_Logger, installing_to_stable;
+ global projectB, Logger, Urgency_Logger, installing_to_stable
# Check that we aren't going to clash with the daily cron job
if not Options["No-Action"] and os.path.exists("%s/Archive_Maintenance_In_Progress" % (Cnf["Dir::Root"])) and not Options["No-Lock"]:
# Check that we aren't going to clash with the daily cron job
if not Options["No-Action"] and os.path.exists("%s/Archive_Maintenance_In_Progress" % (Cnf["Dir::Root"])) and not Options["No-Lock"]:
# If running from within proposed-updates; assume an install to stable
if os.getcwd().find('proposed-updates') != -1:
# If running from within proposed-updates; assume an install to stable
if os.getcwd().find('proposed-updates') != -1:
- sys.stderr.write("Installed %d package %s, %s.\n" % (install_count, sets, utils.size_type(int(install_bytes))));
- Logger.log(["total",install_count,install_bytes]);
+ sys.stderr.write("Installed %d package %s, %s.\n" % (install_count, sets, utils.size_type(int(install_bytes))))
+ Logger.log(["total",install_count,install_bytes])
###############################################################################
if __name__ == '__main__':
###############################################################################
if __name__ == '__main__':