Merge lp:~jelmer/bzr-builder/fix-upstream-tarball-no-build into lp:bzr-builder

Proposed by Jelmer Vernooij
Status: Superseded
Proposed branch: lp:~jelmer/bzr-builder/fix-upstream-tarball-no-build
Merge into: lp:bzr-builder
Diff against target: 136 lines (+56/-28)
5 files modified
__init__.py (+10/-0)
cmds.py (+22/-26)
info.py (+17/-0)
setup.py (+6/-1)
tests/test_blackbox.py (+1/-1)
To merge this branch: bzr merge lp:~jelmer/bzr-builder/fix-upstream-tarball-no-build
Reviewer Review Type Date Requested Status
bzr-builder developers Pending
Review via email: mp+81890@code.launchpad.net

This proposal has been superseded by a proposal from 2011-11-10.

Description of the change

Fix exporting of upstream tarball when --no-build is specified.

Rather than returning early, this simply makes --no-build skip the build step. This makes the code a bit more predictable, and makes it actually export the upstream tarball with --no-build, rather than exiting before it got to that step.

To post a comment you must log in.
158. By Jelmer Vernooij

Fix test.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '__init__.py'
2--- __init__.py 2011-07-20 09:42:32 +0000
3+++ __init__.py 2011-11-10 18:15:27 +0000
4@@ -145,6 +145,16 @@
5 resulting tree
6 """
7
8+from info import (
9+ bzr_plugin_version as version_info,
10+ )
11+
12+if version_info[3] == 'final':
13+ version_string = '%d.%d.%d' % version_info[:3]
14+else:
15+ version_string = '%d.%d.%d%s%d' % version_info
16+__version__ = version_string
17+
18 if __name__ == '__main__':
19 import os
20 import subprocess
21
22=== modified file 'cmds.py'
23--- cmds.py 2011-11-10 13:19:57 +0000
24+++ cmds.py 2011-11-10 18:15:27 +0000
25@@ -671,33 +671,29 @@
26 working_basedir)
27 # working_directory -> package_dir: after this debian stuff works.
28 os.rename(working_directory, package_dir)
29- if no_build:
30- if manifest is not None:
31- write_manifest_to_transport(manifest, base_branch,
32- possible_transports)
33- return 0
34- current_format = get_source_format(package_dir)
35- if (package_version.debian_version is not None or
36- current_format == "3.0 (quilt)"):
37- # Non-native package
38- try:
39- extract_upstream_tarball(base_branch.branch, package_name,
40- package_version.upstream_version, working_basedir)
41- except errors.NoSuchTag, e:
42- if not allow_fallback_to_native:
43- raise errors.BzrCommandError(
44- "Unable to find the upstream source. Import it "
45- "as tag %s or build with "
46- "--allow-fallback-to-native." % e.tag_name)
47- else:
48- force_native_format(package_dir, current_format)
49 try:
50- build_source_package(package_dir,
51- tgz_check=not allow_fallback_to_native)
52- if key_id is not None:
53- sign_source_package(package_dir, key_id)
54- if dput is not None:
55- dput_source_package(package_dir, dput)
56+ current_format = get_source_format(package_dir)
57+ if (package_version.debian_version is not None or
58+ current_format == "3.0 (quilt)"):
59+ # Non-native package
60+ try:
61+ extract_upstream_tarball(base_branch.branch, package_name,
62+ package_version.upstream_version, working_basedir)
63+ except errors.NoSuchTag, e:
64+ if not allow_fallback_to_native:
65+ raise errors.BzrCommandError(
66+ "Unable to find the upstream source. Import it "
67+ "as tag %s or build with "
68+ "--allow-fallback-to-native." % e.tag_name)
69+ else:
70+ force_native_format(package_dir, current_format)
71+ if not no_build:
72+ build_source_package(package_dir,
73+ tgz_check=not allow_fallback_to_native)
74+ if key_id is not None:
75+ sign_source_package(package_dir, key_id)
76+ if dput is not None:
77+ dput_source_package(package_dir, dput)
78 finally:
79 # package_dir -> working_directory
80 # FIXME: may fail in error unwind, masking the original exception.
81
82=== added file 'info.py'
83--- info.py 1970-01-01 00:00:00 +0000
84+++ info.py 2011-11-10 18:15:27 +0000
85@@ -0,0 +1,17 @@
86+# bzr-builder: a bzr plugin to constuct trees based on recipes
87+# Copyright 2011 Canonical Ltd.
88+
89+# This program is free software: you can redistribute it and/or modify it
90+# under the terms of the GNU General Public License version 3, as published
91+# by the Free Software Foundation.
92+
93+# This program is distributed in the hope that it will be useful, but
94+# WITHOUT ANY WARRANTY; without even the implied warranties of
95+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
96+# PURPOSE. See the GNU General Public License for more details.
97+
98+# You should have received a copy of the GNU General Public License along
99+# with this program. If not, see <http://www.gnu.org/licenses/>.
100+
101+
102+bzr_plugin_version = (0, 7, 2, 'dev', 0)
103
104=== modified file 'setup.py'
105--- setup.py 2011-11-10 13:24:30 +0000
106+++ setup.py 2011-11-10 18:15:27 +0000
107@@ -1,10 +1,15 @@
108 #!/usr/bin/python
109
110+from info import *
111+
112 from distutils.core import setup
113
114 if __name__ == '__main__':
115+ version = bzr_plugin_version[:3]
116+ version_string = ".".join([str(x) for x in version])
117+
118 setup(name="bzr-builder",
119- version="0.7.2",
120+ version=version_string,
121 description="Turn a recipe in to a bzr branch",
122 author="James Westby",
123 author_email="james.westby@canonical.com",
124
125=== modified file 'tests/test_blackbox.py'
126--- tests/test_blackbox.py 2011-11-10 00:55:33 +0000
127+++ tests/test_blackbox.py 2011-11-10 18:15:27 +0000
128@@ -359,7 +359,7 @@
129 new_cl_contents = ("package (1) unstable; urgency=low\n\n"
130 " * Auto build.\n\n -- M. Maintainer <maint@maint.org> ")
131 actual_cl_contents = self._get_file_contents(
132- "working/package-1/debian/changelog")
133+ "working/test-1/debian/changelog")
134 self.assertStartsWith(actual_cl_contents, new_cl_contents)
135 for fn in os.listdir("working"):
136 self.assertFalse(fn.endswith(".changes"))

Subscribers

People subscribed via source and target branches