Merge lp:~jelmer/bzr-builddeb/fix-bz2-repack into lp:bzr-builddeb

Proposed by Jelmer Vernooij
Status: Merged
Approved by: James Westby
Approved revision: no longer in the source branch.
Merged at revision: 550
Proposed branch: lp:~jelmer/bzr-builddeb/fix-bz2-repack
Merge into: lp:bzr-builddeb
Diff against target: 62 lines (+22/-4)
3 files modified
debian/changelog (+6/-0)
tests/test_upstream.py (+14/-0)
upstream/__init__.py (+2/-4)
To merge this branch: bzr merge lp:~jelmer/bzr-builddeb/fix-bz2-repack
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+54991@code.launchpad.net

Description of the change

Fix repacking of bz2 tarballs during "bzr merge-upstream".

To post a comment you must log in.
547. By Jelmer Vernooij

Merge support for lazy opening upstream branch.

548. By Jelmer Vernooij

Merge --launchpad option to 'bzr merge-upstream'.

549. By Jelmer Vernooij

Merge support for using lazy hooks if available.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Ping!

This still do double repacking of some tarballs but it's the simplest implementation in terms of code. I'd be happy to attack the double repacking as well, but preferably in a separate MP (it already happens at the moment, this just adds another codepath that triggers it).

Revision history for this message
James Westby (james-w) wrote :

Hi,

Sorry, I didn't know you were wanting to do this in two branches.

Approving, as it looks ok to me, but I wonder if the force_gz=True will
lead to unexpected results with --v3. Go ahead and land either way.

Thanks,

James

review: Approve
550. By Jelmer Vernooij

Fix merge of bz2 upstream tarballs. LP: #737012

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2011-03-14 22:28:24 +0000
+++ debian/changelog 2011-03-27 00:30:48 +0000
@@ -1,3 +1,9 @@
1bzr-builddeb (2.7.3) UNRELEASED; urgency=low
2
3 * Fix merge of bz2 upstream tarballs. LP: #737012
4
5 -- Jelmer Vernooij <jelmer@debian.org> Sun, 27 Mar 2011 01:25:57 +0100
6
1bzr-builddeb (2.7.2) unstable; urgency=high7bzr-builddeb (2.7.2) unstable; urgency=high
28
3 [ Andrew Mitchell ]9 [ Andrew Mitchell ]
410
=== modified file 'tests/test_upstream.py'
--- tests/test_upstream.py 2011-02-26 21:08:36 +0000
+++ tests/test_upstream.py 2011-03-27 00:30:48 +0000
@@ -24,6 +24,8 @@
2424
25from base64 import standard_b64encode25from base64 import standard_b64encode
2626
27import bz2
28import gzip
27import os29import os
28import tarfile30import tarfile
29import zipfile31import zipfile
@@ -616,6 +618,18 @@
616 self.assertRaises(PackageVersionNotPresent,618 self.assertRaises(PackageVersionNotPresent,
617 source.fetch_tarball, "foo", "0.9", "bar")619 source.fetch_tarball, "foo", "0.9", "bar")
618620
621 def test_fetch_tarball_bz2(self):
622 tar = tarfile.open("foo-1.0.tar.bz2", "w:bz2")
623 tar.close()
624 # verify this is a bzip2 file
625 bz2.BZ2File("foo-1.0.tar.bz2").close()
626 source = TarfileSource("foo-1.0.tar.bz2", "1.0")
627 os.mkdir("bar")
628 self.assertEquals("bar/foo_1.0.orig.tar.gz",
629 source.fetch_tarball("foo", "1.0", "bar"))
630 self.failUnlessExists("bar/foo_1.0.orig.tar.gz")
631 gzip.open("bar/foo_1.0.orig.tar.gz").close()
632
619633
620class _MissingUpstreamProvider(UpstreamProvider):634class _MissingUpstreamProvider(UpstreamProvider):
621 """For tests"""635 """For tests"""
622636
=== modified file 'upstream/__init__.py'
--- upstream/__init__.py 2011-02-12 01:38:40 +0000
+++ upstream/__init__.py 2011-03-27 00:30:48 +0000
@@ -582,10 +582,8 @@
582 if version != self.version:582 if version != self.version:
583 raise PackageVersionNotPresent(package, version, self)583 raise PackageVersionNotPresent(package, version, self)
584 dest_name = tarball_name(package, version)584 dest_name = tarball_name(package, version)
585 repack_tarball(self.path, dest_name, target_dir=target_dir)585 repack_tarball(self.path, dest_name, target_dir=target_dir, force_gz=True)
586 target_filename = self._tarball_path(package, version, target_dir)586 return os.path.join(target_dir, dest_name)
587 shutil.copy(self.path, target_filename)
588 return target_filename
589587
590 def get_latest_version(self, package, version):588 def get_latest_version(self, package, version):
591 return self.version589 return self.version

Subscribers

People subscribed via source and target branches