X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fprocess_policy.py;h=8103fd0ba808453e8a63b02aaaa2cfd658648c68;hb=4cbcf2ec05c369e20897afb68770826468b84fdf;hp=77bc448a61c692f296b0e32fe12d2dea73ebcaba;hpb=ffa6f7b4004942f0f1a83dc8a7766fc3a5f0ae0f;p=dak.git diff --git a/dak/process_policy.py b/dak/process_policy.py index 77bc448a..8103fd0b 100755 --- a/dak/process_policy.py +++ b/dak/process_policy.py @@ -68,6 +68,10 @@ def do_comments(dir, srcqueue, opref, npref, line, fn, transaction): else: changes_prefix = changes_prefix + '.changes' + # We need to escape "_" as we use it with the LIKE operator (via the + # SQLA startwith) later. + changes_prefix = changes_prefix.replace("_", r"\_") + uploads = session.query(PolicyQueueUpload).filter_by(policy_queue=srcqueue) \ .join(PolicyQueueUpload.changes).filter(DBChange.changesname.startswith(changes_prefix)) \ .order_by(PolicyQueueUpload.source_id)