X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fqueue_install.py;h=3283e1eff7591bb6ccfcd058b005198f82d9cca4;hb=c0118300a7f7f9d17ce378caf05ee50ba85724d4;hp=d6b651b2707e8ed60d8d388318b35275dfc09215;hpb=61a3eb37937eb827a8e69827a9d0fe06b0c8ed03;p=dak.git diff --git a/daklib/queue_install.py b/daklib/queue_install.py index d6b651b2..3283e1ef 100644 --- a/daklib/queue_install.py +++ b/daklib/queue_install.py @@ -34,14 +34,14 @@ from daklib.config import Config ################################################################################ def package_to_suite(u, suite_name, session): - if not u.pkg.changes["distribution"].has_key(suite): + if not u.pkg.changes["distribution"].has_key(suite_name): return False ret = True if not u.pkg.changes["architecture"].has_key("source"): q = session.query(SrcAssociation.sa_id) - q = q.join(Suite).filter_by(suite_name=suite) + q = q.join(Suite).filter_by(suite_name=suite_name) q = q.join(DBSource).filter_by(source=u.pkg.changes['source']) q = q.filter_by(version=u.pkg.changes['version']).limit(1) @@ -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