X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fclean_queues.py;h=f6964508a5b7e76a71f0c7347e5a0d441cdf44a1;hb=a3775bb96242c59531b84dc7c7a002c8c884c4f4;hp=a5b154279e6597094f040113d2dc9d87a710abe5;hpb=4c2ec0229b86a4ddb196bb567cf90ea2f94ae84f;p=dak.git diff --git a/dak/clean_queues.py b/dak/clean_queues.py index a5b15427..f6964508 100755 --- a/dak/clean_queues.py +++ b/dak/clean_queues.py @@ -83,10 +83,10 @@ def init (cnf): os.chdir(incoming) # Remove a file to the morgue -def remove (f): +def remove (from_dir, f): fname = os.path.basename(f) if os.access(f, os.R_OK): - Logger.log(["move file to morgue", fname, del_dir]) + Logger.log(["move file to morgue", from_dir, fname, del_dir]) if Options["Verbose"]: print "Removing '%s' (to '%s')." % (fname, del_dir) if Options["No-Action"]: @@ -106,11 +106,11 @@ def remove (f): # [Used for Incoming/REJECT] # def flush_old (): - Logger.log(["check Incoming/REJECT for old files"]) + Logger.log(["check Incoming/REJECT for old files", os.getcwd()]) for f in os.listdir('.'): if os.path.isfile(f): if os.stat(f)[stat.ST_MTIME] < delete_date: - remove(f) + remove('Incoming/REJECT', f) else: if Options["Verbose"]: print "Skipping, too new, '%s'." % (os.path.basename(f)) @@ -122,7 +122,7 @@ def flush_orphans (): all_files = {} changes_files = [] - Logger.log(["check Incoming for old orphaned files"]) + Logger.log(["check Incoming for old orphaned files", os.getcwd()]) # Build up the list of all files in the directory for i in os.listdir('.'): if os.path.isfile(i): @@ -143,7 +143,7 @@ def flush_orphans (): for f in files.keys(): if f.endswith(".dsc"): try: - dsc = utils.parse_changes(f) + 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)) @@ -163,7 +163,7 @@ def flush_orphans (): # a .dsc) and should be deleted if old enough. for f in all_files.keys(): if os.stat(f)[stat.ST_MTIME] < delete_date: - remove(f) + remove('Incoming', f) else: if Options["Verbose"]: print "Skipping, too new, '%s'." % (os.path.basename(f))