X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fclean_queues.py;h=209591ac01b913d6eef2c2369e201b9ec579d231;hb=17c5cab4eb8d5181ec7a81267a4e2e6b43c0fc65;hp=4147ab054533245ad21aab8cd8d0ae6c9dd8b182;hpb=f8783d3e7d165814889a64278dc31388b99c0b89;p=dak.git diff --git a/dak/clean_queues.py b/dak/clean_queues.py index 4147ab05..209591ac 100755 --- a/dak/clean_queues.py +++ b/dak/clean_queues.py @@ -39,7 +39,6 @@ import apt_pkg from daklib import utils from daklib import daklog from daklib.config import Config -from daklib.dbconn import get_policy_queue ################################################################################ @@ -91,12 +90,11 @@ def init (cnf): utils.fubar("%s must be a directory." % (del_dir)) # Move to the directory to clean - incoming = Options["Incoming"] - if incoming == "": - incoming_queue = get_policy_queue('unchecked') - if not incoming_queue: - utils.fubar("Cannot find 'unchecked' queue") - incoming = incoming_queue.path + incoming = Options.get("Incoming") + if not incoming: + incoming = cnf.get('Dir::Unchecked') + if not incoming: + utils.fubar("Cannot find 'unchecked' directory") try: os.chdir(incoming) @@ -157,7 +155,7 @@ def flush_orphans (): changes = utils.parse_changes(changes_filename) files = utils.build_file_list(changes) except: - utils.warn("error processing '%s'; skipping it. [Got %s]" % (changes_filename, sys.exc_type)) + utils.warn("error processing '%s'; skipping it. [Got %s]" % (changes_filename, sys.exc_info()[0])) continue dsc_files = {} @@ -167,7 +165,7 @@ def flush_orphans (): dsc = utils.parse_changes(f, dsc_file=1) dsc_files = utils.build_file_list(dsc, is_a_dsc=1) except: - utils.warn("error processing '%s'; skipping it. [Got %s]" % (f, sys.exc_type)) + utils.warn("error processing '%s'; skipping it. [Got %s]" % (f, sys.exc_info()[0])) continue # Ensure all the files we've seen aren't deleted @@ -208,8 +206,8 @@ def main (): ('n',"no-action","Clean-Queues::Options::No-Action"), ('v',"verbose","Clean-Queues::Options::Verbose")] - apt_pkg.ParseCommandLine(cnf.Cnf,Arguments,sys.argv) - Options = cnf.SubTree("Clean-Queues::Options") + apt_pkg.parse_commandline(cnf.Cnf,Arguments,sys.argv) + Options = cnf.subtree("Clean-Queues::Options") if Options["Help"]: usage()