Merge lp:~cjwatson/click/new-debsig-policy-url into lp:click/devel

Proposed by Colin Watson
Status: Merged
Merged at revision: 614
Proposed branch: lp:~cjwatson/click/new-debsig-policy-url
Merge into: lp:click/devel
Diff against target: 40 lines (+11/-3)
1 file modified
click/tests/integration/test_signatures.py (+11/-3)
To merge this branch: bzr merge lp:~cjwatson/click/new-debsig-policy-url
Reviewer Review Type Date Requested Status
Timo Jyrinki (community) Approve
click hackers Pending
Review via email: mp+302652@code.launchpad.net

Commit message

Handle new policy URL in debsig-verify 0.15.

Description of the change

Handle new policy URL in debsig-verify 0.15.

To post a comment you must log in.
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Thank you! Builds fine, getting it to the archives.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'click/tests/integration/test_signatures.py'
2--- click/tests/integration/test_signatures.py 2014-09-04 21:06:46 +0000
3+++ click/tests/integration/test_signatures.py 2016-08-11 10:42:33 +0000
4@@ -22,6 +22,8 @@
5 import tarfile
6 from textwrap import dedent
7
8+import apt
9+
10 from .helpers import (
11 require_root,
12 ClickTestCase,
13@@ -66,10 +68,14 @@
14
15 def install_signature_policy(self):
16 """Install/update the system-wide signature policy"""
17+ if apt.Cache()["debsig-verify"].installed >= "0.15":
18+ debsig_xmlns = "https://www.debian.org/debsig/1.0/"
19+ else:
20+ debsig_xmlns = "http://www.debian.org/debsig/1.0/"
21 xmls = dedent("""\
22 <?xml version="1.0"?>
23- <!DOCTYPE Policy SYSTEM "http://www.debian.org/debsig/1.0/policy.dtd">
24- <Policy xmlns="http://www.debian.org/debsig/1.0/">
25+ <!DOCTYPE Policy SYSTEM "{debsig_xmlns}policy.dtd">
26+ <Policy xmlns="{debsig_xmlns}">
27
28 <Origin Name="test-origin" id="{keyid}" Description="Example policy"/>
29 <Selection>
30@@ -80,7 +86,9 @@
31 <Required Type="origin" File="{filename}" id="{keyid}"/>
32 </Verification>
33 </Policy>
34- """.format(keyid=self.keyid, filename="origin.pub"))
35+ """.format(
36+ debsig_xmlns=debsig_xmlns, keyid=self.keyid,
37+ filename="origin.pub"))
38 makedirs(os.path.dirname(self.policy))
39 with open(self.policy, "w") as f:
40 f.write(xmls)

Subscribers

People subscribed via source and target branches

to all changes: