X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fqueue_install.py;h=3283e1eff7591bb6ccfcd058b005198f82d9cca4;hb=25417639c3b647c2a2ad20cdfb2f00bdf24552e9;hp=e6aee579faaaba1a61f9efd8c2f3ca4a75df9a93;hpb=b96fec590c5123bd91db1144ae813e2a133f3571;p=dak.git diff --git a/daklib/queue_install.py b/daklib/queue_install.py index e6aee579..3283e1ef 100644 --- a/daklib/queue_install.py +++ b/daklib/queue_install.py @@ -53,15 +53,17 @@ def package_to_suite(u, suite_name, session): return ret -def package_to_queue(u, summary, short_summary, queue, perms=0660, announce=None): +def package_to_queue(u, summary, short_summary, queue, chg, session, announce=None): cnf = Config() dir = queue.path print "Moving to %s policy queue" % queue.queue_name.upper() u.logger.log(["Moving to %s" % queue.queue_name, u.pkg.changes_file]) - u.move_to_dir(dir, perms=perms) - # TODO: Put building logic in here? We used to take a build=bool argument + u.move_to_queue(queue) + chg.in_queue_id = queue.policy_queue_id + session.add(chg) + session.commit() # Check for override disparities u.check_override() @@ -162,7 +164,7 @@ def is_autobyhand(u): return any_auto and all_auto -def do_autobyhand(u, summary, short_summary, session=None): +def do_autobyhand(u, summary, short_summary, chg, session): print "Attempting AUTOBYHAND." byhandleft = True for f, entry in u.pkg.files.items(): @@ -192,7 +194,7 @@ def do_autobyhand(u, summary, short_summary, session=None): byhandleft = True if byhandleft: - do_byhand(u, summary, short_summary, session) + do_byhand(u, summary, short_summary, chg, session) else: u.accept(summary, short_summary, session) u.check_override() @@ -205,9 +207,10 @@ def is_byhand(u): return True return False -def do_byhand(u, summary, short_summary, session=None): - return package_to_queue(u, summary, short_summary, "Byhand", - perms=0660, build=False, announce=None) +def do_byhand(u, summary, short_summary, chg, session): + return package_to_queue(u, summary, short_summary, + get_policy_queue('byhand'), chg, session, + announce=None) ################################################################################ @@ -217,13 +220,18 @@ def is_new(u): return True return False -def acknowledge_new(u, summary, short_summary, session=None): +def acknowledge_new(u, summary, short_summary, chg, session): cnf = Config() print "Moving to NEW queue." u.logger.log(["Moving to new", u.pkg.changes_file]) - u.move_to_dir(cnf["Dir::Queue::New"], perms=0640, changesperms=0644) + q = get_policy_queue('new', session) + + u.move_to_queue(q) + chg.in_queue_id = q.policy_queue_id + session.add(chg) + session.commit() if not cnf["Dinstall::Options::No-Mail"]: print "Sending new ack." @@ -248,9 +256,10 @@ def determine_target(u): # Statically handled queues target = None - for q in QueueInfo.keys(): + for q in ["new", "autobyhand", "byhand"]: if QueueInfo[q]["is"](u): target = q + break return target