Merge lp:~cjwatson/launchpad/xz-indexes into lp:launchpad

Proposed by Colin Watson on 2016-02-05
Status: Merged
Merged at revision: 17920
Proposed branch: lp:~cjwatson/launchpad/xz-indexes
Merge into: lp:launchpad
Prerequisite: lp:~cjwatson/launchpad/distroseries-publishing-options-2
Diff against target: 1108 lines (+318/-50)
15 files modified
lib/lp/archivepublisher/model/ftparchive.py (+19/-6)
lib/lp/archivepublisher/publishing.py (+7/-5)
lib/lp/archivepublisher/tests/apt-data/apt.conf (+90/-3)
lib/lp/archivepublisher/tests/apt-data/apt_conf_single_empty_suite_test (+15/-3)
lib/lp/archivepublisher/tests/test_ftparchive.py (+1/-1)
lib/lp/archivepublisher/tests/test_publisher.py (+44/-8)
lib/lp/archivepublisher/tests/test_repositoryindexfile.py (+41/-10)
lib/lp/archivepublisher/utils.py (+32/-10)
lib/lp/registry/configure.zcml (+2/-1)
lib/lp/registry/interfaces/distroseries.py (+10/-1)
lib/lp/registry/model/distroseries.py (+25/-0)
lib/lp/registry/tests/test_distroseries.py (+15/-1)
lib/lp/soyuz/enums.py (+15/-1)
setup.py (+1/-0)
versions.cfg (+1/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/xz-indexes
Reviewer Review Type Date Requested Status
William Grant code 2016-02-05 Approve on 2016-02-05
Review via email: mp+285238@code.launchpad.net

Commit message

Make index compression types configurable per-series, and add xz support.

Description of the change

Make index compression types configurable per-series, and add xz support.

I have amd64 and i386 eggs of backports.lzma which I can check into lp-source-dependencies before landing this.

To post a comment you must log in.
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/model/ftparchive.py'
2--- lib/lp/archivepublisher/model/ftparchive.py 2016-02-04 19:46:52 +0000
3+++ lib/lp/archivepublisher/model/ftparchive.py 2016-02-05 20:34:36 +0000
4@@ -27,6 +27,7 @@
5 from lp.services.osutils import write_file
6 from lp.soyuz.enums import (
7 BinaryPackageFormat,
8+ IndexCompressionType,
9 PackagePublishingStatus,
10 )
11 from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild
12@@ -67,10 +68,7 @@
13
14 Default
15 {
16- Packages::Compress "gzip bzip2";
17- Sources::Compress "gzip bzip2";
18 Contents::Compress "gzip";
19- Translation::Compress "gzip bzip2";
20 DeLinkLimit 0;
21 MaxContentsChange 12000;
22 FileMode 0644;
23@@ -95,6 +93,9 @@
24 SrcOverride "override.%(DISTRORELEASE)s.$(SECTION).src";
25 %(HIDEEXTRA)sExtraOverride "override.%(DISTRORELEASE)s.extra.$(SECTION)";
26 Packages::Extensions "%(EXTENSIONS)s";
27+ Packages::Compress "%(COMPRESSORS)s";
28+ Sources::Compress "%(COMPRESSORS)s";
29+ Translation::Compress "%(COMPRESSORS)s";
30 BinCacheDB "packages%(CACHEINSERT)s-$(ARCH).db";
31 SrcCacheDB "sources%(CACHEINSERT)s.db";
32 Contents " ";
33@@ -115,6 +116,13 @@
34
35 CLEANUP_FREQUENCY = 60 * 60 * 24
36
37+COMPRESSOR_TO_CONFIG = {
38+ IndexCompressionType.UNCOMPRESSED: '.',
39+ IndexCompressionType.GZIP: 'gzip',
40+ IndexCompressionType.BZIP2: 'bzip2',
41+ IndexCompressionType.XZ: 'xz',
42+ }
43+
44
45 class AptFTPArchiveFailure(Exception):
46 """Failure while running apt-ftparchive."""
47@@ -743,7 +751,8 @@
48
49 self.writeAptConfig(
50 apt_config, suite, comps, archs,
51- distroseries.include_long_descriptions)
52+ distroseries.include_long_descriptions,
53+ distroseries.index_compressors)
54
55 # XXX: 2006-08-24 kiko: Why do we do this directory creation here?
56 for comp in comps:
57@@ -759,8 +768,10 @@
58 component_path, subcomp, "binary-" + arch))
59
60 def writeAptConfig(self, apt_config, suite, comps, archs,
61- include_long_descriptions):
62+ include_long_descriptions, index_compressors):
63 self.log.debug("Generating apt config for %s" % suite)
64+ compressors = " ".join(
65+ COMPRESSOR_TO_CONFIG[c] for c in index_compressors)
66 apt_config.write(STANZA_TEMPLATE % {
67 "LISTPATH": self._config.overrideroot,
68 "DISTRORELEASE": suite,
69@@ -769,6 +780,7 @@
70 "ARCHITECTURES": " ".join(archs + ["source"]),
71 "SECTIONS": " ".join(comps),
72 "EXTENSIONS": ".deb",
73+ "COMPRESSORS": compressors,
74 "CACHEINSERT": "",
75 "DISTS": os.path.basename(self._config.distsroot),
76 "HIDEEXTRA": "",
77@@ -787,6 +799,7 @@
78 "ARCHITECTURES": " ".join(archs),
79 "SECTIONS": subcomp,
80 "EXTENSIONS": '.%s' % SUBCOMPONENT_TO_EXT[subcomp],
81+ "COMPRESSORS": compressors,
82 "CACHEINSERT": "-%s" % subcomp,
83 "DISTS": os.path.basename(self._config.distsroot),
84 "HIDEEXTRA": "// ",
85@@ -828,7 +841,7 @@
86 comps.add(comp.name)
87 self.writeAptConfig(
88 apt_config, "nonexistent-suite", sorted(comps), sorted(archs),
89- True)
90+ True, [IndexCompressionType.UNCOMPRESSED])
91
92 with open(apt_config_filename, "w") as fp:
93 fp.write(apt_config.getvalue())
94
95=== modified file 'lib/lp/archivepublisher/publishing.py'
96--- lib/lp/archivepublisher/publishing.py 2016-02-05 02:12:06 +0000
97+++ lib/lp/archivepublisher/publishing.py 2016-02-05 20:34:36 +0000
98@@ -118,13 +118,15 @@
99 return path[:-len('.gz')]
100 elif path.endswith('.bz2'):
101 return path[:-len('.bz2')]
102+ elif path.endswith('.xz'):
103+ return path[:-len('.xz')]
104 else:
105 return path
106
107
108 def get_suffixed_indices(path):
109 """Return a set of paths to compressed copies of the given index."""
110- return set([path + suffix for suffix in ('', '.gz', '.bz2')])
111+ return set([path + suffix for suffix in ('', '.gz', '.bz2', '.xz')])
112
113
114 def _getDiskPool(pubconf, log):
115@@ -685,11 +687,11 @@
116 translation_en = RepositoryIndexFile(
117 os.path.join(self._config.distsroot, suite_name,
118 component.name, "i18n", "Translation-en"),
119- self._config.temproot)
120+ self._config.temproot, distroseries.index_compressors)
121
122 source_index = RepositoryIndexFile(
123 get_sources_path(self._config, suite_name, component),
124- self._config.temproot)
125+ self._config.temproot, distroseries.index_compressors)
126
127 for spp in distroseries.getSourcePackagePublishing(
128 pocket, component, self.archive):
129@@ -710,13 +712,13 @@
130 indices = {}
131 indices[None] = RepositoryIndexFile(
132 get_packages_path(self._config, suite_name, component, arch),
133- self._config.temproot)
134+ self._config.temproot, distroseries.index_compressors)
135
136 for subcomp in self.subcomponents:
137 indices[subcomp] = RepositoryIndexFile(
138 get_packages_path(
139 self._config, suite_name, component, arch, subcomp),
140- self._config.temproot)
141+ self._config.temproot, distroseries.index_compressors)
142
143 for bpp in distroseries.getBinaryPackagePublishing(
144 arch.architecturetag, pocket, component, self.archive):
145
146=== modified file 'lib/lp/archivepublisher/tests/apt-data/apt.conf'
147--- lib/lp/archivepublisher/tests/apt-data/apt.conf 2016-02-04 19:46:52 +0000
148+++ lib/lp/archivepublisher/tests/apt-data/apt.conf 2016-02-05 20:34:36 +0000
149@@ -8,10 +8,7 @@
150
151 Default
152 {
153- Packages::Compress "gzip bzip2";
154- Sources::Compress "gzip bzip2";
155 Contents::Compress "gzip";
156- Translation::Compress "gzip bzip2";
157 DeLinkLimit 0;
158 MaxContentsChange 12000;
159 FileMode 0644;
160@@ -34,6 +31,9 @@
161 SrcOverride "override.hoary-test.$(SECTION).src";
162 ExtraOverride "override.hoary-test.extra.$(SECTION)";
163 Packages::Extensions ".deb";
164+ Packages::Compress "gzip bzip2";
165+ Sources::Compress "gzip bzip2";
166+ Translation::Compress "gzip bzip2";
167 BinCacheDB "packages-$(ARCH).db";
168 SrcCacheDB "sources.db";
169 Contents " ";
170@@ -51,6 +51,9 @@
171 SrcOverride "override.hoary-test.main.$(SECTION).src";
172 // ExtraOverride "override.hoary-test.main.extra.$(SECTION)";
173 Packages::Extensions ".udeb";
174+ Packages::Compress "gzip bzip2";
175+ Sources::Compress "gzip bzip2";
176+ Translation::Compress "gzip bzip2";
177 BinCacheDB "packages-debian-installer-$(ARCH).db";
178 SrcCacheDB "sources-debian-installer.db";
179 Contents " ";
180@@ -68,6 +71,9 @@
181 SrcOverride "override.hoary-test.restricted.$(SECTION).src";
182 // ExtraOverride "override.hoary-test.restricted.extra.$(SECTION)";
183 Packages::Extensions ".udeb";
184+ Packages::Compress "gzip bzip2";
185+ Sources::Compress "gzip bzip2";
186+ Translation::Compress "gzip bzip2";
187 BinCacheDB "packages-debian-installer-$(ARCH).db";
188 SrcCacheDB "sources-debian-installer.db";
189 Contents " ";
190@@ -85,6 +91,9 @@
191 SrcOverride "override.hoary-test.universe.$(SECTION).src";
192 // ExtraOverride "override.hoary-test.universe.extra.$(SECTION)";
193 Packages::Extensions ".udeb";
194+ Packages::Compress "gzip bzip2";
195+ Sources::Compress "gzip bzip2";
196+ Translation::Compress "gzip bzip2";
197 BinCacheDB "packages-debian-installer-$(ARCH).db";
198 SrcCacheDB "sources-debian-installer.db";
199 Contents " ";
200@@ -102,6 +111,9 @@
201 SrcOverride "override.hoary-test.multiverse.$(SECTION).src";
202 // ExtraOverride "override.hoary-test.multiverse.extra.$(SECTION)";
203 Packages::Extensions ".udeb";
204+ Packages::Compress "gzip bzip2";
205+ Sources::Compress "gzip bzip2";
206+ Translation::Compress "gzip bzip2";
207 BinCacheDB "packages-debian-installer-$(ARCH).db";
208 SrcCacheDB "sources-debian-installer.db";
209 Contents " ";
210@@ -119,6 +131,9 @@
211 SrcOverride "override.hoary-test-security.$(SECTION).src";
212 ExtraOverride "override.hoary-test-security.extra.$(SECTION)";
213 Packages::Extensions ".deb";
214+ Packages::Compress "gzip bzip2";
215+ Sources::Compress "gzip bzip2";
216+ Translation::Compress "gzip bzip2";
217 BinCacheDB "packages-$(ARCH).db";
218 SrcCacheDB "sources.db";
219 Contents " ";
220@@ -136,6 +151,9 @@
221 SrcOverride "override.hoary-test-security.main.$(SECTION).src";
222 // ExtraOverride "override.hoary-test-security.main.extra.$(SECTION)";
223 Packages::Extensions ".udeb";
224+ Packages::Compress "gzip bzip2";
225+ Sources::Compress "gzip bzip2";
226+ Translation::Compress "gzip bzip2";
227 BinCacheDB "packages-debian-installer-$(ARCH).db";
228 SrcCacheDB "sources-debian-installer.db";
229 Contents " ";
230@@ -153,6 +171,9 @@
231 SrcOverride "override.hoary-test-security.restricted.$(SECTION).src";
232 // ExtraOverride "override.hoary-test-security.restricted.extra.$(SECTION)";
233 Packages::Extensions ".udeb";
234+ Packages::Compress "gzip bzip2";
235+ Sources::Compress "gzip bzip2";
236+ Translation::Compress "gzip bzip2";
237 BinCacheDB "packages-debian-installer-$(ARCH).db";
238 SrcCacheDB "sources-debian-installer.db";
239 Contents " ";
240@@ -170,6 +191,9 @@
241 SrcOverride "override.hoary-test-security.universe.$(SECTION).src";
242 // ExtraOverride "override.hoary-test-security.universe.extra.$(SECTION)";
243 Packages::Extensions ".udeb";
244+ Packages::Compress "gzip bzip2";
245+ Sources::Compress "gzip bzip2";
246+ Translation::Compress "gzip bzip2";
247 BinCacheDB "packages-debian-installer-$(ARCH).db";
248 SrcCacheDB "sources-debian-installer.db";
249 Contents " ";
250@@ -187,6 +211,9 @@
251 SrcOverride "override.hoary-test-security.multiverse.$(SECTION).src";
252 // ExtraOverride "override.hoary-test-security.multiverse.extra.$(SECTION)";
253 Packages::Extensions ".udeb";
254+ Packages::Compress "gzip bzip2";
255+ Sources::Compress "gzip bzip2";
256+ Translation::Compress "gzip bzip2";
257 BinCacheDB "packages-debian-installer-$(ARCH).db";
258 SrcCacheDB "sources-debian-installer.db";
259 Contents " ";
260@@ -204,6 +231,9 @@
261 SrcOverride "override.hoary-test-updates.$(SECTION).src";
262 ExtraOverride "override.hoary-test-updates.extra.$(SECTION)";
263 Packages::Extensions ".deb";
264+ Packages::Compress "gzip bzip2";
265+ Sources::Compress "gzip bzip2";
266+ Translation::Compress "gzip bzip2";
267 BinCacheDB "packages-$(ARCH).db";
268 SrcCacheDB "sources.db";
269 Contents " ";
270@@ -221,6 +251,9 @@
271 SrcOverride "override.hoary-test-updates.main.$(SECTION).src";
272 // ExtraOverride "override.hoary-test-updates.main.extra.$(SECTION)";
273 Packages::Extensions ".udeb";
274+ Packages::Compress "gzip bzip2";
275+ Sources::Compress "gzip bzip2";
276+ Translation::Compress "gzip bzip2";
277 BinCacheDB "packages-debian-installer-$(ARCH).db";
278 SrcCacheDB "sources-debian-installer.db";
279 Contents " ";
280@@ -238,6 +271,9 @@
281 SrcOverride "override.hoary-test-updates.restricted.$(SECTION).src";
282 // ExtraOverride "override.hoary-test-updates.restricted.extra.$(SECTION)";
283 Packages::Extensions ".udeb";
284+ Packages::Compress "gzip bzip2";
285+ Sources::Compress "gzip bzip2";
286+ Translation::Compress "gzip bzip2";
287 BinCacheDB "packages-debian-installer-$(ARCH).db";
288 SrcCacheDB "sources-debian-installer.db";
289 Contents " ";
290@@ -255,6 +291,9 @@
291 SrcOverride "override.hoary-test-updates.universe.$(SECTION).src";
292 // ExtraOverride "override.hoary-test-updates.universe.extra.$(SECTION)";
293 Packages::Extensions ".udeb";
294+ Packages::Compress "gzip bzip2";
295+ Sources::Compress "gzip bzip2";
296+ Translation::Compress "gzip bzip2";
297 BinCacheDB "packages-debian-installer-$(ARCH).db";
298 SrcCacheDB "sources-debian-installer.db";
299 Contents " ";
300@@ -272,6 +311,9 @@
301 SrcOverride "override.hoary-test-updates.multiverse.$(SECTION).src";
302 // ExtraOverride "override.hoary-test-updates.multiverse.extra.$(SECTION)";
303 Packages::Extensions ".udeb";
304+ Packages::Compress "gzip bzip2";
305+ Sources::Compress "gzip bzip2";
306+ Translation::Compress "gzip bzip2";
307 BinCacheDB "packages-debian-installer-$(ARCH).db";
308 SrcCacheDB "sources-debian-installer.db";
309 Contents " ";
310@@ -289,6 +331,9 @@
311 SrcOverride "override.hoary-test-proposed.$(SECTION).src";
312 ExtraOverride "override.hoary-test-proposed.extra.$(SECTION)";
313 Packages::Extensions ".deb";
314+ Packages::Compress "gzip bzip2";
315+ Sources::Compress "gzip bzip2";
316+ Translation::Compress "gzip bzip2";
317 BinCacheDB "packages-$(ARCH).db";
318 SrcCacheDB "sources.db";
319 Contents " ";
320@@ -306,6 +351,9 @@
321 SrcOverride "override.hoary-test-proposed.main.$(SECTION).src";
322 // ExtraOverride "override.hoary-test-proposed.main.extra.$(SECTION)";
323 Packages::Extensions ".udeb";
324+ Packages::Compress "gzip bzip2";
325+ Sources::Compress "gzip bzip2";
326+ Translation::Compress "gzip bzip2";
327 BinCacheDB "packages-debian-installer-$(ARCH).db";
328 SrcCacheDB "sources-debian-installer.db";
329 Contents " ";
330@@ -323,6 +371,9 @@
331 SrcOverride "override.hoary-test-proposed.restricted.$(SECTION).src";
332 // ExtraOverride "override.hoary-test-proposed.restricted.extra.$(SECTION)";
333 Packages::Extensions ".udeb";
334+ Packages::Compress "gzip bzip2";
335+ Sources::Compress "gzip bzip2";
336+ Translation::Compress "gzip bzip2";
337 BinCacheDB "packages-debian-installer-$(ARCH).db";
338 SrcCacheDB "sources-debian-installer.db";
339 Contents " ";
340@@ -340,6 +391,9 @@
341 SrcOverride "override.hoary-test-proposed.universe.$(SECTION).src";
342 // ExtraOverride "override.hoary-test-proposed.universe.extra.$(SECTION)";
343 Packages::Extensions ".udeb";
344+ Packages::Compress "gzip bzip2";
345+ Sources::Compress "gzip bzip2";
346+ Translation::Compress "gzip bzip2";
347 BinCacheDB "packages-debian-installer-$(ARCH).db";
348 SrcCacheDB "sources-debian-installer.db";
349 Contents " ";
350@@ -357,6 +411,9 @@
351 SrcOverride "override.hoary-test-proposed.multiverse.$(SECTION).src";
352 // ExtraOverride "override.hoary-test-proposed.multiverse.extra.$(SECTION)";
353 Packages::Extensions ".udeb";
354+ Packages::Compress "gzip bzip2";
355+ Sources::Compress "gzip bzip2";
356+ Translation::Compress "gzip bzip2";
357 BinCacheDB "packages-debian-installer-$(ARCH).db";
358 SrcCacheDB "sources-debian-installer.db";
359 Contents " ";
360@@ -374,6 +431,9 @@
361 SrcOverride "override.hoary-test-backports.$(SECTION).src";
362 ExtraOverride "override.hoary-test-backports.extra.$(SECTION)";
363 Packages::Extensions ".deb";
364+ Packages::Compress "gzip bzip2";
365+ Sources::Compress "gzip bzip2";
366+ Translation::Compress "gzip bzip2";
367 BinCacheDB "packages-$(ARCH).db";
368 SrcCacheDB "sources.db";
369 Contents " ";
370@@ -391,6 +451,9 @@
371 SrcOverride "override.hoary-test-backports.main.$(SECTION).src";
372 // ExtraOverride "override.hoary-test-backports.main.extra.$(SECTION)";
373 Packages::Extensions ".udeb";
374+ Packages::Compress "gzip bzip2";
375+ Sources::Compress "gzip bzip2";
376+ Translation::Compress "gzip bzip2";
377 BinCacheDB "packages-debian-installer-$(ARCH).db";
378 SrcCacheDB "sources-debian-installer.db";
379 Contents " ";
380@@ -408,6 +471,9 @@
381 SrcOverride "override.hoary-test-backports.restricted.$(SECTION).src";
382 // ExtraOverride "override.hoary-test-backports.restricted.extra.$(SECTION)";
383 Packages::Extensions ".udeb";
384+ Packages::Compress "gzip bzip2";
385+ Sources::Compress "gzip bzip2";
386+ Translation::Compress "gzip bzip2";
387 BinCacheDB "packages-debian-installer-$(ARCH).db";
388 SrcCacheDB "sources-debian-installer.db";
389 Contents " ";
390@@ -425,6 +491,9 @@
391 SrcOverride "override.hoary-test-backports.universe.$(SECTION).src";
392 // ExtraOverride "override.hoary-test-backports.universe.extra.$(SECTION)";
393 Packages::Extensions ".udeb";
394+ Packages::Compress "gzip bzip2";
395+ Sources::Compress "gzip bzip2";
396+ Translation::Compress "gzip bzip2";
397 BinCacheDB "packages-debian-installer-$(ARCH).db";
398 SrcCacheDB "sources-debian-installer.db";
399 Contents " ";
400@@ -442,6 +511,9 @@
401 SrcOverride "override.hoary-test-backports.multiverse.$(SECTION).src";
402 // ExtraOverride "override.hoary-test-backports.multiverse.extra.$(SECTION)";
403 Packages::Extensions ".udeb";
404+ Packages::Compress "gzip bzip2";
405+ Sources::Compress "gzip bzip2";
406+ Translation::Compress "gzip bzip2";
407 BinCacheDB "packages-debian-installer-$(ARCH).db";
408 SrcCacheDB "sources-debian-installer.db";
409 Contents " ";
410@@ -459,6 +531,9 @@
411 SrcOverride "override.breezy-autotest.$(SECTION).src";
412 ExtraOverride "override.breezy-autotest.extra.$(SECTION)";
413 Packages::Extensions ".deb";
414+ Packages::Compress "gzip bzip2";
415+ Sources::Compress "gzip bzip2";
416+ Translation::Compress "gzip bzip2";
417 BinCacheDB "packages-$(ARCH).db";
418 SrcCacheDB "sources.db";
419 Contents " ";
420@@ -476,6 +551,9 @@
421 SrcOverride "override.breezy-autotest-security.$(SECTION).src";
422 ExtraOverride "override.breezy-autotest-security.extra.$(SECTION)";
423 Packages::Extensions ".deb";
424+ Packages::Compress "gzip bzip2";
425+ Sources::Compress "gzip bzip2";
426+ Translation::Compress "gzip bzip2";
427 BinCacheDB "packages-$(ARCH).db";
428 SrcCacheDB "sources.db";
429 Contents " ";
430@@ -493,6 +571,9 @@
431 SrcOverride "override.breezy-autotest-updates.$(SECTION).src";
432 ExtraOverride "override.breezy-autotest-updates.extra.$(SECTION)";
433 Packages::Extensions ".deb";
434+ Packages::Compress "gzip bzip2";
435+ Sources::Compress "gzip bzip2";
436+ Translation::Compress "gzip bzip2";
437 BinCacheDB "packages-$(ARCH).db";
438 SrcCacheDB "sources.db";
439 Contents " ";
440@@ -510,6 +591,9 @@
441 SrcOverride "override.breezy-autotest-proposed.$(SECTION).src";
442 ExtraOverride "override.breezy-autotest-proposed.extra.$(SECTION)";
443 Packages::Extensions ".deb";
444+ Packages::Compress "gzip bzip2";
445+ Sources::Compress "gzip bzip2";
446+ Translation::Compress "gzip bzip2";
447 BinCacheDB "packages-$(ARCH).db";
448 SrcCacheDB "sources.db";
449 Contents " ";
450@@ -527,6 +611,9 @@
451 SrcOverride "override.breezy-autotest-backports.$(SECTION).src";
452 ExtraOverride "override.breezy-autotest-backports.extra.$(SECTION)";
453 Packages::Extensions ".deb";
454+ Packages::Compress "gzip bzip2";
455+ Sources::Compress "gzip bzip2";
456+ Translation::Compress "gzip bzip2";
457 BinCacheDB "packages-$(ARCH).db";
458 SrcCacheDB "sources.db";
459 Contents " ";
460
461=== modified file 'lib/lp/archivepublisher/tests/apt-data/apt_conf_single_empty_suite_test'
462--- lib/lp/archivepublisher/tests/apt-data/apt_conf_single_empty_suite_test 2016-02-04 19:46:52 +0000
463+++ lib/lp/archivepublisher/tests/apt-data/apt_conf_single_empty_suite_test 2016-02-05 20:34:36 +0000
464@@ -8,10 +8,7 @@
465
466 Default
467 {
468- Packages::Compress "gzip bzip2";
469- Sources::Compress "gzip bzip2";
470 Contents::Compress "gzip";
471- Translation::Compress "gzip bzip2";
472 DeLinkLimit 0;
473 MaxContentsChange 12000;
474 FileMode 0644;
475@@ -34,6 +31,9 @@
476 SrcOverride "override.hoary-test-updates.$(SECTION).src";
477 ExtraOverride "override.hoary-test-updates.extra.$(SECTION)";
478 Packages::Extensions ".deb";
479+ Packages::Compress "gzip bzip2";
480+ Sources::Compress "gzip bzip2";
481+ Translation::Compress "gzip bzip2";
482 BinCacheDB "packages-$(ARCH).db";
483 SrcCacheDB "sources.db";
484 Contents " ";
485@@ -51,6 +51,9 @@
486 SrcOverride "override.hoary-test-updates.main.$(SECTION).src";
487 // ExtraOverride "override.hoary-test-updates.main.extra.$(SECTION)";
488 Packages::Extensions ".udeb";
489+ Packages::Compress "gzip bzip2";
490+ Sources::Compress "gzip bzip2";
491+ Translation::Compress "gzip bzip2";
492 BinCacheDB "packages-debian-installer-$(ARCH).db";
493 SrcCacheDB "sources-debian-installer.db";
494 Contents " ";
495@@ -68,6 +71,9 @@
496 SrcOverride "override.hoary-test-updates.restricted.$(SECTION).src";
497 // ExtraOverride "override.hoary-test-updates.restricted.extra.$(SECTION)";
498 Packages::Extensions ".udeb";
499+ Packages::Compress "gzip bzip2";
500+ Sources::Compress "gzip bzip2";
501+ Translation::Compress "gzip bzip2";
502 BinCacheDB "packages-debian-installer-$(ARCH).db";
503 SrcCacheDB "sources-debian-installer.db";
504 Contents " ";
505@@ -85,6 +91,9 @@
506 SrcOverride "override.hoary-test-updates.universe.$(SECTION).src";
507 // ExtraOverride "override.hoary-test-updates.universe.extra.$(SECTION)";
508 Packages::Extensions ".udeb";
509+ Packages::Compress "gzip bzip2";
510+ Sources::Compress "gzip bzip2";
511+ Translation::Compress "gzip bzip2";
512 BinCacheDB "packages-debian-installer-$(ARCH).db";
513 SrcCacheDB "sources-debian-installer.db";
514 Contents " ";
515@@ -102,6 +111,9 @@
516 SrcOverride "override.hoary-test-updates.multiverse.$(SECTION).src";
517 // ExtraOverride "override.hoary-test-updates.multiverse.extra.$(SECTION)";
518 Packages::Extensions ".udeb";
519+ Packages::Compress "gzip bzip2";
520+ Sources::Compress "gzip bzip2";
521+ Translation::Compress "gzip bzip2";
522 BinCacheDB "packages-debian-installer-$(ARCH).db";
523 SrcCacheDB "sources-debian-installer.db";
524 Contents " ";
525
526=== modified file 'lib/lp/archivepublisher/tests/test_ftparchive.py'
527--- lib/lp/archivepublisher/tests/test_ftparchive.py 2016-02-04 19:46:52 +0000
528+++ lib/lp/archivepublisher/tests/test_ftparchive.py 2016-02-05 20:34:36 +0000
529@@ -459,7 +459,7 @@
530 # Test that a publisher run now will generate an empty apt
531 # config and nothing else.
532 apt_conf = fa.generateConfig()
533- assert len(file(apt_conf).readlines()) == 25
534+ self.assertEqual(22, len(file(apt_conf).readlines()))
535
536 # XXX cprov 2007-03-21: see above, do not run a-f on dev machines.
537 fa.runApt(apt_conf)
538
539=== modified file 'lib/lp/archivepublisher/tests/test_publisher.py'
540--- lib/lp/archivepublisher/tests/test_publisher.py 2016-02-04 19:46:52 +0000
541+++ lib/lp/archivepublisher/tests/test_publisher.py 2016-02-05 20:34:36 +0000
542@@ -18,6 +18,10 @@
543 import time
544
545 from debian.deb822 import Release
546+try:
547+ import lzma
548+except ImportError:
549+ from backports import lzma
550 from testtools.matchers import ContainsAll
551 import transaction
552 from zope.component import getUtility
553@@ -56,6 +60,7 @@
554 ArchivePurpose,
555 ArchiveStatus,
556 BinaryPackageFormat,
557+ IndexCompressionType,
558 PackagePublishingStatus,
559 PackageUploadStatus,
560 )
561@@ -1014,11 +1019,10 @@
562 """Assert that the various compressed versions of a file are equal.
563
564 Check that the various versions of a compressed file, such as
565- Packages.gz/Packages.bz2 and Sources.gz/Sources.bz2, and bz2
566- variations, all have identical contents. The file paths are
567- relative to breezy-autotest/main under the archive_publisher's
568- configured dist root. 'breezy-autotest' is our test distroseries
569- name.
570+ Packages.{gz,bz2,xz} and Sources.{gz,bz2,xz} all have identical
571+ contents. The file paths are relative to breezy-autotest/main under
572+ the archive_publisher's configured dist root. 'breezy-autotest' is
573+ our test distroseries name.
574
575 The contents of the uncompressed file is returned as a list of lines
576 in the file.
577@@ -1033,6 +1037,8 @@
578 open_func = gzip.open
579 elif suffix == '.bz2':
580 open_func = bz2.BZ2File
581+ elif suffix == '.xz':
582+ open_func = lzma.LZMAFile
583 else:
584 open_func = open
585 with open_func(index_base_path + suffix) as index_file:
586@@ -1044,7 +1050,7 @@
587 return all_contents[0]
588
589 def setupPPAArchiveIndexTest(self, long_descriptions=True,
590- feature_flag=False):
591+ feature_flag=False, index_compressors=None):
592 # Setup for testPPAArchiveIndex tests
593 allowed_suites = []
594
595@@ -1082,10 +1088,12 @@
596 self.assertEqual('enabled', getFeatureFlag(
597 'soyuz.ppa.separate_long_descriptions'))
598
599+ ds = self.ubuntutest.getSeries('breezy-autotest')
600 if not long_descriptions:
601 # Make sure that NMAF generates i18n/Translation-en* files.
602- ds = self.ubuntutest.getSeries('breezy-autotest')
603 ds.include_long_descriptions = False
604+ if index_compressors is not None:
605+ ds.index_compressors = index_compressors
606
607 archive_publisher.A_publish(False)
608 self.layer.txn.commit()
609@@ -1218,6 +1226,8 @@
610 os.path.join(i18n_path, 'Translation-en.gz')))
611 self.assertFalse(os.path.exists(
612 os.path.join(i18n_path, 'Translation-en.bz2')))
613+ self.assertFalse(os.path.exists(
614+ os.path.join(i18n_path, 'Translation-en.xz')))
615
616 # remove PPA root
617 shutil.rmtree(config.personalpackagearchive.root)
618@@ -1237,6 +1247,8 @@
619 os.path.join(i18n_path, 'Translation-en.gz')))
620 self.assertFalse(os.path.exists(
621 os.path.join(i18n_path, 'Translation-en.bz2')))
622+ self.assertFalse(os.path.exists(
623+ os.path.join(i18n_path, 'Translation-en.xz')))
624
625 # remove PPA root
626 shutil.rmtree(config.personalpackagearchive.root)
627@@ -1401,10 +1413,32 @@
628 with open(release_path) as release_file:
629 content = release_file.read()
630 self.assertIn('main/i18n/Translation-en.bz2', content)
631+ self.assertIn('main/i18n/Translation-en.gz', content)
632
633 # remove PPA root
634 shutil.rmtree(config.personalpackagearchive.root)
635
636+ def testPPAArchiveIndexCompressors(self):
637+ # Archive index generation honours DistroSeries.index_compressors.
638+ archive_publisher = self.setupPPAArchiveIndexTest(
639+ long_descriptions=False, feature_flag=True,
640+ index_compressors=[
641+ IndexCompressionType.UNCOMPRESSED, IndexCompressionType.XZ])
642+ suite_path = os.path.join(
643+ archive_publisher._config.distsroot, 'breezy-autotest', 'main')
644+ for uncompressed_file_path in (
645+ os.path.join('source', 'Sources'),
646+ os.path.join('binary-i386', 'Packages'),
647+ os.path.join('debian-installer', 'binary-i386', 'Packages'),
648+ os.path.join('debug', 'binary-i386', 'Packages'),
649+ os.path.join('i18n', 'Translation-en'),
650+ ):
651+ for suffix in ('bz2', 'gz'):
652+ self.assertFalse(os.path.exists(os.path.join(
653+ suite_path, '%s.%s' % (uncompressed_file_path, suffix))))
654+ self._checkCompressedFiles(
655+ archive_publisher, uncompressed_file_path, ['.xz'])
656+
657 def checkDirtyPockets(self, publisher, expected):
658 """Check dirty_pockets contents of a given publisher."""
659 sorted_dirty_pockets = sorted(list(publisher.dirty_pockets))
660@@ -1768,6 +1802,7 @@
661 content = release_file.read()
662 for component in components:
663 self.assertIn(component + '/i18n/Translation-en.bz2', content)
664+ self.assertIn(component + '/i18n/Translation-en.gz', content)
665
666 def testReleaseFileForContents(self):
667 """Test Release file writing for Contents files."""
668@@ -1942,7 +1977,8 @@
669
670 # Write compressed versions of a zero-length Translation-en file.
671 translation_en_index = RepositoryIndexFile(
672- os.path.join(i18n_root, 'Translation-en'), self.config.temproot)
673+ os.path.join(i18n_root, 'Translation-en'), self.config.temproot,
674+ self.ubuntutest['breezy-autotest'].index_compressors)
675 translation_en_index.close()
676
677 all_files = set()
678
679=== modified file 'lib/lp/archivepublisher/tests/test_repositoryindexfile.py'
680--- lib/lp/archivepublisher/tests/test_repositoryindexfile.py 2016-02-04 19:46:52 +0000
681+++ lib/lp/archivepublisher/tests/test_repositoryindexfile.py 2016-02-05 20:34:36 +0000
682@@ -13,7 +13,13 @@
683 import tempfile
684 import unittest
685
686+try:
687+ import lzma
688+except ImportError:
689+ from backports import lzma
690+
691 from lp.archivepublisher.utils import RepositoryIndexFile
692+from lp.soyuz.enums import IndexCompressionType
693
694
695 class TestRepositoryArchiveIndex(unittest.TestCase):
696@@ -32,14 +38,20 @@
697 for path in [self.root, self.temp_root]:
698 shutil.rmtree(path)
699
700- def getRepoFile(self, filename):
701+ def getRepoFile(self, filename, compressors=None):
702 """Return a `RepositoryIndexFile` for the given filename.
703
704 The `RepositoryIndexFile` is created with the test 'root' and
705 'temp_root'.
706 """
707+ if compressors is None:
708+ compressors = [
709+ IndexCompressionType.GZIP,
710+ IndexCompressionType.BZIP2,
711+ IndexCompressionType.XZ,
712+ ]
713 return RepositoryIndexFile(
714- os.path.join(self.root, filename), self.temp_root)
715+ os.path.join(self.root, filename), self.temp_root, compressors)
716
717 def testWorkflow(self):
718 """`RepositoryIndexFile` workflow.
719@@ -58,15 +70,16 @@
720 repo_file = self.getRepoFile('boing')
721
722 self.assertEqual(0, len(os.listdir(self.root)))
723- self.assertEqual(2, len(os.listdir(self.temp_root)))
724+ self.assertEqual(3, len(os.listdir(self.temp_root)))
725
726 repo_file.close()
727
728- self.assertEqual(2, len(os.listdir(self.root)))
729+ self.assertEqual(3, len(os.listdir(self.root)))
730 self.assertEqual(0, len(os.listdir(self.temp_root)))
731
732 resulting_files = sorted(os.listdir(self.root))
733- self.assertEqual(['boing.bz2', 'boing.gz'], resulting_files)
734+ self.assertEqual(
735+ ['boing.bz2', 'boing.gz', 'boing.xz'], resulting_files)
736
737 for filename in resulting_files:
738 file_path = os.path.join(self.root, filename)
739@@ -89,10 +102,21 @@
740 gzip_content = gzip.open(os.path.join(self.root, 'boing.gz')).read()
741 bz2_content = bz2.decompress(
742 open(os.path.join(self.root, 'boing.bz2')).read())
743+ xz_content = lzma.open(os.path.join(self.root, 'boing.xz')).read()
744
745 self.assertEqual(gzip_content, bz2_content)
746+ self.assertEqual(gzip_content, xz_content)
747 self.assertEqual('hello', gzip_content)
748
749+ def testCompressors(self):
750+ """`RepositoryIndexFile` honours the supplied list of compressors."""
751+ repo_file = self.getRepoFile(
752+ 'boing',
753+ compressors=[
754+ IndexCompressionType.UNCOMPRESSED, IndexCompressionType.XZ])
755+ repo_file.close()
756+ self.assertEqual(['boing', 'boing.xz'], sorted(os.listdir(self.root)))
757+
758 def testUnreferencing(self):
759 """`RepositoryIndexFile` unreferencing.
760
761@@ -102,7 +126,7 @@
762 repo_file = self.getRepoFile('boing')
763
764 self.assertEqual(0, len(os.listdir(self.root)))
765- self.assertEqual(2, len(os.listdir(self.temp_root)))
766+ self.assertEqual(3, len(os.listdir(self.temp_root)))
767
768 del repo_file
769
770@@ -112,15 +136,20 @@
771 def testRootCreation(self):
772 """`RepositoryIndexFile` creates given 'root' path if necessary."""
773 missing_root = os.path.join(self.root, 'donotexist')
774+ compressors = [
775+ IndexCompressionType.GZIP,
776+ IndexCompressionType.BZIP2,
777+ IndexCompressionType.XZ,
778+ ]
779 repo_file = RepositoryIndexFile(
780- os.path.join(missing_root, 'boing'), self.temp_root)
781+ os.path.join(missing_root, 'boing'), self.temp_root, compressors)
782
783 self.assertFalse(os.path.exists(missing_root))
784
785 repo_file.close()
786
787 self.assertEqual(
788- ['boing.bz2', 'boing.gz'],
789+ ['boing.bz2', 'boing.gz', 'boing.xz'],
790 sorted(os.listdir(missing_root)))
791
792 def testMissingTempRoot(self):
793@@ -128,7 +157,8 @@
794 missing_temp_root = os.path.join(self.temp_root, 'donotexist')
795 self.assertRaises(
796 AssertionError, RepositoryIndexFile,
797- os.path.join(self.root, 'boing'), missing_temp_root)
798+ os.path.join(self.root, 'boing'), missing_temp_root,
799+ [IndexCompressionType.UNCOMPRESSED])
800
801 def testRemoveOld(self):
802 """`RepositoryIndexFile` removes old index files."""
803@@ -139,4 +169,5 @@
804 repo_file = self.getRepoFile('boing')
805 repo_file.close()
806 self.assertEqual(
807- ['boing.bz2', 'boing.gz'], sorted(os.listdir(self.root)))
808+ ['boing.bz2', 'boing.gz', 'boing.xz'],
809+ sorted(os.listdir(self.root)))
810
811=== modified file 'lib/lp/archivepublisher/utils.py'
812--- lib/lp/archivepublisher/utils.py 2016-02-04 19:46:52 +0000
813+++ lib/lp/archivepublisher/utils.py 2016-02-05 20:34:36 +0000
814@@ -17,7 +17,15 @@
815 import stat
816 import tempfile
817
818-from lp.soyuz.enums import ArchivePurpose
819+try:
820+ import lzma
821+except ImportError:
822+ from backports import lzma
823+
824+from lp.soyuz.enums import (
825+ ArchivePurpose,
826+ IndexCompressionType,
827+ )
828 from lp.soyuz.interfaces.archive import default_name_by_purpose
829
830
831@@ -38,6 +46,8 @@
832
833 class PlainTempFile:
834
835+ # Enumerated identifier.
836+ compression_type = IndexCompressionType.UNCOMPRESSED
837 # Filename suffix.
838 suffix = ''
839 # File path built on initialization.
840@@ -71,6 +81,7 @@
841
842
843 class GzipTempFile(PlainTempFile):
844+ compression_type = IndexCompressionType.GZIP
845 suffix = '.gz'
846
847 def _buildFile(self, fd):
848@@ -78,6 +89,7 @@
849
850
851 class Bzip2TempFile(PlainTempFile):
852+ compression_type = IndexCompressionType.BZIP2
853 suffix = '.bz2'
854
855 def _buildFile(self, fd):
856@@ -85,14 +97,23 @@
857 return bz2.BZ2File(self.path, mode='wb')
858
859
860+class XZTempFile(PlainTempFile):
861+ compression_type = IndexCompressionType.XZ
862+ suffix = '.xz'
863+
864+ def _buildFile(self, fd):
865+ os.close(fd)
866+ return lzma.LZMAFile(self.path, mode='wb', format=lzma.FORMAT_XZ)
867+
868+
869 class RepositoryIndexFile:
870 """Facilitates the publication of repository index files.
871
872 It allows callsites to publish index files in different medias
873- (plain, gzip and bzip2) transparently and atomically.
874+ (plain, gzip, bzip2, and xz) transparently and atomically.
875 """
876
877- def __init__(self, path, temp_root):
878+ def __init__(self, path, temp_root, compressors):
879 """Store repositories destinations and filename.
880
881 The given 'temp_root' needs to exist; on the other hand, the
882@@ -105,13 +126,14 @@
883 self.root, filename = os.path.split(path)
884 assert os.path.exists(temp_root), 'Temporary root does not exist.'
885
886- self.index_files = (
887- GzipTempFile(temp_root, filename),
888- Bzip2TempFile(temp_root, filename),
889- )
890- self.old_index_files = (
891- PlainTempFile(temp_root, filename, auto_open=False),
892- )
893+ self.index_files = []
894+ self.old_index_files = []
895+ for cls in (PlainTempFile, GzipTempFile, Bzip2TempFile, XZTempFile):
896+ if cls.compression_type in compressors:
897+ self.index_files.append(cls(temp_root, filename))
898+ else:
899+ self.old_index_files.append(
900+ cls(temp_root, filename, auto_open=False))
901
902 def write(self, content):
903 """Write contents to all target medias."""
904
905=== modified file 'lib/lp/registry/configure.zcml'
906--- lib/lp/registry/configure.zcml 2016-01-26 15:47:37 +0000
907+++ lib/lp/registry/configure.zcml 2016-02-05 20:34:36 +0000
908@@ -1,4 +1,4 @@
909-<!-- Copyright 2009-2015 Canonical Ltd. This software is licensed under the
910+<!-- Copyright 2009-2016 Canonical Ltd. This software is licensed under the
911 GNU Affero General Public License version 3 (see the file LICENSE).
912 -->
913
914@@ -317,6 +317,7 @@
915 driver
916 backports_not_automatic
917 include_long_descriptions
918+ index_compressors
919 inherit_overrides_from_parents"/>
920
921 <!-- NB: check with SABDFL before modifying these, there is potential to
922
923=== modified file 'lib/lp/registry/interfaces/distroseries.py'
924--- lib/lp/registry/interfaces/distroseries.py 2015-10-13 13:22:08 +0000
925+++ lib/lp/registry/interfaces/distroseries.py 2016-02-05 20:34:36 +0000
926@@ -1,4 +1,4 @@
927-# Copyright 2009-2015 Canonical Ltd. This software is licensed under the
928+# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
929 # GNU Affero General Public License version 3 (see the file LICENSE).
930
931 """Interfaces including and related to IDistroSeries."""
932@@ -91,6 +91,7 @@
933 UniqueField,
934 )
935 from lp.services.webservice.apihelpers import patch_plain_parameter_type
936+from lp.soyuz.enums import IndexCompressionType
937 from lp.soyuz.interfaces.buildrecords import IHasBuildRecords
938 from lp.translations.interfaces.hastranslationimports import (
939 IHasTranslationImports,
940@@ -378,6 +379,14 @@
941 on clients, which requires downloading Packages files for
942 multiple architectures.""")))
943
944+ index_compressors = exported(List(
945+ value_type=Choice(vocabulary=IndexCompressionType),
946+ title=_("Compression types to use for published index files"),
947+ required=True,
948+ description=_("""
949+ A list of compression types to use for published index files
950+ (Packages, Sources, etc.).""")))
951+
952 inherit_overrides_from_parents = Bool(
953 title=_("Inherit overrides from parents"),
954 readonly=False, required=True)
955
956=== modified file 'lib/lp/registry/model/distroseries.py'
957--- lib/lp/registry/model/distroseries.py 2016-02-05 20:34:36 +0000
958+++ lib/lp/registry/model/distroseries.py 2016-02-05 20:34:36 +0000
959@@ -124,6 +124,7 @@
960 from lp.services.worlddata.model.language import Language
961 from lp.soyuz.enums import (
962 ArchivePurpose,
963+ IndexCompressionType,
964 PackagePublishingStatus,
965 PackageUploadStatus,
966 )
967@@ -202,6 +203,12 @@
968 ]
969
970
971+DEFAULT_INDEX_COMPRESSORS = [
972+ IndexCompressionType.GZIP,
973+ IndexCompressionType.BZIP2,
974+ ]
975+
976+
977 @implementer(
978 IBugSummaryDimension, IDistroSeries, IHasBuildRecords, IHasQueueItems,
979 IServiceUsage, ISeriesBugTarget)
980@@ -266,6 +273,9 @@
981 kwargs["publishing_options"] = {
982 "backports_not_automatic": False,
983 "include_long_descriptions": True,
984+ "index_compressors": [
985+ compressor.title
986+ for compressor in DEFAULT_INDEX_COMPRESSORS],
987 }
988 super(DistroSeries, self).__init__(*args, **kwargs)
989
990@@ -816,6 +826,21 @@
991 assert isinstance(value, bool)
992 self.publishing_options["include_long_descriptions"] = value
993
994+ @property
995+ def index_compressors(self):
996+ if "index_compressors" in self.publishing_options:
997+ return [
998+ IndexCompressionType.getTermByToken(name).value
999+ for name in self.publishing_options["index_compressors"]]
1000+ else:
1001+ return list(DEFAULT_INDEX_COMPRESSORS)
1002+
1003+ @index_compressors.setter
1004+ def index_compressors(self, value):
1005+ assert isinstance(value, list)
1006+ self.publishing_options["index_compressors"] = [
1007+ compressor.title for compressor in value]
1008+
1009 def _customizeSearchParams(self, search_params):
1010 """Customize `search_params` for this distribution series."""
1011 search_params.setDistroSeries(self)
1012
1013=== modified file 'lib/lp/registry/tests/test_distroseries.py'
1014--- lib/lp/registry/tests/test_distroseries.py 2015-12-15 14:12:25 +0000
1015+++ lib/lp/registry/tests/test_distroseries.py 2016-02-05 20:34:36 +0000
1016@@ -1,4 +1,4 @@
1017-# Copyright 2009-2015 Canonical Ltd. This software is licensed under the
1018+# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
1019 # GNU Affero General Public License version 3 (see the file LICENSE).
1020
1021 """Tests for distroseries."""
1022@@ -29,6 +29,7 @@
1023 from lp.services.webapp.interfaces import OAuthPermission
1024 from lp.soyuz.enums import (
1025 ArchivePurpose,
1026+ IndexCompressionType,
1027 PackagePublishingStatus,
1028 )
1029 from lp.soyuz.interfaces.archive import IArchiveSet
1030@@ -369,6 +370,19 @@
1031 self.assertFalse(
1032 naked_distroseries.publishing_options["include_long_descriptions"])
1033
1034+ def test_index_compressors(self):
1035+ distroseries = self.factory.makeDistroSeries()
1036+ self.assertEqual(
1037+ [IndexCompressionType.GZIP, IndexCompressionType.BZIP2],
1038+ distroseries.index_compressors)
1039+ with admin_logged_in():
1040+ distroseries.index_compressors = [IndexCompressionType.XZ]
1041+ self.assertEqual(
1042+ [IndexCompressionType.XZ], distroseries.index_compressors)
1043+ naked_distroseries = removeSecurityProxy(distroseries)
1044+ self.assertEqual(
1045+ ["xz"], naked_distroseries.publishing_options["index_compressors"])
1046+
1047
1048 class TestDistroSeriesPackaging(TestCaseWithFactory):
1049
1050
1051=== modified file 'lib/lp/soyuz/enums.py'
1052--- lib/lp/soyuz/enums.py 2015-09-03 15:14:07 +0000
1053+++ lib/lp/soyuz/enums.py 2016-02-05 20:34:36 +0000
1054@@ -1,4 +1,4 @@
1055-# Copyright 2010-2015 Canonical Ltd. This software is licensed under the
1056+# Copyright 2010-2016 Canonical Ltd. This software is licensed under the
1057 # GNU Affero General Public License version 3 (see the file LICENSE).
1058
1059 """Enumerations used in the lp/soyuz modules."""
1060@@ -13,6 +13,7 @@
1061 'archive_suffixes',
1062 'BinaryPackageFileType',
1063 'BinaryPackageFormat',
1064+ 'IndexCompressionType',
1065 'PackageCopyPolicy',
1066 'PackageCopyStatus',
1067 'PackageDiffStatus',
1068@@ -570,3 +571,16 @@
1069 Specifies a native package, with a single tar.*. Supports gzip,
1070 bzip2, and xz compression.
1071 """)
1072+
1073+
1074+class IndexCompressionType(DBEnumeratedType):
1075+ """Index compression type
1076+
1077+ Archive indexes such as Packages and Sources may be compressed using any
1078+ of several different schemes.
1079+ """
1080+
1081+ UNCOMPRESSED = DBItem(0, "uncompressed")
1082+ GZIP = DBItem(1, "gzip")
1083+ BZIP2 = DBItem(2, "bzip2")
1084+ XZ = DBItem(3, "xz")
1085
1086=== modified file 'setup.py'
1087--- setup.py 2015-11-04 14:30:09 +0000
1088+++ setup.py 2016-02-05 20:34:36 +0000
1089@@ -29,6 +29,7 @@
1090 'ampoule',
1091 'auditorclient',
1092 'auditorfixture',
1093+ 'backports.lzma',
1094 'BeautifulSoup',
1095 'bzr',
1096 'cssselect',
1097
1098=== modified file 'versions.cfg'
1099--- versions.cfg 2015-12-17 14:51:27 +0000
1100+++ versions.cfg 2016-02-05 20:34:36 +0000
1101@@ -15,6 +15,7 @@
1102 auditor = 0.0.3
1103 auditorclient = 0.0.4
1104 auditorfixture = 0.0.5
1105+backports.lzma = 0.0.3
1106 BeautifulSoup = 3.2.1
1107 billiard = 3.3.0.20
1108 bson = 0.3.3