From b1be5f064750bbe39050ff278a9e6d2baf0e2aa8 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Tue, 15 Oct 2013 11:22:24 +0200 Subject: [PATCH] dak/process_policy: Process source uploads first If we only process the NEW queue in readdir order, we risk processing a binary package before its source, which will lead to spurious REJECTs. This processes all source-only uploads first, which prevents that from happening. Signed-off-by: Tollef Fog Heen --- dak/process_policy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dak/process_policy.py b/dak/process_policy.py index ddd05b7c..e88a5023 100755 --- a/dak/process_policy.py +++ b/dak/process_policy.py @@ -56,7 +56,10 @@ Logger = None def do_comments(dir, srcqueue, opref, npref, line, fn, transaction): session = transaction.session - for comm in [ x for x in os.listdir(dir) if x.startswith(opref) ]: + comms = filter(lambda x: x.startswith(opref), os.listdir(dir)) + # Sort source uploads first. + comms = sorted(comms, key=lambda x: not x.endswith("_source")) + for comm in comms: lines = open(os.path.join(dir, comm)).readlines() if len(lines) == 0 or lines[0] != line + "\n": continue -- 2.39.5