]> git.decadent.org.uk Git - dak.git/commitdiff
More database use to replace config file
authorMark Hymers <mhy@debian.org>
Fri, 29 Jul 2011 11:44:19 +0000 (12:44 +0100)
committerMark Hymers <mhy@debian.org>
Fri, 29 Jul 2011 11:44:19 +0000 (12:44 +0100)
Signed-off-by: Mark Hymers <mhy@debian.org>
daklib/queue.py

index c4938df1e0b59bb19f237e1abf0d49caf1ba11ee..eea43f78b82bb1a01217d36cf8eb2a0759202d60 100755 (executable)
@@ -2754,12 +2754,15 @@ distribution."""
                     orig_files[dsc_name]["path"] = old_file
                     orig_files[dsc_name]["location"] = x.location.location_id
                 else:
-                    # TODO: Record the queues and info in the DB so we don't hardcode all this crap
+                    # TODO: Determine queue list dynamically
                     # Not there? Check the queue directories...
-                    for directory in [ "New", "Byhand", "ProposedUpdates", "OldProposedUpdates", "Embargoed", "Unembargoed" ]:
-                        if not Cnf.has_key("Dir::Queue::%s" % (directory)):
+                    for queue_name in [ "byhand", "new", "proposedupdates", "oldproposedupdates", "embargoed", "unembargoed" ]:
+                        queue = get_policy_queue(queue_name, session)
+                        if not queue:
                             continue
-                        in_otherdir = os.path.join(Cnf["Dir::Queue::%s" % (directory)], dsc_name)
+
+                        in_otherdir = os.path.join(queue.path, dsc_name)
+
                         if os.path.exists(in_otherdir):
                             in_otherdir_fh = utils.open_file(in_otherdir)
                             actual_md5 = apt_pkg.md5sum(in_otherdir_fh)