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
1=== modified file 'errors.py'
2--- errors.py 2009-08-24 16:27:40 +0000
3+++ errors.py 2009-09-03 09:35:00 +0000
4@@ -66,7 +66,7 @@
5
6
7 class MissingChangelogError(BzrError):
8- _fmt = 'Could not find changelog at %(locations)s.'
9+ _fmt = 'Could not find changelog at %(location)s.'
10
11 def __init__(self, locations):
12 BzrError.__init__(self, location=locations)
13
14=== modified file 'import_dsc.py'
15--- import_dsc.py 2009-08-28 16:49:59 +0000
16+++ import_dsc.py 2009-09-03 09:58:24 +0000
17@@ -82,14 +82,6 @@
18 '.hg', '_darcs', '.git', '.shelf', '.bzr', '.bzr.backup', '.bzrtags',
19 '.bzr-builddeb'])
20
21-exclude_as_files = ['*/' + x for x in files_to_ignore]
22-exclude_as_dirs = ['*/' + x + '/*' for x in files_to_ignore]
23-exclude = exclude_as_files + exclude_as_dirs
24-underscore_x = ['-x'] * len(exclude)
25-ignore_arguments = []
26-map(ignore_arguments.extend, zip(underscore_x, exclude))
27-ignore_arguments = ignore_arguments + ['-x', '*,v']
28-
29
30 class DirWrapper(object):
31 def __init__(self, fileobj, mode='r'):
32
33=== modified file 'upstream.py'
34--- upstream.py 2009-08-24 17:33:44 +0000
35+++ upstream.py 2009-09-10 08:43:13 +0000
36@@ -33,6 +33,7 @@
37 from bzrlib.plugins.builddeb.errors import (
38 MissingUpstreamTarball,
39 PackageVersionNotPresent,
40+ PristineTarError,
41 )
42 from bzrlib.plugins.builddeb.import_dsc import DistributionBranch
43 from bzrlib.plugins.builddeb.repack_tarball import repack_tarball
44@@ -83,7 +84,10 @@
45 if not db.has_pristine_tar_delta(revid):
46 raise PackageVersionNotPresent(package, version, self)
47 info("Using pristine-tar to reconstruct the needed tarball.")
48- db.reconstruct_pristine_tar(revid, package, version, target_filename)
49+ try:
50+ db.reconstruct_pristine_tar(revid, package, version, target_filename)
51+ except PristineTarError:
52+ raise PackageVersionNotPresent(package, version, self)
53
54
55 class AptSource(UpstreamSource):

Subscribers

People subscribed via source and target branches