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
=== modified file 'lib/lp/archivepublisher/tests/apt-data/Packages'
--- lib/lp/archivepublisher/tests/apt-data/Packages 2013-09-30 01:08:01 +0000
+++ lib/lp/archivepublisher/tests/apt-data/Packages 2014-11-24 16:22:42 +0000
@@ -10,6 +10,7 @@
10MD5sum: 390074949d9533c4cf6774b9891306d010MD5sum: 390074949d9533c4cf6774b9891306d0
11SHA1: 1beb6c7f6be8d5b9d86335a0a939b1b49aec9aa911SHA1: 1beb6c7f6be8d5b9d86335a0a939b1b49aec9aa9
12SHA256: d652be5856066b3f5bb8df43e43199ee480aa65a1ccf8e78be4178a824c493ce12SHA256: d652be5856066b3f5bb8df43e43199ee480aa65a1ccf8e78be4178a824c493ce
13SHA512: 51a3a466a70bb447b1dd2cecd35ff9184ce89f8785d6783dae286d7e03ce8cd4bb72af0a61c294469e683e003ecb4c833ab45ed98102ad8020d9f9dc7ac82909
13Description: A tiny test package.14Description: A tiny test package.
14 Doesn't really do anything at all.15 Doesn't really do anything at all.
15Bugs: https://bugs.launchpad.net/ubuntu/+filebug16Bugs: https://bugs.launchpad.net/ubuntu/+filebug
1617
=== modified file 'lib/lp/archivepublisher/tests/apt-data/Sources'
--- lib/lp/archivepublisher/tests/apt-data/Sources 2013-09-30 01:08:01 +0000
+++ lib/lp/archivepublisher/tests/apt-data/Sources 2014-11-24 16:22:42 +0000
@@ -14,4 +14,13 @@
14 63a97b775d908be8426e8891e582f1c2 485 tiny_0.1.tar.gz14 63a97b775d908be8426e8891e582f1c2 485 tiny_0.1.tar.gz
15Package-List: 15Package-List:
16 tiny deb devel extra16 tiny deb devel extra
17Checksums-Sha1:
18 0528aa847dfd802bc788320f906f846b4931b840 444 tiny_0.1.dsc
19 d19603504f4c5c347dd6871d03bf232c7d54516a 485 tiny_0.1.tar.gz
20Checksums-Sha256:
21 4b21ba373193932f1e72359d765fe26f2c991f25a0ec3ad72d209a5fe81823f3 444 tiny_0.1.dsc
22 8a4a42063805dc1f9ee52b201b58da7c4aa594d6ad916673827320458bf0d9b2 485 tiny_0.1.tar.gz
23Checksums-Sha512:
24 9ec0fb83923f67e7a55fde5b1bc323e950cdf710e676d5b69486e8c3b1afe63b137e7f7bdcdd2e10f080d75de40cff162857dfafb455e23ccfd52c4b1a1c7f5e 444 tiny_0.1.dsc
25 7c1502d6709c2dbed18fa7ab6cf485321c46f44467745101ef1230413840378dadfb8f361d72a1df12d927308a77938914b166921e77258c3d3471c4650aa9b1 485 tiny_0.1.tar.gz
1726
1827
=== modified file 'lib/lp/archivepublisher/tests/test_ftparchive.py'
--- lib/lp/archivepublisher/tests/test_ftparchive.py 2014-01-17 03:21:05 +0000
+++ lib/lp/archivepublisher/tests/test_ftparchive.py 2014-11-24 16:22:42 +0000
@@ -43,18 +43,6 @@
43 )43 )
4444
4545
46def sanitize_apt_ftparchive_Sources_output(text):
47 # XXX: maxb 2010-04-15 bug=563503: Filter Checksums-* stanzas out of
48 # apt-ftparchive Sources file content, such that the output of lucid
49 # apt-ftparchive is the same as on karmic.
50 return re.subn(r'(?sm)^Checksums-.*?(?=^[^ ])', '', text)[0]
51
52
53def skip_sha512(text):
54 """Ignore SHA512 lines, which are present only in newer distroseries."""
55 return re.sub('SHA512: [0-9a-f]*\n', '', text)
56
57
58class SamplePublisher:46class SamplePublisher:
59 """Publisher emulation test class."""47 """Publisher emulation test class."""
6048
@@ -110,15 +98,13 @@
110 super(TestFTPArchive, self).tearDown()98 super(TestFTPArchive, self).tearDown()
111 shutil.rmtree(self._config.distroroot)99 shutil.rmtree(self._config.distroroot)
112100
113 def _verifyFile(self, filename, directory, output_filter=None):101 def _verifyFile(self, filename, directory):
114 """Compare byte-to-byte the given file and the respective sample.102 """Compare byte-to-byte the given file and the respective sample.
115103
116 It's a poor way of testing files generated by apt-ftparchive.104 It's a poor way of testing files generated by apt-ftparchive.
117 """105 """
118 result_path = os.path.join(directory, filename)106 result_path = os.path.join(directory, filename)
119 result_text = open(result_path).read()107 result_text = open(result_path).read()
120 if output_filter is not None:
121 result_text = output_filter(result_text)
122 sample_path = os.path.join(self._sampledir, filename)108 sample_path = os.path.join(self._sampledir, filename)
123 sample_text = open(sample_path).read()109 sample_text = open(sample_path).read()
124 # When the comparison between the sample text and the generated text110 # When the comparison between the sample text and the generated text
@@ -451,15 +437,13 @@
451 # regressions.437 # regressions.
452 fa.runApt(apt_conf)438 fa.runApt(apt_conf)
453 self._verifyFile("Packages",439 self._verifyFile("Packages",
454 os.path.join(self._distsdir, "hoary-test", "main", "binary-i386"),440 os.path.join(self._distsdir, "hoary-test", "main", "binary-i386"))
455 skip_sha512)
456 self._verifyEmpty(441 self._verifyEmpty(
457 os.path.join(442 os.path.join(
458 self._distsdir, "hoary-test", "main", "debian-installer",443 self._distsdir, "hoary-test", "main", "debian-installer",
459 "binary-i386", "Packages"))444 "binary-i386", "Packages"))
460 self._verifyFile("Sources",445 self._verifyFile("Sources",
461 os.path.join(self._distsdir, "hoary-test", "main", "source"),446 os.path.join(self._distsdir, "hoary-test", "main", "source"))
462 sanitize_apt_ftparchive_Sources_output)
463447
464 # XXX cprov 2007-03-21: see above, byte-to-byte configuration448 # XXX cprov 2007-03-21: see above, byte-to-byte configuration
465 # comparing is weak.449 # comparing is weak.
466450
=== modified file 'lib/lp/soyuz/doc/soyuz-upload.txt'
--- lib/lp/soyuz/doc/soyuz-upload.txt 2014-08-05 10:34:11 +0000
+++ lib/lp/soyuz/doc/soyuz-upload.txt 2014-11-24 16:22:42 +0000
@@ -467,8 +467,6 @@
467 >>> sources = open(467 >>> sources = open(
468 ... "/var/tmp/archive/ubuntutest/dists/breezy-autotest/universe/source"468 ... "/var/tmp/archive/ubuntutest/dists/breezy-autotest/universe/source"
469 ... "/Sources").read()469 ... "/Sources").read()
470 >>> import re
471 >>> sources = re.subn(r'(?sm)^Checksums-.*?(?=^[^ ])', '', sources)[0]
472 >>> print sources + '\nEND'470 >>> print sources + '\nEND'
473 Package: etherwake471 Package: etherwake
474 Binary: etherwake472 Binary: etherwake
@@ -484,14 +482,22 @@
484 f13711c5b8261fbb77b43ae0e8ba9360 566 etherwake_1.08-1.dsc482 f13711c5b8261fbb77b43ae0e8ba9360 566 etherwake_1.08-1.dsc
485 c2dc10f98bac012b900fd0b46721fc80 4455 etherwake_1.08.orig.tar.gz483 c2dc10f98bac012b900fd0b46721fc80 4455 etherwake_1.08.orig.tar.gz
486 95c1e89e3ad7bc8740793bdf7aeb7334 4145 etherwake_1.08-1.diff.gz484 95c1e89e3ad7bc8740793bdf7aeb7334 4145 etherwake_1.08-1.diff.gz
485 Checksums-Sha1:
486 2ddcdc87ab3dc35d5ce8232b0cc76bad8242725f 566 etherwake_1.08-1.dsc
487 4d8aa805cf262a613a48597e3638054dae421048 4455 etherwake_1.08.orig.tar.gz
488 f0ec9827c3ce66c0e1ea2c2f100ec144cb26b264 4145 etherwake_1.08-1.diff.gz
489 Checksums-Sha256:
490 0077eb18c0c02e931021e523ae3ae307731726f7b00736f66139fffa7181a915 566 etherwake_1.08-1.dsc
491 e309f8a45cab2d9a955efee5423b052bc040df1e9a9b85893682ab8647264495 4455 etherwake_1.08.orig.tar.gz
492 330e7f515d2da923d83131a1fbb5868adc4633e98a35d7b0e1787da46b63ffac 4145 etherwake_1.08-1.diff.gz
493 Checksums-Sha512:
494 51216a36b2ab6fde6ae04d5bcb0b7cefa9a18eb4b2b11552ca8f3abde928159e93729f30c6079e913078e966817368a6095de2cb4239676a3d6ed5d49d9de699 566 etherwake_1.08-1.dsc
495 6ab88a579ae3fdbbe0f1904712a3a42fab98fa586c3718243d2380f3cb021158c228312001b0685a77dc7171b0307d591ad971a82cd1ccd3511135b23d95ee21 4455 etherwake_1.08.orig.tar.gz
496 814074aa8349936fbec84b3ee703788159a085f0ce4a5e35d2dbef617e1c3c6e60818d155772d47b58e0823ed4bc9af29136f64eac8d643a833660e537145cb1 4145 etherwake_1.08-1.diff.gz
487 <BLANKLINE>497 <BLANKLINE>
488 <BLANKLINE>498 <BLANKLINE>
489 END499 END
490500
491# XXX: maxb 2010-04-15 bug=563503
492# The regex munging above can be removed once the tests no longer need to pass
493# on Karmic and earlier.
494
495Now we invoke changeOverride on just published etherwake, moving it to501Now we invoke changeOverride on just published etherwake, moving it to
496component 'multiverse'.502component 'multiverse'.
497503