From a38c4ff663325408375c12c441f2dbc5da3e2fce Mon Sep 17 00:00:00 2001 From: Mike O'Connor Date: Tue, 10 Nov 2009 11:23:16 -0500 Subject: [PATCH] fix the way we move files Signed-off-by: Mike O'Connor --- dak/process_new.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/dak/process_new.py b/dak/process_new.py index 67034f31..ff2c1838 100755 --- a/dak/process_new.py +++ b/dak/process_new.py @@ -817,8 +817,7 @@ def lock_package(package): finally: os.unlink(path) -@session_wrapper -def move_file_to_queue(to_q, f, session=None): +def move_file_to_queue(to_q, f, session): """mark a file as being in the unchecked queue""" # update the queue_file entry for the existing queue qf = session.query(QueueFile).filter_by(queueid=to_q.queueid, @@ -828,20 +827,16 @@ def move_file_to_queue(to_q, f, session=None): # update the changes_pending_files row f.queue = to_q - # actually move the file - src = os.path.join(f.queue.path, filename) - dest = os.path.join(to_q.path, filename) - shutil.move(src, dest) - -@session_wrapper -def changes_to_unchecked(changes, session=None): +def changes_to_unchecked(changes, session): """move a changes file to unchecked""" unchecked = get_queue( 'uncecked' ) changes.in_queue = unchecked - for f in changes.files: + for f in changes.pkg.files: move_file_to_queue(unchecked, f) + # actually move files + changes.move_to_queue(unchecked) def _accept(upload): if Options["No-Action"]: @@ -849,7 +844,7 @@ def _accept(upload): (summary, short_summary) = upload.build_summaries() # upload.accept(summary, short_summary, targetqueue) # os.unlink(upload.pkg.changes_file[:-8]+".dak") - changes_to_unchecked(upload.pkg) + changes_to_unchecked(upload) def do_accept(upload): print "ACCEPT" -- 2.39.5