Merge lp:~jelmer/bzr-builddeb/uscan-print-error into lp:bzr-builddeb

Proposed by Jelmer Vernooij
Status: Merged
Approved by: James Westby
Approved revision: 608
Merged at revision: 612
Proposed branch: lp:~jelmer/bzr-builddeb/uscan-print-error
Merge into: lp:bzr-builddeb
Diff against target: 85 lines (+33/-1) (has conflicts)
4 files modified
debian/changelog (+9/-0)
repack_tarball.py (+1/-0)
tests/test_upstream.py (+17/-0)
upstream/__init__.py (+6/-1)
Text conflict in debian/changelog
To merge this branch: bzr merge lp:~jelmer/bzr-builddeb/uscan-print-error
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+74511@code.launchpad.net

Description of the change

Print a proper error message when uscan doesn't create the expected orig tarball despite exiting with exit code 0.

To post a comment you must log in.
Revision history for this message
James Westby (james-w) wrote :

The diff needs a cleanup (conflicts, pdb), but the change looks good.

Thanks,

James

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

Argh, not sure how that got in there.

Thanks for the review.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-08-31 01:40:39 +0000
3+++ debian/changelog 2011-09-07 20:13:24 +0000
4@@ -2,10 +2,19 @@
5
6 * Improve error message when tag for upstream version can not be
7 found. LP: #783882
8+<<<<<<< TREE
9 * Cope with newer versions of bzr raising IOError rather than
10 NoSuchFile error. LP: #831351, Closes: #638219
11+=======
12+ * Print proper error if uscan doesn't create the expected orig
13+ tarball. LP: #818093.
14+>>>>>>> MERGE-SOURCE
15
16+<<<<<<< TREE
17 -- Jelmer Vernooij <jelmer@debian.org> Wed, 31 Aug 2011 03:40:12 +0200
18+=======
19+ -- Jelmer Vernooij <jelmer@debian.org> Wed, 07 Sep 2011 22:11:47 +0200
20+>>>>>>> MERGE-SOURCE
21
22 bzr-builddeb (2.7.7) unstable; urgency=low
23
24
25=== modified file 'repack_tarball.py'
26--- repack_tarball.py 2011-07-16 21:52:11 +0000
27+++ repack_tarball.py 2011-09-07 20:13:24 +0000
28@@ -187,6 +187,7 @@
29
30
31 def _repack_directory(target_transport, new_name, source_name):
32+ import pdb; pdb.set_trace()
33 target_transport.ensure_base()
34 target_f = target_transport.open_write_stream(new_name)
35 try:
36
37=== modified file 'tests/test_upstream.py'
38--- tests/test_upstream.py 2011-07-25 13:11:01 +0000
39+++ tests/test_upstream.py 2011-09-07 20:13:24 +0000
40@@ -60,6 +60,7 @@
41 UpstreamSource,
42 UScanSource,
43 extract_tarball_version,
44+ gather_orig_files,
45 new_tarball_name,
46 )
47 from bzrlib.plugins.builddeb.util import (
48@@ -921,3 +922,19 @@
49 def test_zip(self):
50 self.assertEquals("foo_1.0.orig.tar.gz",
51 new_tarball_name("foo", "1.0", "bla.zip"))
52+
53+
54+class TestGatherOrigTarballs(TestCaseWithTransport):
55+
56+ def test_no_dir(self):
57+ self.assertIs(None, gather_orig_files("mypkg", "1.0", "idontexist"))
58+
59+ def test_empty(self):
60+ self.build_tree(["empty/"])
61+ self.assertIs(None, gather_orig_files("mypkg", "1.0", "empty"))
62+
63+ def test_single(self):
64+ self.build_tree(["mypkg_1.0.orig.tar.gz"])
65+ self.assertEquals(
66+ [os.path.join(self.test_dir, "mypkg_1.0.orig.tar.gz")],
67+ gather_orig_files("mypkg", "1.0", "."))
68
69=== modified file 'upstream/__init__.py'
70--- upstream/__init__.py 2011-07-16 22:07:04 +0000
71+++ upstream/__init__.py 2011-09-07 20:13:24 +0000
72@@ -298,7 +298,12 @@
73 if r != 0:
74 note("uscan could not find the needed tarball.")
75 raise PackageVersionNotPresent(package, version, self)
76- return gather_orig_files(package, version, target_dir)
77+ orig_files = gather_orig_files(package, version, target_dir)
78+ if orig_files is None:
79+ note("the expected files generated by uscan could not be found in"
80+ "%s.", target_dir)
81+ raise PackageVersionNotPresent(package, version, self)
82+ return orig_files
83
84
85 class SelfSplitSource(UpstreamSource):

Subscribers

People subscribed via source and target branches