Merge lp:~al-maisan/bzr-builddeb/pristine-tar into lp:~bzr-builddeb-hackers/bzr-builddeb/trunk-old

Proposed by Muharem Hrnjadovic
Status: Merged
Merged at revision: not available
Proposed branch: lp:~al-maisan/bzr-builddeb/pristine-tar
Merge into: lp:~bzr-builddeb-hackers/bzr-builddeb/trunk-old
Diff against target: None lines
To merge this branch: bzr merge lp:~al-maisan/bzr-builddeb/pristine-tar
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+11505@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote :

Hello there!

This branch fixes the following kind of failure (bug #417153):

{{{
$ bzr branch lp:ubuntu/gwibber; cd gwibber; bzr bd -S
Branched 11 revision(s).
Building using working tree
Looking for a way to retrieve the upstream tarball
Using pristine-tar to reconstruct the needed tarball.
tar: gwibber-2.0.0~bzr396/.bzrignore: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
pristine-tar: command failed: tar cf /tmp/pristine-tar.NQspZVOeeE/recreatetarball --owner 0 --group 0 --numeric-owner -C /tmp/pristine-tar.NQspZVOeeE/workdir --no-recursion --mode 0644 --files-from /tmp/pristine-tar.NQspZVOeeE/manifest
bzr: ERROR: There was an error using pristine-tar: Generating tar from delta failed: None.
}}}

The "pristine-tar gentar" failure is now detected and an appropriate exception
(PackageVersionNotPresent) is raised to the caller so it can try to obtain the
required upstream tar ball from the next package source.

There are also two small "drive-by" fixes:

    - format string fix in MissingChangelogError
    - removal of some "dead code" in import_dsc.py

NB: this is only the first part of the "pristine-tar" problem solution. A
forthcoming branch will make sure that the "pristine-tar gendelta" command
does not produce deltas with files missing from the unpacked source tree
(thus "obscuring" future "pristine-tar gentar" problems).

Please have a look and let me know what you think.

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

Looks good, thanks.

James

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'errors.py'
--- errors.py 2009-08-24 16:27:40 +0000
+++ errors.py 2009-09-03 09:35:00 +0000
@@ -66,7 +66,7 @@
6666
6767
68class MissingChangelogError(BzrError):68class MissingChangelogError(BzrError):
69 _fmt = 'Could not find changelog at %(locations)s.'69 _fmt = 'Could not find changelog at %(location)s.'
7070
71 def __init__(self, locations):71 def __init__(self, locations):
72 BzrError.__init__(self, location=locations)72 BzrError.__init__(self, location=locations)
7373
=== modified file 'import_dsc.py'
--- import_dsc.py 2009-08-28 16:49:59 +0000
+++ import_dsc.py 2009-09-03 09:58:24 +0000
@@ -82,14 +82,6 @@
82 '.hg', '_darcs', '.git', '.shelf', '.bzr', '.bzr.backup', '.bzrtags',82 '.hg', '_darcs', '.git', '.shelf', '.bzr', '.bzr.backup', '.bzrtags',
83 '.bzr-builddeb'])83 '.bzr-builddeb'])
8484
85exclude_as_files = ['*/' + x for x in files_to_ignore]
86exclude_as_dirs = ['*/' + x + '/*' for x in files_to_ignore]
87exclude = exclude_as_files + exclude_as_dirs
88underscore_x = ['-x'] * len(exclude)
89ignore_arguments = []
90map(ignore_arguments.extend, zip(underscore_x, exclude))
91ignore_arguments = ignore_arguments + ['-x', '*,v']
92
9385
94class DirWrapper(object):86class DirWrapper(object):
95 def __init__(self, fileobj, mode='r'):87 def __init__(self, fileobj, mode='r'):
9688
=== modified file 'upstream.py'
--- upstream.py 2009-08-24 17:33:44 +0000
+++ upstream.py 2009-09-10 08:43:13 +0000
@@ -33,6 +33,7 @@
33from bzrlib.plugins.builddeb.errors import (33from bzrlib.plugins.builddeb.errors import (
34 MissingUpstreamTarball,34 MissingUpstreamTarball,
35 PackageVersionNotPresent,35 PackageVersionNotPresent,
36 PristineTarError,
36 )37 )
37from bzrlib.plugins.builddeb.import_dsc import DistributionBranch38from bzrlib.plugins.builddeb.import_dsc import DistributionBranch
38from bzrlib.plugins.builddeb.repack_tarball import repack_tarball39from bzrlib.plugins.builddeb.repack_tarball import repack_tarball
@@ -83,7 +84,10 @@
83 if not db.has_pristine_tar_delta(revid):84 if not db.has_pristine_tar_delta(revid):
84 raise PackageVersionNotPresent(package, version, self)85 raise PackageVersionNotPresent(package, version, self)
85 info("Using pristine-tar to reconstruct the needed tarball.")86 info("Using pristine-tar to reconstruct the needed tarball.")
86 db.reconstruct_pristine_tar(revid, package, version, target_filename)87 try:
88 db.reconstruct_pristine_tar(revid, package, version, target_filename)
89 except PristineTarError:
90 raise PackageVersionNotPresent(package, version, self)
8791
8892
89class AptSource(UpstreamSource):93class AptSource(UpstreamSource):

Subscribers

People subscribed via source and target branches