From 648aa7bb0b2cc314deb823322ad4782be7633da8 Mon Sep 17 00:00:00 2001 From: Mike O'Connor Date: Tue, 10 Nov 2009 07:36:41 -0500 Subject: [PATCH] attempt to fix process_new a.) move files back into unchecked. b.) mark them in the database table Signed-off-by: Mike O'Connor --- dak/process_new.py | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/dak/process_new.py b/dak/process_new.py index e052af49..67034f31 100755 --- a/dak/process_new.py +++ b/dak/process_new.py @@ -817,12 +817,39 @@ def lock_package(package): finally: os.unlink(path) +@session_wrapper +def move_file_to_queue(to_q, f, session=None): + """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, + filename=f.filename) + qf.queue = to_q + + # 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): + """move a changes file to unchecked""" + unchecked = get_queue( 'uncecked' ) + changes.in_queue = unchecked + + for f in changes.files: + move_file_to_queue(unchecked, f) + + def _accept(upload): if Options["No-Action"]: return (summary, short_summary) = upload.build_summaries() - upload.accept(summary, short_summary, targetqueue) - os.unlink(upload.pkg.changes_file[:-8]+".dak") +# upload.accept(summary, short_summary, targetqueue) +# os.unlink(upload.pkg.changes_file[:-8]+".dak") + changes_to_unchecked(upload.pkg) def do_accept(upload): print "ACCEPT" -- 2.39.5