Merge lp:~jelmer/bzr-builder/misc-fixes into lp:bzr-builder

Proposed by Jelmer Vernooij
Status: Merged
Merged at revision: 152
Proposed branch: lp:~jelmer/bzr-builder/misc-fixes
Merge into: lp:bzr-builder
Diff against target: 163 lines (+55/-13)
3 files modified
.testr.conf (+4/-0)
cmds.py (+6/-6)
tests/test_blackbox.py (+45/-7)
To merge this branch: bzr merge lp:~jelmer/bzr-builder/misc-fixes
Reviewer Review Type Date Requested Status
bzr-builder developers Pending
Review via email: mp+81345@code.launchpad.net

Description of the change

Some misc fixes:

* Provide a binary package in debian/control during various tests; newer versions of dpkg-source insist on this
* When building 3.0 (quilt) packages, don't leave any delta with upstream that's not in debian/patches, newer versions of dpkg-source break with this
* When using --allow-fallback-to-native, only convert the package to native if there is no upstream tarball

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :
Download full text (8.8 KiB)

Are there bug numbers for these? The change looks fine, I just don't know
the rationale.
Merge: approve
John
=:->
On Nov 4, 2011 6:05 PM, "Jelmer Vernooij" <email address hidden> wrote:

> Jelmer Vernooij has proposed merging lp:~jelmer/bzr-builder/misc-fixes
> into lp:bzr-builder.
>
> Requested reviews:
> bzr-builder developers (bzr-builder-devs)
>
> For more details, see:
> https://code.launchpad.net/~jelmer/bzr-builder/misc-fixes/+merge/81345
>
> Some misc fixes:
>
> * Provide a binary package in debian/control during various tests; newer
> versions of dpkg-source insist on this
> * When building 3.0 (quilt) packages, don't leave any delta with upstream
> that's not in debian/patches, newer versions of dpkg-source break with this
> * When using --allow-fallback-to-native, only convert the package to
> native if there is no upstream tarball
>
> --
> https://code.launchpad.net/~jelmer/bzr-builder/misc-fixes/+merge/81345
> You are subscribed to branch lp:bzr-builder.
>
> === added file '.testr.conf'
> --- .testr.conf 1970-01-01 00:00:00 +0000
> +++ .testr.conf 2011-11-04 23:04:23 +0000
> @@ -0,0 +1,4 @@
> +[DEFAULT]
> +test_command=BZR_PLUGINS_AT=builder@`pwd` bzr selftest -s bp.builder
> --subunit
> +test_id_option=--load-list $IDFILE
> +test_list_option=--list
>
> === modified file 'cmds.py'
> --- cmds.py 2011-11-04 14:07:59 +0000
> +++ cmds.py 2011-11-04 23:04:23 +0000
> @@ -55,7 +55,6 @@
>
> from bzrlib.plugins.builder.recipe import (
> BaseRecipeBranch,
> - DebUpstreamVariable,
> build_tree,
> RecipeParser,
> resolve_revisions,
> @@ -333,12 +332,11 @@
> f.close()
>
>
> -def force_native_format(working_tree_path):
> +def force_native_format(working_tree_path, current_format):
> """Make sure a package is a format that supports native packages.
>
> :param working_tree_path: Path to the package
> """
> - current_format = get_source_format(working_tree_path)
> if current_format == "3.0 (quilt)":
> convert_3_0_quilt_to_native(working_tree_path)
> elif current_format not in ("1.0", "3.0 (native)"):
> @@ -675,7 +673,9 @@
> write_manifest_to_transport(manifest, base_branch,
> possible_transports)
> return 0
> - if package_version.debian_version is not None:
> + current_format = get_source_format(package_dir)
> + if (package_version.debian_version is not None or
> + current_format == "3.0 (quilt)"):
> # Non-native package
> try:
> extract_upstream_tarball(base_branch.branch,
> package_name,
> @@ -686,8 +686,8 @@
> "Unable to find the upstream source. Import it
> "
> "as tag %s or build with "
> "--allow-fallback-to-native." % e.tag_name)
> - if allow_fallback_to_native:
> - force_native_format(package_dir)
> + else:
> + force_native_format(package_dir, current_format)
> try:
> build_source_package(package_dir,
> ...

Read more...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.testr.conf'
2--- .testr.conf 1970-01-01 00:00:00 +0000
3+++ .testr.conf 2011-11-04 23:04:23 +0000
4@@ -0,0 +1,4 @@
5+[DEFAULT]
6+test_command=BZR_PLUGINS_AT=builder@`pwd` bzr selftest -s bp.builder --subunit
7+test_id_option=--load-list $IDFILE
8+test_list_option=--list
9
10=== modified file 'cmds.py'
11--- cmds.py 2011-11-04 14:07:59 +0000
12+++ cmds.py 2011-11-04 23:04:23 +0000
13@@ -55,7 +55,6 @@
14
15 from bzrlib.plugins.builder.recipe import (
16 BaseRecipeBranch,
17- DebUpstreamVariable,
18 build_tree,
19 RecipeParser,
20 resolve_revisions,
21@@ -333,12 +332,11 @@
22 f.close()
23
24
25-def force_native_format(working_tree_path):
26+def force_native_format(working_tree_path, current_format):
27 """Make sure a package is a format that supports native packages.
28
29 :param working_tree_path: Path to the package
30 """
31- current_format = get_source_format(working_tree_path)
32 if current_format == "3.0 (quilt)":
33 convert_3_0_quilt_to_native(working_tree_path)
34 elif current_format not in ("1.0", "3.0 (native)"):
35@@ -675,7 +673,9 @@
36 write_manifest_to_transport(manifest, base_branch,
37 possible_transports)
38 return 0
39- if package_version.debian_version is not None:
40+ current_format = get_source_format(package_dir)
41+ if (package_version.debian_version is not None or
42+ current_format == "3.0 (quilt)"):
43 # Non-native package
44 try:
45 extract_upstream_tarball(base_branch.branch, package_name,
46@@ -686,8 +686,8 @@
47 "Unable to find the upstream source. Import it "
48 "as tag %s or build with "
49 "--allow-fallback-to-native." % e.tag_name)
50- if allow_fallback_to_native:
51- force_native_format(package_dir)
52+ else:
53+ force_native_format(package_dir, current_format)
54 try:
55 build_source_package(package_dir,
56 tgz_check=not allow_fallback_to_native)
57
58=== modified file 'tests/test_blackbox.py'
59--- tests/test_blackbox.py 2011-10-23 18:12:06 +0000
60+++ tests/test_blackbox.py 2011-11-04 23:04:23 +0000
61@@ -218,7 +218,8 @@
62 self.build_tree_contents([("source/debian/rules",
63 "#!/usr/bin/make -f\nclean:\n"),
64 ("source/debian/control",
65- "Source: foo\nMaintainer: maint maint@maint.org\n")])
66+ "Source: foo\nMaintainer: maint maint@maint.org\n\n"
67+ "Package: foo\nArchitecture: all\n")])
68 source.add(["a", "debian/", "debian/rules", "debian/control"])
69 revid = source.commit("one")
70 self.build_tree_contents([("test.recipe", "# bzr-builder format 0.1 "
71@@ -251,7 +252,8 @@
72 self.build_tree_contents([("source/debian/rules",
73 "#!/usr/bin/make -f\nclean:\n"),
74 ("source/debian/control",
75- "Source: foo\nMaintainer: maint maint@maint.org\n")])
76+ "Source: foo\nMaintainer: maint maint@maint.org\n\n"
77+ "Package: foo\nArchitecture: all\n")])
78 source.add(["a", "debian/", "debian/rules", "debian/control"])
79 source.commit("one")
80 self.build_tree_contents([("test.recipe", "# bzr-builder format 0.1 "
81@@ -268,7 +270,8 @@
82 self.build_tree_contents([("source/debian/rules",
83 "#!/usr/bin/make -f\nclean:\n"),
84 ("source/debian/control",
85- "Source: foo\nMaintainer: maint maint@maint.org\n")])
86+ "Source: foo\nMaintainer: maint maint@maint.org\n"
87+ "\nPackage: foo\nArchitecture: all\n")])
88 source.add(["a", "debian/", "debian/rules", "debian/control"])
89 source.commit("one")
90 self.build_tree_contents([("test.recipe", "# bzr-builder format 0.1 "
91@@ -321,7 +324,8 @@
92 (os.path.join(path, "debian/rules"),
93 "#!/usr/bin/make -f\nclean:\n"),
94 (os.path.join(path, "debian/control"),
95- "Source: package\nMaintainer: maint maint@maint.org\n"),
96+ "Source: package\nMaintainer: maint maint@maint.org\n\n"
97+ "Package: package\nArchitecture: all\n"),
98 (os.path.join(path, "debian/changelog"),
99 cl_contents)
100 ])
101@@ -507,10 +511,18 @@
102 def test_cmd_dailydeb_with_pristine_orig_bz2_tarball(self):
103 self.requireFeature(PristineTarFeature)
104 self.make_simple_quilt_package()
105- pristine_tar_sha1 = self.make_upstream_version("0.1",
106- [("upstream/file", "content\n")], pristine_tar_format="bz2")
107+ pristine_tar_sha1 = self.make_upstream_version("0.1", [
108+ ("upstream/file", "content\n"),
109+ ("upstream/a", "contents of source/a\n")],
110+ pristine_tar_format="bz2")
111 self.build_tree_contents([("test.recipe", "# bzr-builder format 0.3 "
112 "deb-version 0.1-1\nsource\n")])
113+ wt = workingtree.WorkingTree.open("source")
114+ self.build_tree([("source/upstream/")])
115+ self.build_tree_contents([
116+ ("source/upstream/file", "content\n"),
117+ ("source/upstream/a", "contents of source/a\n")])
118+ wt.add(["upstream", "upstream/file", "upstream/a"])
119 out, err = self.run_bzr("dailydeb -q test.recipe working",
120 retcode=0)
121 self.assertPathExists("working/package_0.1.orig.tar.bz2")
122@@ -519,6 +531,32 @@
123 osutils.sha_file_by_name("working/package_0.1.orig.tar.bz2"),
124 pristine_tar_sha1)
125
126+ def test_cmd_dailydeb_allow_fallback_to_native_with_orig_tarball(self):
127+ self.requireFeature(PristineTarFeature)
128+ self.make_simple_quilt_package()
129+ pristine_tar_sha1 = self.make_upstream_version("0.1", [
130+ ("upstream/file", "content\n"),
131+ ("upstream/a", "contents of source/a\n")],
132+ pristine_tar_format="bz2")
133+ self.build_tree_contents([("test.recipe", "# bzr-builder format 0.3 "
134+ "deb-version 0.1-1\nsource\n")])
135+ wt = workingtree.WorkingTree.open("source")
136+ self.build_tree([("source/upstream/")])
137+ self.build_tree_contents([
138+ ("source/upstream/file", "content\n"),
139+ ("source/upstream/a", "contents of source/a\n")])
140+ wt.add(["upstream", "upstream/file", "upstream/a"])
141+ out, err = self.run_bzr(
142+ "dailydeb --allow-fallback-to-native -q test.recipe working",
143+ retcode=0)
144+ self.assertPathExists("working/package_0.1.orig.tar.bz2")
145+ self.assertPathExists("working/package_0.1-1.debian.tar.gz")
146+ self.assertEquals("3.0 (quilt)\n",
147+ open("source/debian/source/format", "r").read())
148+ self.assertEquals(
149+ osutils.sha_file_by_name("working/package_0.1.orig.tar.bz2"),
150+ pristine_tar_sha1)
151+
152 def test_cmd_dailydeb_force_native(self):
153 self.make_simple_quilt_package()
154 self.build_tree_contents([("test.recipe", "# bzr-builder format 0.3 "
155@@ -610,7 +648,7 @@
156 source.commit("set source format")
157
158 self.build_tree_contents([("test.recipe", "# bzr-builder format 0.3 "
159- "deb-version 1\nsource\n")])
160+ "deb-version 1-1\nsource\n")])
161 out, err = self.run_bzr(
162 "dailydeb --allow-fallback-to-native -q test.recipe working", retcode=3)
163 self.assertEquals(err, "bzr: ERROR: Unknown source format 2.0\n")

Subscribers

People subscribed via source and target branches