From f40df055fa0d4b37b6aac772e40747b8285c8c7c Mon Sep 17 00:00:00 2001 From: James Troup Date: Thu, 18 May 2006 16:27:34 -0500 Subject: [PATCH] More trivial fixes. --- dak/control_overrides.py | 2 +- dak/examine_package.py | 5 ++--- dak/process_accepted.py | 14 +++++++------- dak/process_new.py | 20 ++++++++++---------- dak/process_unchecked.py | 2 +- dak/reject_proposed_updates.py | 4 ++-- dak/rm.py | 10 +++++----- dak/symlink_dists.py | 2 +- 8 files changed, 29 insertions(+), 30 deletions(-) diff --git a/dak/control_overrides.py b/dak/control_overrides.py index 7f4cc7b2..69949e24 100755 --- a/dak/control_overrides.py +++ b/dak/control_overrides.py @@ -50,8 +50,8 @@ ################################################################################ import pg, sys, time -import utils, database, logging import apt_pkg +import daklib.utils, daklib.database, daklib.logging ################################################################################ diff --git a/dak/examine_package.py b/dak/examine_package.py index 7abcb319..e87cc281 100755 --- a/dak/examine_package.py +++ b/dak/examine_package.py @@ -32,10 +32,9 @@ ################################################################################ -import errno, os, re, sys -import utils +import errno, os, pg, re, sys import apt_pkg, apt_inst -import pg, database +import daklib.database, daklib.utils ################################################################################ diff --git a/dak/process_accepted.py b/dak/process_accepted.py index d175de8a..849cdfe9 100755 --- a/dak/process_accepted.py +++ b/dak/process_accepted.py @@ -376,7 +376,7 @@ def install (): new_files_id = daklib.database.get_files_id(new_filename, file_size, file_md5sum, dsc_location_id) if new_files_id == None: daklib.utils.copy(old_filename, Cnf["Dir::Pool"] + new_filename) - new_files_id = database.set_files_id(new_filename, file_size, file_md5sum, dsc_location_id) + new_files_id = daklib.database.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)) # Install the files into the pool @@ -419,7 +419,7 @@ def install (): if suite not in Cnf.ValueList("Dinstall::QueueBuildSuites"): continue now_date = time.strftime("%Y-%m-%d %H:%M") - suite_id = database.get_suite_id(suite) + suite_id = daklib.database.get_suite_id(suite) dest_dir = Cnf["Dir::QueueBuild"] if Cnf.FindB("Dinstall::SecurityQueueBuild"): dest_dir = os.path.join(dest_dir, suite) @@ -468,9 +468,9 @@ def stable_install (summary, short_summary): if not ql: daklib.utils.fubar("[INTERNAL ERROR] couldn't find '%s' (%s) in source table." % (package, version)) source_id = ql[0][0] - suite_id = database.get_suite_id('proposed-updates') + suite_id = daklib.database.get_suite_id('proposed-updates') projectB.query("DELETE FROM src_associations WHERE suite = '%s' AND source = '%s'" % (suite_id, source_id)) - suite_id = database.get_suite_id('stable') + suite_id = daklib.database.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) @@ -483,7 +483,7 @@ def stable_install (summary, short_summary): 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() if not ql: - suite_id = database.get_suite_id('proposed-updates') + suite_id = daklib.database.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) q = projectB.query(que) @@ -498,9 +498,9 @@ def stable_install (summary, short_summary): break if not binNMU: binary_id = ql[0][0] - suite_id = database.get_suite_id('proposed-updates') + suite_id = daklib.database.get_suite_id('proposed-updates') projectB.query("DELETE FROM bin_associations WHERE suite = '%s' AND bin = '%s'" % (suite_id, binary_id)) - suite_id = database.get_suite_id('stable') + suite_id = daklib.database.get_suite_id('stable') projectB.query("INSERT INTO bin_associations (suite, bin) VALUES ('%s', '%s')" % (suite_id, binary_id)) else: del files[file] diff --git a/dak/process_new.py b/dak/process_new.py index 6af50896..45927b9c 100755 --- a/dak/process_new.py +++ b/dak/process_new.py @@ -163,10 +163,10 @@ def determine_new (changes, files): new[pkg]["othercomponents"] = f["othercomponents"] for suite in changes["suite"].keys(): - suite_id = database.get_suite_id(suite) + suite_id = daklib.database.get_suite_id(suite) for pkg in new.keys(): - component_id = database.get_component_id(new[pkg]["component"]) - type_id = database.get_override_type_id(new[pkg]["type"]) + component_id = daklib.database.get_component_id(new[pkg]["component"]) + type_id = daklib.database.get_override_type_id(new[pkg]["type"]) q = projectB.query("SELECT package FROM override WHERE package = '%s' AND suite = %s AND component = %s AND type = %s" % (pkg, suite_id, component_id, type_id)) ql = q.getresult() if ql: @@ -325,8 +325,8 @@ def check_valid (new): section = new[pkg]["section"] priority = new[pkg]["priority"] type = new[pkg]["type"] - new[pkg]["section id"] = database.get_section_id(section) - new[pkg]["priority id"] = database.get_priority_id(new[pkg]["priority"]) + new[pkg]["section id"] = daklib.database.get_section_id(section) + new[pkg]["priority id"] = daklib.database.get_priority_id(new[pkg]["priority"]) # Sanity checks if (section == "debian-installer" and type != "udeb") or \ (section != "debian-installer" and type == "udeb"): @@ -376,7 +376,7 @@ def get_type (f): daklib.utils.fubar("invalid type (%s) for new. Dazed, confused and sure as heck not continuing." % (type)) # Validate the override type - type_id = database.get_override_type_id(type) + type_id = daklib.database.get_override_type_id(type) if type_id == -1: daklib.utils.fubar("invalid type (%s) for new. Say wha?" % (type)) @@ -624,10 +624,10 @@ def add_overrides (new): projectB.query("BEGIN WORK") for suite in changes["suite"].keys(): - suite_id = database.get_suite_id(suite) + suite_id = daklib.database.get_suite_id(suite) for pkg in new.keys(): - component_id = database.get_component_id(new[pkg]["component"]) - type_id = database.get_override_type_id(new[pkg]["type"]) + component_id = daklib.database.get_component_id(new[pkg]["component"]) + type_id = daklib.database.get_override_type_id(new[pkg]["type"]) priority_id = new[pkg]["priority id"] section_id = new[pkg]["section id"] projectB.query("INSERT INTO override (suite, component, type, package, priority, section, maintainer) VALUES (%s, %s, %s, '%s', %s, %s, '')" % (suite_id, component_id, type_id, pkg, priority_id, section_id)) @@ -705,7 +705,7 @@ def do_new(): changes["suite"][override] = 1 # Validate suites for suite in changes["suite"].keys(): - suite_id = database.get_suite_id(suite) + suite_id = daklib.database.get_suite_id(suite) if suite_id == -1: daklib.utils.fubar("%s has invalid suite '%s' (possibly overriden). say wha?" % (changes, suite)) diff --git a/dak/process_unchecked.py b/dak/process_unchecked.py index 796c98a3..01e95eed 100755 --- a/dak/process_unchecked.py +++ b/dak/process_unchecked.py @@ -1066,7 +1066,7 @@ def action (): break if queue: print "%s for %s\n%s%s" % ( - daklib.queue.upper(), ", ".join(changes["distribution"].keys()), + queue.upper(), ", ".join(changes["distribution"].keys()), reject_message, summary), queuekey = queue[0].upper() if queuekey in "RQSA": diff --git a/dak/reject_proposed_updates.py b/dak/reject_proposed_updates.py index 5d434948..c1639ad8 100755 --- a/dak/reject_proposed_updates.py +++ b/dak/reject_proposed_updates.py @@ -68,7 +68,7 @@ def main(): daklib.utils.fubar("need at least one .changes filename as an argument.") projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])) - database.init(Cnf, projectB) + daklib.database.init(Cnf, projectB) Upload = daklib.queue.Upload(Cnf) Logger = Upload.Logger = daklib.logging.Logger(Cnf, "reject-proposed-updates") @@ -177,7 +177,7 @@ def reject (reject_message = ""): os.close(reject_fd) # Remove the packages from proposed-updates - suite_id = database.get_suite_id('proposed-updates') + suite_id = daklib.database.get_suite_id('proposed-updates') projectB.query("BEGIN WORK") # Remove files from proposed-updates suite diff --git a/dak/rm.py b/dak/rm.py index aac75a36..8008232b 100755 --- a/dak/rm.py +++ b/dak/rm.py @@ -251,7 +251,7 @@ def main (): usage() projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])) - database.init(Cnf, projectB) + daklib.database.init(Cnf, projectB) # Sanity check options if not arguments: @@ -309,7 +309,7 @@ def main (): suites_list = daklib.utils.join_with_commas_and(suites) if not Options["No-Action"]: for suite in suites: - suite_id = database.get_suite_id(suite) + suite_id = daklib.database.get_suite_id(suite) if suite_id != -1: suite_ids_list.append(suite_id) if suite == "stable": @@ -420,7 +420,7 @@ def main (): maintainer_list = [] for maintainer_id in maintainers.keys(): - maintainer_list.append(database.get_maintainer(maintainer_id)) + maintainer_list.append(daklib.database.get_maintainer(maintainer_id)) summary = "" removals = d.keys() removals.sort() @@ -468,8 +468,8 @@ def main (): logfile.write("----------------------------------------------\n") logfile.flush() - dsc_type_id = database.get_override_type_id('dsc') - deb_type_id = database.get_override_type_id('deb') + dsc_type_id = daklib.database.get_override_type_id('dsc') + deb_type_id = daklib.database.get_override_type_id('deb') # Do the actual deletion print "Deleting...", diff --git a/dak/symlink_dists.py b/dak/symlink_dists.py index 95bf151e..a6b3d415 100755 --- a/dak/symlink_dists.py +++ b/dak/symlink_dists.py @@ -177,7 +177,7 @@ def main (): projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])) - database.init(Cnf, projectB) + daklib.database.init(Cnf, projectB) find_dislocated_stable(Cnf, projectB) -- 2.39.5