Merge lp:~jelmer/bzr-builddeb/tar-xz into lp:bzr-builddeb

Proposed by Jelmer Vernooij
Status: Merged
Merged at revision: 613
Proposed branch: lp:~jelmer/bzr-builddeb/tar-xz
Merge into: lp:bzr-builddeb
Diff against target: 284 lines (+45/-38)
9 files modified
cmds.py (+3/-3)
debian/changelog (+6/-0)
dh_make.py (+2/-2)
import_dsc.py (+4/-4)
tests/test_import_dsc.py (+2/-2)
tests/test_upstream.py (+12/-12)
tests/test_util.py (+5/-5)
upstream/pristinetar.py (+7/-7)
util.py (+4/-3)
To merge this branch: bzr merge lp:~jelmer/bzr-builddeb/tar-xz
Reviewer Review Type Date Requested Status
Vincent Ladeuil Approve
Review via email: mp+74812@code.launchpad.net

Commit message

Replace .tar.lzma with .tar.xz - our toolchain only supports the latter.

Description of the change

Replace .tar.lzma with .tar.xz - our toolchain only supports the latter.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

I think we should do another release and upload to oneiric after this lands.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Fine !

This has caused http://package-import.ubuntu.com/status/pleiades.html#2011-09-09%2003:33:07.686923

The package importer on jubany is currently at revno 607 (2 revisions after 2.7.7), do you think any change since then could cause problems there ? Or can I just deploy this patch once it has landed ?

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmds.py'
2--- cmds.py 2011-08-11 15:55:14 +0000
3+++ cmds.py 2011-09-09 15:14:45 +0000
4@@ -471,7 +471,7 @@
5
6 You must supply the source to import from, and in some cases
7 the version number of the new release. The source can be a .tar.gz, .tar,
8- .tar.bz2, .tar.lzma, .tgz or .zip archive, a directory or a branch. The
9+ .tar.bz2, .tar.xz, .tgz or .zip archive, a directory or a branch. The
10 source may also be a remote file described by a URL.
11
12 In most situations the version can be guessed from the upstream source.
13@@ -577,8 +577,8 @@
14 if v3:
15 if location.endswith(".tar.bz2") or location.endswith(".tbz2"):
16 format = "bz2"
17- elif location.endswith(".tar.lzma"):
18- format = "lzma"
19+ elif location.endswith(".tar.xz"):
20+ format = "xz"
21 dest_name = tarball_name(package, version, None, format=format)
22 tarball_filename = os.path.join(orig_dir, dest_name)
23 try:
24
25=== modified file 'debian/changelog'
26--- debian/changelog 2011-09-07 21:50:32 +0000
27+++ debian/changelog 2011-09-09 15:14:45 +0000
28@@ -1,3 +1,9 @@
29+bzr-builddeb (2.7.9) UNRELEASED; urgency=low
30+
31+ * Support .tar.xz Debian files rather than .tar.lzma.
32+
33+ -- Jelmer Vernooij <jelmer@debian.org> Fri, 09 Sep 2011 15:21:22 +0200
34+
35 bzr-builddeb (2.7.8) unstable; urgency=low
36
37 * Improve error message when tag for upstream version can not be
38
39=== modified file 'dh_make.py'
40--- dh_make.py 2011-07-16 21:52:11 +0000
41+++ dh_make.py 2011-09-09 15:14:45 +0000
42@@ -62,8 +62,8 @@
43 if use_v3:
44 if tarball.endswith(".tar.bz2") or tarball.endswith(".tbz2"):
45 format = "bz2"
46- elif tarball.endswith(".tar.lzma"):
47- format = "lzma"
48+ elif tarball.endswith(".tar.xz"):
49+ format = "xz"
50 dest_name = util.tarball_name(package_name, version, None, format=format)
51 trace.note("Fetching tarball")
52 repack_tarball(tarball, dest_name, target_dir=orig_dir)
53
54=== modified file 'import_dsc.py'
55--- import_dsc.py 2011-07-20 14:09:01 +0000
56+++ import_dsc.py 2011-09-09 15:14:45 +0000
57@@ -1477,7 +1477,7 @@
58 for part in self.dsc['files']:
59 if (part['name'].endswith(".tar.gz")
60 or part['name'].endswith(".tar.bz2")
61- or part['name'].endswith(".tar.lzma")):
62+ or part['name'].endswith(".tar.xz")):
63 self.unextracted_debian_md5 = part['md5sum']
64
65
66@@ -1521,12 +1521,12 @@
67 part['md5sum']))
68 elif (part['name'].endswith(".debian.tar.gz")
69 or part['name'].endswith(".debian.tar.bz2")
70- or part['name'].endswith(".debian.tar.lzma")):
71+ or part['name'].endswith(".debian.tar.xz")):
72 self.unextracted_debian_md5 = part['md5sum']
73 assert self.upstream_tarballs is not None, \
74- "Can't handle non gz|bz2|lzma tarballs yet"
75+ "Can't handle non gz|bz2|xz tarballs yet"
76 assert self.unextracted_debian_md5 is not None, \
77- "Can't handle non gz|bz2|lzma tarballs yet"
78+ "Can't handle non gz|bz2|xz tarballs yet"
79
80
81 SOURCE_EXTRACTORS = {}
82
83=== modified file 'tests/test_import_dsc.py'
84--- tests/test_import_dsc.py 2011-08-31 01:16:19 +0000
85+++ tests/test_import_dsc.py 2011-09-09 15:14:45 +0000
86@@ -925,7 +925,7 @@
87 "esse cillum dolore eu fugiat nulla pariatur. Excepteur sint "
88 "occaecat cupidatat non proident, sunt in culpa qui officia "
89 "deserunt mollit anim id est laborum.")
90- tar_path = "package_0.1.orig.tar.lzma"
91+ tar_path = "package_0.1.orig.tar.xz"
92 f = lzma.LZMAFile(tar_path, 'w')
93 try:
94 tf = tarfile.open(None, 'w', f)
95@@ -947,7 +947,7 @@
96 self.assertEqual(rev.message,
97 "Import upstream version %s" % str(version.upstream_version))
98 self.assertEqual(rev.properties['deb-md5'], self.fake_md5_1)
99- self.assertTrue('deb-pristine-delta-lzma' in rev.properties)
100+ self.assertTrue('deb-pristine-delta-xz' in rev.properties)
101
102 def test_import_package_init_from_other(self):
103 self.requireFeature(PristineTarFeature)
104
105=== modified file 'tests/test_upstream.py'
106--- tests/test_upstream.py 2011-09-07 20:11:50 +0000
107+++ tests/test_upstream.py 2011-09-09 15:14:45 +0000
108@@ -224,17 +224,17 @@
109 _apt_pkg=apt_pkg)
110 self.assertEquals(paths, ["target/apackage_0.2.orig.tar.bz2"])
111
112- def test_apt_provider_right_version_lzma(self):
113+ def test_apt_provider_right_version_xz(self):
114 caller = MockAptCaller(work=True)
115 sources = MockSources(["0.1-1", "0.2-1"],
116 [[("checksum", 0L, "apackage_0.1.orig.tar.gz", "tar")],
117- [("checksum", 0L, "apackage_0.2.orig.tar.lzma", "tar")]])
118+ [("checksum", 0L, "apackage_0.2.orig.tar.xz", "tar")]])
119 apt_pkg = MockAptPkg(sources)
120 src = AptSource()
121 src._run_apt_source = caller.call
122 paths = src.fetch_tarballs("apackage", "0.2", "target",
123 _apt_pkg=apt_pkg)
124- self.assertEquals(paths, ["target/apackage_0.2.orig.tar.lzma"])
125+ self.assertEquals(paths, ["target/apackage_0.2.orig.tar.xz"])
126
127 def test_apt_provider_right_version(self):
128 caller = MockAptCaller(work=True)
129@@ -746,10 +746,10 @@
130 rev.properties["deb-pristine-delta-bz2"] = "1"
131 self.assertEquals("bz2", self.source.pristine_tar_format(rev))
132
133- def test_pristine_tar_format_lzma(self):
134+ def test_pristine_tar_format_xz(self):
135 rev = Revision("myrevid")
136- rev.properties["deb-pristine-delta-lzma"] = "1"
137- self.assertEquals("lzma", self.source.pristine_tar_format(rev))
138+ rev.properties["deb-pristine-delta-xz"] = "1"
139+ self.assertEquals("xz", self.source.pristine_tar_format(rev))
140
141 def test_pristine_tar_format_unknown(self):
142 rev = Revision("myrevid")
143@@ -836,21 +836,21 @@
144 self.assertPathExists("bar/foo_1.0.orig.tar.bz2")
145 tarfile.open("bar/foo_1.0.orig.tar.bz2", "r:bz2").close()
146
147- def test_fetch_tarball_lzma(self):
148+ def test_fetch_tarball_xz(self):
149 self.requireFeature(LzmaFeature)
150 import lzma
151- lzma_f = lzma.LZMAFile("foo-1.0.tar.lzma", 'w')
152+ lzma_f = lzma.LZMAFile("foo-1.0.tar.xz", 'w')
153 try:
154 tar = tarfile.open("foo-1.0.tar", "w", lzma_f)
155 tar.close()
156 finally:
157 lzma_f.close()
158- source = TarfileSource("foo-1.0.tar.lzma", "1.0")
159+ source = TarfileSource("foo-1.0.tar.xz", "1.0")
160 os.mkdir("bar")
161- self.assertEquals(["bar/foo_1.0.orig.tar.gz"],
162+ self.assertEquals(["bar/foo_1.0.orig.tar.xz"],
163 source.fetch_tarballs("foo", "1.0", "bar"))
164- self.assertPathExists("bar/foo_1.0.orig.tar.gz")
165- gzip.open("bar/foo_1.0.orig.tar.gz").close()
166+ self.assertPathExists("bar/foo_1.0.orig.tar.xz")
167+ lzma.LZMAFile("bar/foo_1.0.orig.tar.xz").close()
168
169
170 class _MissingUpstreamProvider(UpstreamProvider):
171
172=== modified file 'tests/test_util.py'
173--- tests/test_util.py 2011-08-31 01:16:19 +0000
174+++ tests/test_util.py 2011-09-09 15:14:45 +0000
175@@ -284,9 +284,9 @@
176 self.assertEqual(tarball_name("package", Version("0.1"), None,
177 format='bz2'), "package_0.1.orig.tar.bz2")
178 self.assertEqual(tarball_name("package", Version("0.1"), None,
179- format='lzma'), "package_0.1.orig.tar.lzma")
180+ format='xz'), "package_0.1.orig.tar.xz")
181 self.assertEqual(tarball_name("package", Version("0.1"), "la",
182- format='lzma'), "package_0.1.orig-la.tar.lzma")
183+ format='xz'), "package_0.1.orig-la.tar.xz")
184
185
186 class SuiteToDistributionTests(TestCase):
187@@ -883,7 +883,7 @@
188 f = gzip.GzipFile(tar_path, "w")
189 elif compression == "bz2":
190 f = bz2.BZ2File(tar_path, "w")
191- elif compression == "lzma":
192+ elif compression == "xz":
193 import lzma
194 f = lzma.LZMAFile(tar_path, "w")
195 else:
196@@ -915,9 +915,9 @@
197 strip_components=1)
198 self.assertEquals(os.listdir("target"), ["README"])
199
200- def test_single_orig_tar_lzma(self):
201+ def test_single_orig_tar_xz(self):
202 self.requireFeature(LzmaFeature)
203- tar_path = self.create_tarball("package", "0.1", "lzma")
204+ tar_path = self.create_tarball("package", "0.1", "xz")
205 os.mkdir("target")
206 extract_orig_tarballs([(tar_path, None)], "target",
207 strip_components=1)
208
209=== modified file 'upstream/pristinetar.py'
210--- upstream/pristinetar.py 2011-07-17 13:12:28 +0000
211+++ upstream/pristinetar.py 2011-09-09 15:14:45 +0000
212@@ -195,8 +195,8 @@
213 uuencoded = standard_b64encode(delta)
214 if tarball.endswith(".tar.bz2"):
215 revprops["deb-pristine-delta-bz2"] = uuencoded
216- elif tarball.endswith(".tar.lzma"):
217- revprops["deb-pristine-delta-lzma"] = uuencoded
218+ elif tarball.endswith(".tar.xz"):
219+ revprops["deb-pristine-delta-xz"] = uuencoded
220 else:
221 revprops["deb-pristine-delta"] = uuencoded
222 if author is not None:
223@@ -316,15 +316,15 @@
224 def has_pristine_tar_delta(self, rev):
225 return ('deb-pristine-delta' in rev.properties
226 or 'deb-pristine-delta-bz2' in rev.properties
227- or 'deb-pristine-delta-lzma' in rev.properties)
228+ or 'deb-pristine-delta-xz' in rev.properties)
229
230 def pristine_tar_format(self, rev):
231 if 'deb-pristine-delta' in rev.properties:
232 return 'gz'
233 elif 'deb-pristine-delta-bz2' in rev.properties:
234 return 'bz2'
235- elif 'deb-pristine-delta-lzma' in rev.properties:
236- return 'lzma'
237+ elif 'deb-pristine-delta-xz' in rev.properties:
238+ return 'xz'
239 assert self.has_pristine_tar_delta(rev)
240 raise AssertionError("Not handled new delta type in "
241 "pristine_tar_format")
242@@ -334,8 +334,8 @@
243 uuencoded = rev.properties['deb-pristine-delta']
244 elif 'deb-pristine-delta-bz2' in rev.properties:
245 uuencoded = rev.properties['deb-pristine-delta-bz2']
246- elif 'deb-pristine-delta-lzma' in rev.properties:
247- uuencoded = rev.properties['deb-pristine-delta-lzma']
248+ elif 'deb-pristine-delta-xz' in rev.properties:
249+ uuencoded = rev.properties['deb-pristine-delta-xz']
250 else:
251 assert self.has_pristine_tar_delta(rev)
252 raise AssertionError("Not handled new delta type in "
253
254=== modified file 'util.py'
255--- util.py 2011-07-25 00:14:48 +0000
256+++ util.py 2011-09-09 15:14:45 +0000
257@@ -216,7 +216,7 @@
258 :param version: the upstream version of the package.
259 :param component: Component name (None for base)
260 :param format: the format for the tarball. If None then 'gz' will be
261- used. You probably want on of 'gz', 'bz2', or 'lzma'.
262+ used. You probably want on of 'gz', 'bz2', 'lzma' or 'xz'.
263 :return: a string that is the name of the upstream tarball to use.
264 """
265 if format is None:
266@@ -698,7 +698,7 @@
267 "invalid orig tarball file %s does not have expected prefix %s" % (
268 tarball_filename, prefix))
269 base = tarball_filename[len(prefix):]
270- for ext in (".tar.gz", ".tar.bz2", ".tar.lzma"):
271+ for ext in (".tar.gz", ".tar.bz2", ".tar.lzma", ".tar.xz"):
272 if tarball_filename.endswith(ext):
273 base = base[:-len(ext)]
274 break
275@@ -726,7 +726,8 @@
276 tar_args = ["tar"]
277 if tarball_filename.endswith(".tar.bz2"):
278 tar_args.append('xjf')
279- elif tarball_filename.endswith(".tar.lzma"):
280+ elif (tarball_filename.endswith(".tar.lzma") or
281+ tarball_filename.endswith(".tar.xz")):
282 tar_args.append('xJf')
283 else:
284 tar_args.append('xzf')

Subscribers

People subscribed via source and target branches