]> err.no Git - dak/commitdiff
Stop using Dir::Queue::
authorMark Hymers <mhy@debian.org>
Fri, 29 Jul 2011 10:28:02 +0000 (11:28 +0100)
committerMark Hymers <mhy@debian.org>
Fri, 29 Jul 2011 10:28:02 +0000 (11:28 +0100)
Signed-off-by: Mark Hymers <mhy@debian.org>
daklib/queue.py

index d5858c16df4f5039c958d13d7224e18824a9df25..4f52ea8200c8b40a18b5f5d4abecc512e1718351 100755 (executable)
@@ -879,15 +879,22 @@ class Upload(object):
                 # Check in one of the other directories
                 source_epochless_version = re_no_epoch.sub('', source_version)
                 dsc_filename = "%s_%s.dsc" % (source_package, source_epochless_version)
-                if os.path.exists(os.path.join(cnf["Dir::Queue::Byhand"], dsc_filename)):
+
+                byhand_dir = get_policy_queue('byhand', session).path
+                new_dir = get_policy_queue('new', session).path
+
+                if os.path.exists(os.path.join(byhand_dir, dsc_filename)):
                     entry["byhand"] = 1
-                elif os.path.exists(os.path.join(cnf["Dir::Queue::New"], dsc_filename)):
+                elif os.path.exists(os.path.join(new_dir, dsc_filename)):
                     entry["new"] = 1
                 else:
                     dsc_file_exists = False
-                    for myq in ["Embargoed", "Unembargoed", "ProposedUpdates", "OldProposedUpdates"]:
-                        if cnf.has_key("Dir::Queue::%s" % (myq)):
-                            if os.path.exists(os.path.join(cnf["Dir::Queue::" + myq], dsc_filename)):
+                    # TODO: Don't hardcode this list: use all relevant queues
+                    #       The question is how to determine what is relevant
+                    for queue_name in ["embargoed", "unembargoed", "proposedupdates", "oldproposedupdates"]:
+                        queue = get_policy_queue(queue_name, session)
+                        if queue:
+                            if os.path.exists(os.path.join(queue.path, dsc_filename)):
                                 dsc_file_exists = True
                                 break