Merge lp:~cjwatson/launchpad/remove-old-ftparchive-compat into lp:launchpad

Proposed by Colin Watson
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 17260
Proposed branch: lp:~cjwatson/launchpad/remove-old-ftparchive-compat
Merge into: lp:launchpad
Diff against target: 126 lines (+25/-25)
4 files modified
lib/lp/archivepublisher/tests/apt-data/Packages (+1/-0)
lib/lp/archivepublisher/tests/apt-data/Sources (+9/-0)
lib/lp/archivepublisher/tests/test_ftparchive.py (+3/-19)
lib/lp/soyuz/doc/soyuz-upload.txt (+12/-6)
To merge this branch: bzr merge lp:~cjwatson/launchpad/remove-old-ftparchive-compat
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+242679@code.launchpad.net

Commit message

Remove support for apt-ftparchive from old Ubuntu versions.

Description of the change

LP is on >= precise now, so we can get rid of test workarounds for elderly versions of apt-ftparchive.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/archivepublisher/tests/apt-data/Packages'
2--- lib/lp/archivepublisher/tests/apt-data/Packages 2013-09-30 01:08:01 +0000
3+++ lib/lp/archivepublisher/tests/apt-data/Packages 2014-11-24 16:22:42 +0000
4@@ -10,6 +10,7 @@
5 MD5sum: 390074949d9533c4cf6774b9891306d0
6 SHA1: 1beb6c7f6be8d5b9d86335a0a939b1b49aec9aa9
7 SHA256: d652be5856066b3f5bb8df43e43199ee480aa65a1ccf8e78be4178a824c493ce
8+SHA512: 51a3a466a70bb447b1dd2cecd35ff9184ce89f8785d6783dae286d7e03ce8cd4bb72af0a61c294469e683e003ecb4c833ab45ed98102ad8020d9f9dc7ac82909
9 Description: A tiny test package.
10 Doesn't really do anything at all.
11 Bugs: https://bugs.launchpad.net/ubuntu/+filebug
12
13=== modified file 'lib/lp/archivepublisher/tests/apt-data/Sources'
14--- lib/lp/archivepublisher/tests/apt-data/Sources 2013-09-30 01:08:01 +0000
15+++ lib/lp/archivepublisher/tests/apt-data/Sources 2014-11-24 16:22:42 +0000
16@@ -14,4 +14,13 @@
17 63a97b775d908be8426e8891e582f1c2 485 tiny_0.1.tar.gz
18 Package-List:
19 tiny deb devel extra
20+Checksums-Sha1:
21+ 0528aa847dfd802bc788320f906f846b4931b840 444 tiny_0.1.dsc
22+ d19603504f4c5c347dd6871d03bf232c7d54516a 485 tiny_0.1.tar.gz
23+Checksums-Sha256:
24+ 4b21ba373193932f1e72359d765fe26f2c991f25a0ec3ad72d209a5fe81823f3 444 tiny_0.1.dsc
25+ 8a4a42063805dc1f9ee52b201b58da7c4aa594d6ad916673827320458bf0d9b2 485 tiny_0.1.tar.gz
26+Checksums-Sha512:
27+ 9ec0fb83923f67e7a55fde5b1bc323e950cdf710e676d5b69486e8c3b1afe63b137e7f7bdcdd2e10f080d75de40cff162857dfafb455e23ccfd52c4b1a1c7f5e 444 tiny_0.1.dsc
28+ 7c1502d6709c2dbed18fa7ab6cf485321c46f44467745101ef1230413840378dadfb8f361d72a1df12d927308a77938914b166921e77258c3d3471c4650aa9b1 485 tiny_0.1.tar.gz
29
30
31=== modified file 'lib/lp/archivepublisher/tests/test_ftparchive.py'
32--- lib/lp/archivepublisher/tests/test_ftparchive.py 2014-01-17 03:21:05 +0000
33+++ lib/lp/archivepublisher/tests/test_ftparchive.py 2014-11-24 16:22:42 +0000
34@@ -43,18 +43,6 @@
35 )
36
37
38-def sanitize_apt_ftparchive_Sources_output(text):
39- # XXX: maxb 2010-04-15 bug=563503: Filter Checksums-* stanzas out of
40- # apt-ftparchive Sources file content, such that the output of lucid
41- # apt-ftparchive is the same as on karmic.
42- return re.subn(r'(?sm)^Checksums-.*?(?=^[^ ])', '', text)[0]
43-
44-
45-def skip_sha512(text):
46- """Ignore SHA512 lines, which are present only in newer distroseries."""
47- return re.sub('SHA512: [0-9a-f]*\n', '', text)
48-
49-
50 class SamplePublisher:
51 """Publisher emulation test class."""
52
53@@ -110,15 +98,13 @@
54 super(TestFTPArchive, self).tearDown()
55 shutil.rmtree(self._config.distroroot)
56
57- def _verifyFile(self, filename, directory, output_filter=None):
58+ def _verifyFile(self, filename, directory):
59 """Compare byte-to-byte the given file and the respective sample.
60
61 It's a poor way of testing files generated by apt-ftparchive.
62 """
63 result_path = os.path.join(directory, filename)
64 result_text = open(result_path).read()
65- if output_filter is not None:
66- result_text = output_filter(result_text)
67 sample_path = os.path.join(self._sampledir, filename)
68 sample_text = open(sample_path).read()
69 # When the comparison between the sample text and the generated text
70@@ -451,15 +437,13 @@
71 # regressions.
72 fa.runApt(apt_conf)
73 self._verifyFile("Packages",
74- os.path.join(self._distsdir, "hoary-test", "main", "binary-i386"),
75- skip_sha512)
76+ os.path.join(self._distsdir, "hoary-test", "main", "binary-i386"))
77 self._verifyEmpty(
78 os.path.join(
79 self._distsdir, "hoary-test", "main", "debian-installer",
80 "binary-i386", "Packages"))
81 self._verifyFile("Sources",
82- os.path.join(self._distsdir, "hoary-test", "main", "source"),
83- sanitize_apt_ftparchive_Sources_output)
84+ os.path.join(self._distsdir, "hoary-test", "main", "source"))
85
86 # XXX cprov 2007-03-21: see above, byte-to-byte configuration
87 # comparing is weak.
88
89=== modified file 'lib/lp/soyuz/doc/soyuz-upload.txt'
90--- lib/lp/soyuz/doc/soyuz-upload.txt 2014-08-05 10:34:11 +0000
91+++ lib/lp/soyuz/doc/soyuz-upload.txt 2014-11-24 16:22:42 +0000
92@@ -467,8 +467,6 @@
93 >>> sources = open(
94 ... "/var/tmp/archive/ubuntutest/dists/breezy-autotest/universe/source"
95 ... "/Sources").read()
96- >>> import re
97- >>> sources = re.subn(r'(?sm)^Checksums-.*?(?=^[^ ])', '', sources)[0]
98 >>> print sources + '\nEND'
99 Package: etherwake
100 Binary: etherwake
101@@ -484,14 +482,22 @@
102 f13711c5b8261fbb77b43ae0e8ba9360 566 etherwake_1.08-1.dsc
103 c2dc10f98bac012b900fd0b46721fc80 4455 etherwake_1.08.orig.tar.gz
104 95c1e89e3ad7bc8740793bdf7aeb7334 4145 etherwake_1.08-1.diff.gz
105+ Checksums-Sha1:
106+ 2ddcdc87ab3dc35d5ce8232b0cc76bad8242725f 566 etherwake_1.08-1.dsc
107+ 4d8aa805cf262a613a48597e3638054dae421048 4455 etherwake_1.08.orig.tar.gz
108+ f0ec9827c3ce66c0e1ea2c2f100ec144cb26b264 4145 etherwake_1.08-1.diff.gz
109+ Checksums-Sha256:
110+ 0077eb18c0c02e931021e523ae3ae307731726f7b00736f66139fffa7181a915 566 etherwake_1.08-1.dsc
111+ e309f8a45cab2d9a955efee5423b052bc040df1e9a9b85893682ab8647264495 4455 etherwake_1.08.orig.tar.gz
112+ 330e7f515d2da923d83131a1fbb5868adc4633e98a35d7b0e1787da46b63ffac 4145 etherwake_1.08-1.diff.gz
113+ Checksums-Sha512:
114+ 51216a36b2ab6fde6ae04d5bcb0b7cefa9a18eb4b2b11552ca8f3abde928159e93729f30c6079e913078e966817368a6095de2cb4239676a3d6ed5d49d9de699 566 etherwake_1.08-1.dsc
115+ 6ab88a579ae3fdbbe0f1904712a3a42fab98fa586c3718243d2380f3cb021158c228312001b0685a77dc7171b0307d591ad971a82cd1ccd3511135b23d95ee21 4455 etherwake_1.08.orig.tar.gz
116+ 814074aa8349936fbec84b3ee703788159a085f0ce4a5e35d2dbef617e1c3c6e60818d155772d47b58e0823ed4bc9af29136f64eac8d643a833660e537145cb1 4145 etherwake_1.08-1.diff.gz
117 <BLANKLINE>
118 <BLANKLINE>
119 END
120
121-# XXX: maxb 2010-04-15 bug=563503
122-# The regex munging above can be removed once the tests no longer need to pass
123-# on Karmic and earlier.
124-
125 Now we invoke changeOverride on just published etherwake, moving it to
126 component 'multiverse'.
127