Code review comment for lp:~jelmer/bzr-builder/misc-fixes

Revision history for this message
John A Meinel (jameinel) wrote :

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,
> tgz_check=not allow_fallback_to_native)
>
> === modified file 'tests/test_blackbox.py'
> --- tests/test_blackbox.py 2011-10-23 18:12:06 +0000
> +++ tests/test_blackbox.py 2011-11-04 23:04:23 +0000
> @@ -218,7 +218,8 @@
> self.build_tree_contents([("source/debian/rules",
> "#!/usr/bin/make -f\nclean:\n"),
> ("source/debian/control",
> - "Source: foo\nMaintainer: maint <email address hidden>\n")])
> + "Source: foo\nMaintainer: maint <email address hidden>\n\n"
> + "Package: foo\nArchitecture: all\n")])
> source.add(["a", "debian/", "debian/rules", "debian/control"])
> revid = source.commit("one")
> self.build_tree_contents([("test.recipe", "# bzr-builder format
> 0.1 "
> @@ -251,7 +252,8 @@
> self.build_tree_contents([("source/debian/rules",
> "#!/usr/bin/make -f\nclean:\n"),
> ("source/debian/control",
> - "Source: foo\nMaintainer: maint <email address hidden>\n")])
> + "Source: foo\nMaintainer: maint <email address hidden>\n\n"
> + "Package: foo\nArchitecture: all\n")])
> source.add(["a", "debian/", "debian/rules", "debian/control"])
> source.commit("one")
> self.build_tree_contents([("test.recipe", "# bzr-builder format
> 0.1 "
> @@ -268,7 +270,8 @@
> self.build_tree_contents([("source/debian/rules",
> "#!/usr/bin/make -f\nclean:\n"),
> ("source/debian/control",
> - "Source: foo\nMaintainer: maint <email address hidden>\n")])
> + "Source: foo\nMaintainer: maint <email address hidden>\n"
> + "\nPackage: foo\nArchitecture: all\n")])
> source.add(["a", "debian/", "debian/rules", "debian/control"])
> source.commit("one")
> self.build_tree_contents([("test.recipe", "# bzr-builder format
> 0.1 "
> @@ -321,7 +324,8 @@
> (os.path.join(path, "debian/rules"),
> "#!/usr/bin/make -f\nclean:\n"),
> (os.path.join(path, "debian/control"),
> - "Source: package\nMaintainer: maint <email address hidden>\n"),
> + "Source: package\nMaintainer: maint <email address hidden>\n\n"
> + "Package: package\nArchitecture: all\n"),
> (os.path.join(path, "debian/changelog"),
> cl_contents)
> ])
> @@ -507,10 +511,18 @@
> def test_cmd_dailydeb_with_pristine_orig_bz2_tarball(self):
> self.requireFeature(PristineTarFeature)
> self.make_simple_quilt_package()
> - pristine_tar_sha1 = self.make_upstream_version("0.1",
> - [("upstream/file", "content\n")], pristine_tar_format="bz2")
> + pristine_tar_sha1 = self.make_upstream_version("0.1", [
> + ("upstream/file", "content\n"),
> + ("upstream/a", "contents of source/a\n")],
> + pristine_tar_format="bz2")
> self.build_tree_contents([("test.recipe", "# bzr-builder format
> 0.3 "
> "deb-version 0.1-1\nsource\n")])
> + wt = workingtree.WorkingTree.open("source")
> + self.build_tree([("source/upstream/")])
> + self.build_tree_contents([
> + ("source/upstream/file", "content\n"),
> + ("source/upstream/a", "contents of source/a\n")])
> + wt.add(["upstream", "upstream/file", "upstream/a"])
> out, err = self.run_bzr("dailydeb -q test.recipe working",
> retcode=0)
> self.assertPathExists("working/package_0.1.orig.tar.bz2")
> @@ -519,6 +531,32 @@
> osutils.sha_file_by_name("working/package_0.1.orig.tar.bz2"),
> pristine_tar_sha1)
>
> + def
> test_cmd_dailydeb_allow_fallback_to_native_with_orig_tarball(self):
> + self.requireFeature(PristineTarFeature)
> + self.make_simple_quilt_package()
> + pristine_tar_sha1 = self.make_upstream_version("0.1", [
> + ("upstream/file", "content\n"),
> + ("upstream/a", "contents of source/a\n")],
> + pristine_tar_format="bz2")
> + self.build_tree_contents([("test.recipe", "# bzr-builder format
> 0.3 "
> + "deb-version 0.1-1\nsource\n")])
> + wt = workingtree.WorkingTree.open("source")
> + self.build_tree([("source/upstream/")])
> + self.build_tree_contents([
> + ("source/upstream/file", "content\n"),
> + ("source/upstream/a", "contents of source/a\n")])
> + wt.add(["upstream", "upstream/file", "upstream/a"])
> + out, err = self.run_bzr(
> + "dailydeb --allow-fallback-to-native -q test.recipe working",
> + retcode=0)
> + self.assertPathExists("working/package_0.1.orig.tar.bz2")
> + self.assertPathExists("working/package_0.1-1.debian.tar.gz")
> + self.assertEquals("3.0 (quilt)\n",
> + open("source/debian/source/format", "r").read())
> + self.assertEquals(
> + osutils.sha_file_by_name("working/package_0.1.orig.tar.bz2"),
> + pristine_tar_sha1)
> +
> def test_cmd_dailydeb_force_native(self):
> self.make_simple_quilt_package()
> self.build_tree_contents([("test.recipe", "# bzr-builder format
> 0.3 "
> @@ -610,7 +648,7 @@
> source.commit("set source format")
>
> self.build_tree_contents([("test.recipe", "# bzr-builder format
> 0.3 "
> - "deb-version 1\nsource\n")])
> + "deb-version 1-1\nsource\n")])
> out, err = self.run_bzr(
> "dailydeb --allow-fallback-to-native -q test.recipe working",
> retcode=3)
> self.assertEquals(err, "bzr: ERROR: Unknown source format 2.0\n")
>
>
>

« Back to merge proposal