Merge lp:~abentley/launchpad/safe-v3 into lp:launchpad

Proposed by Aaron Bentley
Status: Merged
Approved by: Paul Hummer
Approved revision: no longer in the source branch.
Merged at revision: 11587
Proposed branch: lp:~abentley/launchpad/safe-v3
Merge into: lp:launchpad
Diff against target: 93 lines (+20/-22)
2 files modified
lib/canonical/buildd/buildrecipe (+19/-21)
lib/canonical/buildd/debian/control (+1/-1)
To merge this branch: bzr merge lp:~abentley/launchpad/safe-v3
Reviewer Review Type Date Requested Status
Paul Hummer (community) Approve
Review via email: mp+34465@code.launchpad.net

Commit message

Use --safe flag for builds, support recipe format 0.3

Description of the change

= Summary =
Update bzr-builder dependency to 0.5 or better, use --safe
flag. 0.5 or better enables 0.3 format, and thefore the nest-part instruction.

== Proposed fix ==
Same

== Pre-implementation notes ==
None

== Implementation details ==
None

== Tests ==
Tested interactively. The 'run' command is safely rejected.

== Demo and Q/A ==
None.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/canonical/buildd/buildrecipe
  lib/canonical/buildd/debian/control

./lib/canonical/buildd/debian/control
      11: Line exceeds 78 characters.

To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/buildd/buildrecipe'
2--- lib/canonical/buildd/buildrecipe 2010-08-25 20:04:40 +0000
3+++ lib/canonical/buildd/buildrecipe 2010-09-21 14:28:50 +0000
4@@ -55,8 +55,8 @@
5 """
6 # XXX: AaronBentley 2010-07-07 bug=602463: pbuilder uses aptitude but
7 # does not depend on it.
8- return self.chroot(['apt-get', 'install', '-y', 'pbuilder',
9- 'bzr-builder', 'sudo', 'aptitude'])
10+ return self.chroot([
11+ 'apt-get', 'install', '-y', 'pbuilder', 'aptitude'])
12
13 def buildTree(self):
14 """Build the recipe into a source tree.
15@@ -65,37 +65,35 @@
16 :return: a retcode from `bzr dailydeb`.
17 """
18 assert not os.path.exists(self.tree_path)
19- recipe_path_relative = os.path.join(self.work_dir_relative, 'recipe')
20- self.tree_path_relative = os.path.join(self.work_dir_relative, 'tree')
21- manifest_path_relative = os.path.join(
22- self.tree_path_relative, 'manifest')
23- recipe_path = os.path.join(self.chroot_path, recipe_path_relative[1:])
24+ recipe_path = os.path.join(self.work_dir, 'recipe')
25+ manifest_path = os.path.join(self.tree_path, 'manifest')
26 recipe_file = open(recipe_path, 'rb')
27 try:
28 recipe = recipe_file.read()
29 finally:
30 recipe_file.close()
31- # As of bzr 2.2, a defined identity is needed. In this case, we're using
32- # buildd@<hostname>.
33+ # As of bzr 2.2, a defined identity is needed. In this case, we're
34+ # using buildd@<hostname>.
35 hostname = socket.gethostname()
36 bzr_email = 'buildd@%s' % hostname
37
38 print 'Building recipe:'
39 print recipe
40- retcode = self.chroot([
41- 'sudo', '-i', '-u', self.username, 'DEBEMAIL=%s' % self.author_email,
42- 'DEBFULLNAME=%s' % self.author_name.encode('utf-8'),
43- 'BZR_EMAIL=%s' % bzr_email, 'bzr',
44- 'dailydeb', '--no-build', recipe_path_relative,
45- self.tree_path_relative, '--manifest', manifest_path_relative,
46- '--append-version', '~%s1' % self.distroseries_name],
47- echo=True)
48+ sys.stdout.flush()
49+ env = {
50+ 'DEBEMAIL': self.author_email,
51+ 'DEBFULLNAME': self.author_name.encode('utf-8'),
52+ 'BZR_EMAIL': bzr_email}
53+ retcode = call([
54+ 'bzr', 'dailydeb', '--safe', '--no-build', recipe_path,
55+ self.tree_path, '--manifest', manifest_path,
56+ '--append-version', '~%s1' % self.distroseries_name], env=env)
57 if retcode != 0:
58 return retcode
59 (source,) = [name for name in os.listdir(self.tree_path)
60 if name != 'manifest']
61- self.source_dir_relative = os.path.join(self.tree_path_relative,
62- source)
63+ self.source_dir_relative = os.path.join(
64+ self.work_dir_relative, 'tree', source)
65 return retcode
66
67 def getPackageName(self):
68@@ -163,10 +161,10 @@
69
70 if __name__ == '__main__':
71 builder = RecipeBuilder(*sys.argv[1:])
72+ if builder.buildTree() != 0:
73+ sys.exit(RETCODE_FAILURE_BUILD_TREE)
74 if builder.install() != 0:
75 sys.exit(RETCODE_FAILURE_INSTALL)
76- if builder.buildTree() != 0:
77- sys.exit(RETCODE_FAILURE_BUILD_TREE)
78 if builder.installBuildDeps() != 0:
79 sys.exit(RETCODE_FAILURE_INSTALL_BUILD_DEPS)
80 if builder.buildSourcePackage() != 0:
81
82=== modified file 'lib/canonical/buildd/debian/control'
83--- lib/canonical/buildd/debian/control 2010-07-22 16:15:58 +0000
84+++ lib/canonical/buildd/debian/control 2010-09-21 14:28:50 +0000
85@@ -8,7 +8,7 @@
86 Package: launchpad-buildd
87 Section: misc
88 Architecture: all
89-Depends: python-twisted-core, python-twisted-web, debootstrap, dpkg-dev, linux32, file, bzip2, sudo, ntpdate, adduser, apt-transport-https, lsb-release, apache2, ${misc:Depends}
90+Depends: python-twisted-core, python-twisted-web, debootstrap, dpkg-dev, linux32, file, bzip2, sudo, ntpdate, adduser, apt-transport-https, lsb-release, apache2, bzr-builder (>=0.5), ${misc:Depends}
91 Description: Launchpad buildd slave
92 This is the launchpad buildd slave package. It contains everything needed to
93 get a launchpad buildd going apart from the database manipulation required to