Merge lp:~vila/bzr-builddeb/debug-pristine-tar into lp:bzr-builddeb

Proposed by Vincent Ladeuil
Status: Merged
Merged at revision: 732
Proposed branch: lp:~vila/bzr-builddeb/debug-pristine-tar
Merge into: lp:bzr-builddeb
Diff against target: 74 lines (+27/-2)
3 files modified
config.py (+4/-0)
info.py (+1/-1)
upstream/pristinetar.py (+22/-1)
To merge this branch: bzr merge lp:~vila/bzr-builddeb/debug-pristine-tar
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+110852@code.launchpad.net

Description of the change

This helped me to debug pristine-tar failures by preserving the exported
tree used as input by pristine-tar. This tree is normally removed as it's
part of a temp dir used to produce the delta. As such, when pristine-tar
failed, it was removed when unwinding the stack leaving nothing for
diagnosis.

This is mainly intended to be used on jubany or on a dev setup where
'debug-pristine-tar=True' should be specified in ~/.bazaar/builddeb.conf.

The option defaults to False.

To post a comment you must log in.
735. By Vincent Ladeuil

Fix typos.

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

Re-testing after the last change revealed typos fixed in revno 735.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.py'
--- config.py 2012-01-13 10:25:27 +0000
+++ config.py 2012-06-19 08:10:27 +0000
@@ -265,6 +265,10 @@
265265
266 merge = _bool_property('merge', "Run in merge mode")266 merge = _bool_property('merge', "Run in merge mode")
267267
268 debug_pristine_tar = _bool_property(
269 'debug-pristine-tar',
270 "Save some context when pristine-tar fails")
271
268 @property272 @property
269 def build_type(self):273 def build_type(self):
270 if self.merge:274 if self.merge:
271275
=== modified file 'info.py'
--- info.py 2011-02-16 13:19:52 +0000
+++ info.py 2012-06-19 08:10:27 +0000
@@ -18,7 +18,7 @@
1818
19bzr_plugin_name = 'builddeb'19bzr_plugin_name = 'builddeb'
2020
21bzr_plugin_version = (2, 7, 0, 'dev', 0)21bzr_plugin_version = (2, 8, 5, 'dev', 0)
2222
23bzr_commands = [23bzr_commands = [
24 "test_builddeb",24 "test_builddeb",
2525
=== modified file 'upstream/pristinetar.py'
--- upstream/pristinetar.py 2012-02-17 14:38:45 +0000
+++ upstream/pristinetar.py 2012-06-19 08:10:27 +0000
@@ -18,6 +18,7 @@
18# along with bzr-builddeb; if not, write to the Free Software18# along with bzr-builddeb; if not, write to the Free Software
19# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA19# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2020
21
21from base64 import (22from base64 import (
22 standard_b64decode,23 standard_b64decode,
23 standard_b64encode,24 standard_b64encode,
@@ -34,6 +35,7 @@
34 )35 )
35from bzrlib.plugins.builddeb.upstream import UpstreamSource36from bzrlib.plugins.builddeb.upstream import UpstreamSource
36from bzrlib.plugins.builddeb.util import (37from bzrlib.plugins.builddeb.util import (
38 debuild_config,
37 export,39 export,
38 subprocess_setup,40 subprocess_setup,
39 )41 )
@@ -409,7 +411,26 @@
409 export(tree, dest, format='dir', subdir=subdir)411 export(tree, dest, format='dir', subdir=subdir)
410 finally:412 finally:
411 tree.unlock()413 tree.unlock()
412 return make_pristine_tar_delta(dest, tarball_path)414 try:
415 return make_pristine_tar_delta(dest, tarball_path)
416 except PristineTarDeltaTooLarge:
417 raise
418 except PristineTarError: # I.e. not PristineTarDeltaTooLarge
419 conf = debuild_config(tree, True)
420 if conf.debug_pristine_tar:
421 revno, revid = tree.branch.last_revision_info()
422 preserved = osutils.pathjoin(osutils.dirname(tarball_path),
423 'orig-%s' % (revno,))
424 mutter('pristine-tar failed for delta between %s rev: %s'
425 ' and tarball %s'
426 % (tree.basedir, (revno, revid), tarball_path))
427 osutils.copy_tree(
428 dest, preserved)
429 mutter('The failure can be reproduced with:\n'
430 ' cd %s\n'
431 ' pristine-tar -vdk gendelta %s -'
432 % (preserved, tarball_path))
433 raise
413 finally:434 finally:
414 shutil.rmtree(tmpdir)435 shutil.rmtree(tmpdir)
415436

Subscribers

People subscribed via source and target branches