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
=== modified file 'lib/canonical/buildd/buildrecipe'
--- lib/canonical/buildd/buildrecipe 2010-08-25 20:04:40 +0000
+++ lib/canonical/buildd/buildrecipe 2010-09-21 14:28:50 +0000
@@ -55,8 +55,8 @@
55 """55 """
56 # XXX: AaronBentley 2010-07-07 bug=602463: pbuilder uses aptitude but56 # XXX: AaronBentley 2010-07-07 bug=602463: pbuilder uses aptitude but
57 # does not depend on it.57 # does not depend on it.
58 return self.chroot(['apt-get', 'install', '-y', 'pbuilder',58 return self.chroot([
59 'bzr-builder', 'sudo', 'aptitude'])59 'apt-get', 'install', '-y', 'pbuilder', 'aptitude'])
6060
61 def buildTree(self):61 def buildTree(self):
62 """Build the recipe into a source tree.62 """Build the recipe into a source tree.
@@ -65,37 +65,35 @@
65 :return: a retcode from `bzr dailydeb`.65 :return: a retcode from `bzr dailydeb`.
66 """66 """
67 assert not os.path.exists(self.tree_path)67 assert not os.path.exists(self.tree_path)
68 recipe_path_relative = os.path.join(self.work_dir_relative, 'recipe')68 recipe_path = os.path.join(self.work_dir, 'recipe')
69 self.tree_path_relative = os.path.join(self.work_dir_relative, 'tree')69 manifest_path = os.path.join(self.tree_path, 'manifest')
70 manifest_path_relative = os.path.join(
71 self.tree_path_relative, 'manifest')
72 recipe_path = os.path.join(self.chroot_path, recipe_path_relative[1:])
73 recipe_file = open(recipe_path, 'rb')70 recipe_file = open(recipe_path, 'rb')
74 try:71 try:
75 recipe = recipe_file.read()72 recipe = recipe_file.read()
76 finally:73 finally:
77 recipe_file.close()74 recipe_file.close()
78 # As of bzr 2.2, a defined identity is needed. In this case, we're using75 # As of bzr 2.2, a defined identity is needed. In this case, we're
79 # buildd@<hostname>.76 # using buildd@<hostname>.
80 hostname = socket.gethostname()77 hostname = socket.gethostname()
81 bzr_email = 'buildd@%s' % hostname78 bzr_email = 'buildd@%s' % hostname
8279
83 print 'Building recipe:'80 print 'Building recipe:'
84 print recipe81 print recipe
85 retcode = self.chroot([82 sys.stdout.flush()
86 'sudo', '-i', '-u', self.username, 'DEBEMAIL=%s' % self.author_email,83 env = {
87 'DEBFULLNAME=%s' % self.author_name.encode('utf-8'),84 'DEBEMAIL': self.author_email,
88 'BZR_EMAIL=%s' % bzr_email, 'bzr',85 'DEBFULLNAME': self.author_name.encode('utf-8'),
89 'dailydeb', '--no-build', recipe_path_relative,86 'BZR_EMAIL': bzr_email}
90 self.tree_path_relative, '--manifest', manifest_path_relative,87 retcode = call([
91 '--append-version', '~%s1' % self.distroseries_name],88 'bzr', 'dailydeb', '--safe', '--no-build', recipe_path,
92 echo=True)89 self.tree_path, '--manifest', manifest_path,
90 '--append-version', '~%s1' % self.distroseries_name], env=env)
93 if retcode != 0:91 if retcode != 0:
94 return retcode92 return retcode
95 (source,) = [name for name in os.listdir(self.tree_path)93 (source,) = [name for name in os.listdir(self.tree_path)
96 if name != 'manifest']94 if name != 'manifest']
97 self.source_dir_relative = os.path.join(self.tree_path_relative,95 self.source_dir_relative = os.path.join(
98 source)96 self.work_dir_relative, 'tree', source)
99 return retcode97 return retcode
10098
101 def getPackageName(self):99 def getPackageName(self):
@@ -163,10 +161,10 @@
163161
164if __name__ == '__main__':162if __name__ == '__main__':
165 builder = RecipeBuilder(*sys.argv[1:])163 builder = RecipeBuilder(*sys.argv[1:])
164 if builder.buildTree() != 0:
165 sys.exit(RETCODE_FAILURE_BUILD_TREE)
166 if builder.install() != 0:166 if builder.install() != 0:
167 sys.exit(RETCODE_FAILURE_INSTALL)167 sys.exit(RETCODE_FAILURE_INSTALL)
168 if builder.buildTree() != 0:
169 sys.exit(RETCODE_FAILURE_BUILD_TREE)
170 if builder.installBuildDeps() != 0:168 if builder.installBuildDeps() != 0:
171 sys.exit(RETCODE_FAILURE_INSTALL_BUILD_DEPS)169 sys.exit(RETCODE_FAILURE_INSTALL_BUILD_DEPS)
172 if builder.buildSourcePackage() != 0:170 if builder.buildSourcePackage() != 0:
173171
=== modified file 'lib/canonical/buildd/debian/control'
--- lib/canonical/buildd/debian/control 2010-07-22 16:15:58 +0000
+++ lib/canonical/buildd/debian/control 2010-09-21 14:28:50 +0000
@@ -8,7 +8,7 @@
8Package: launchpad-buildd8Package: launchpad-buildd
9Section: misc9Section: misc
10Architecture: all10Architecture: all
11Depends: python-twisted-core, python-twisted-web, debootstrap, dpkg-dev, linux32, file, bzip2, sudo, ntpdate, adduser, apt-transport-https, lsb-release, apache2, ${misc:Depends}11Depends: 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}
12Description: Launchpad buildd slave12Description: Launchpad buildd slave
13 This is the launchpad buildd slave package. It contains everything needed to13 This is the launchpad buildd slave package. It contains everything needed to
14 get a launchpad buildd going apart from the database manipulation required to14 get a launchpad buildd going apart from the database manipulation required to