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