Merge lp:~jelmer/bzr-builddeb/lucid-compatibility into lp:bzr-builddeb

Proposed by Jelmer Vernooij
Status: Merged
Approved by: James Westby
Approved revision: 635
Merged at revision: 633
Proposed branch: lp:~jelmer/bzr-builddeb/lucid-compatibility
Merge into: lp:bzr-builddeb
Diff against target: 89 lines (+21/-6)
4 files modified
merge_changelog.py (+10/-3)
tests/test_import_dsc.py (+4/-2)
tests/test_merge_changelog.py (+6/-0)
tests/test_merge_upstream.py (+1/-1)
To merge this branch: bzr merge lp:~jelmer/bzr-builddeb/lucid-compatibility
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+79323@code.launchpad.net

Commit message

Various fixes to allow the testsuite to run on Lucid and Hardy.

Description of the change

Improve lucid and hardy compatibility:

 * allow dpkg-mergechangelogs to not be available
 * checksums can be plain strings
 * compare Version to Version, older versions of python-debian don't support comparing it with a string

To post a comment you must log in.
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
1=== modified file 'merge_changelog.py'
2--- merge_changelog.py 2011-07-26 13:23:59 +0000
3+++ merge_changelog.py 2011-10-13 18:10:35 +0000
4@@ -16,6 +16,7 @@
5 # You should have received a copy of the GNU General Public License
6 # along with this program. If not, see <http://www.gnu.org/licenses/>.
7
8+import errno
9 import logging
10 import os.path
11 import re
12@@ -60,9 +61,15 @@
13 writelines(base_filename, base_lines)
14 writelines(this_filename, this_lines)
15 writelines(other_filename, other_lines)
16- proc = subprocess.Popen(['dpkg-mergechangelogs', base_filename,
17- this_filename, other_filename], stdout=subprocess.PIPE,
18- stderr=subprocess.PIPE)
19+ try:
20+ proc = subprocess.Popen(['dpkg-mergechangelogs', base_filename,
21+ this_filename, other_filename], stdout=subprocess.PIPE,
22+ stderr=subprocess.PIPE)
23+ except OSError, e:
24+ if e.errno == errno.ENOENT:
25+ # No dpkg-mergechangelogs command available
26+ return 'not_applicable'
27+ raise
28 stdout, stderr = proc.communicate()
29 retcode = proc.returncode
30 if stderr:
31
32=== modified file 'tests/test_import_dsc.py'
33--- tests/test_import_dsc.py 2011-10-11 21:22:24 +0000
34+++ tests/test_import_dsc.py 2011-10-13 18:10:35 +0000
35@@ -1885,7 +1885,8 @@
36 self.assertEquals(3, len(extractor.upstream_tarballs[0]))
37 self.assertTrue(os.path.exists(extractor.upstream_tarballs[0][0]))
38 self.assertIs(None, extractor.upstream_tarballs[0][1])
39- self.assertIsInstance(extractor.upstream_tarballs[0][2], unicode) # md5sum
40+ self.assertIsInstance(
41+ extractor.upstream_tarballs[0][2], basestring) # md5sum
42 finally:
43 extractor.cleanup()
44
45@@ -1970,7 +1971,8 @@
46 self.assertEquals(3, len(extractor.upstream_tarballs[0]))
47 self.assertTrue(os.path.exists(extractor.upstream_tarballs[0][0]))
48 self.assertIs(None, extractor.upstream_tarballs[0][1])
49- self.assertIsInstance(extractor.upstream_tarballs[0][2], unicode) # md5sum
50+ self.assertIsInstance(
51+ extractor.upstream_tarballs[0][2], basestring) # md5sum
52 finally:
53 extractor.cleanup()
54
55
56=== modified file 'tests/test_merge_changelog.py'
57--- tests/test_merge_changelog.py 2011-07-25 06:26:46 +0000
58+++ tests/test_merge_changelog.py 2011-10-13 18:10:35 +0000
59@@ -37,6 +37,10 @@
60 )
61 from bzrlib.plugins import builddeb
62 from bzrlib.plugins.builddeb import merge_changelog
63+from bzrlib.tests.features import ExecutableFeature
64+
65+
66+dpkg_mergechangelogs_feature = ExecutableFeature('dpkg-mergechangelogs')
67
68
69 v_111_2 = """\
70@@ -140,6 +144,8 @@
71
72 class TestMergeChangelog(tests.TestCase):
73
74+ _test_needs_features = [dpkg_mergechangelogs_feature]
75+
76 def setUp(self):
77 super(tests.TestCase, self).setUp()
78 # Intercept warnings from merge_changelog's logger: this is where
79
80=== modified file 'tests/test_merge_upstream.py'
81--- tests/test_merge_upstream.py 2011-07-20 19:01:04 +0000
82+++ tests/test_merge_upstream.py 2011-10-13 18:10:35 +0000
83@@ -89,5 +89,5 @@
84 cl = Changelog(open('debian/changelog'))
85 self.assertEquals(cl._blocks[0].package, "somepkg")
86 self.assertEquals(cl._blocks[0].distributions, "UNRELEASED")
87- self.assertEquals(cl._blocks[0].version, "1.0-1")
88+ self.assertEquals(cl._blocks[0].version, Version("1.0-1"))
89 self.assertEquals([], list(tree.filter_unversioned_files(["debian/changelog"])))

Subscribers

People subscribed via source and target branches