Merge lp:~cjwatson/launchpad-buildd/unhardcode-distribution into lp:launchpad-buildd

Proposed by Colin Watson
Status: Merged
Merged at revision: 134
Proposed branch: lp:~cjwatson/launchpad-buildd/unhardcode-distribution
Merge into: lp:launchpad-buildd
Diff against target: 143 lines (+41/-20)
5 files modified
debian/changelog (+6/-0)
debian/upgrade-config (+16/-0)
lpbuildd/binarypackage.py (+12/-15)
lpbuildd/tests/test_binarypackage.py (+6/-4)
template-buildd-slave.conf (+1/-1)
To merge this branch: bzr merge lp:~cjwatson/launchpad-buildd/unhardcode-distribution
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+228114@code.launchpad.net

Commit message

Expect a "distribution" argument in binarypackage and pass it to sbuild's --archive option (LP: #1348077).

Description of the change

The other half of https://code.launchpad.net/~cjwatson/launchpad/bpbb-distribution/+merge/228093; if we get a "distribution" argument from the master for a binarypackage build, pass it to sbuild's (misnamed) --archive option. This will end up in the Distribution field in ddebs.txt, as well as in the no-longer-used translations.txt, removing ambiguity from the interface with ddeb-retriever.

To post a comment you must log in.
132. By Colin Watson

Launchpad always passes a "distribution" argument now.

133. By Colin Watson

Merge trunk.

134. By Colin Watson

Remove the hardcoded --archive=ubuntu from the configuration file.

Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-08-06 07:10:48 +0000
3+++ debian/changelog 2014-08-06 08:01:43 +0000
4@@ -3,6 +3,12 @@
5 [ Colin Watson ]
6 * Build with dpkg-deb -Zgzip, so that the resulting .deb can still be
7 installed on lucid.
8+ * Drop support for running binarypackage builds without a "suite"
9+ argument; Launchpad has passed this for all binarypackage builds since
10+ 2007.
11+ * Expect a "distribution" argument in binarypackage and pass it to
12+ sbuild's --archive option (LP: #1348077). Remove the hardcoded
13+ --archive=ubuntu from the configuration file.
14
15 [ William Grant ]
16 * Remove the 1GB RLIMIT_AS for recipe builds. All virtual builders now have
17
18=== modified file 'debian/upgrade-config'
19--- debian/upgrade-config 2013-12-13 14:02:02 +0000
20+++ debian/upgrade-config 2014-08-06 08:01:43 +0000
21@@ -142,6 +142,20 @@
22 in_file.close()
23 out_file.close()
24
25+def upgrade_to_126():
26+ print "Upgrading %s to version 126" % conf_file
27+ subprocess.call(["mv", conf_file, conf_file+"-prev126~"])
28+ in_file = open(conf_file+"-prev126~", "r")
29+ out_file = open(conf_file, "w")
30+ archive_ubuntu = " --archive=ubuntu"
31+ for line in in_file:
32+ line = line.rstrip("\n")
33+ if line.endswith(archive_ubuntu):
34+ line = line[:-len(archive_ubuntu)]
35+ out_file.write(line + "\n")
36+ in_file.close()
37+ out_file.close()
38+
39 if __name__ == "__main__":
40 old_version = re.sub(r'[~-].*', '', old_version)
41 if int(old_version) < 12:
42@@ -164,3 +178,5 @@
43 upgrade_to_115()
44 if int(old_version) < 120:
45 upgrade_to_120()
46+ if int(old_version) < 126:
47+ upgrade_to_126()
48
49=== modified file 'lpbuildd/binarypackage.py'
50--- lpbuildd/binarypackage.py 2013-10-04 01:05:00 +0000
51+++ lpbuildd/binarypackage.py 2014-08-06 08:01:43 +0000
52@@ -56,7 +56,8 @@
53 raise ValueError, files
54
55 self.archive_purpose = extra_args.get('archive_purpose')
56- self.suite = extra_args.get('suite')
57+ self.distribution = extra_args['distribution']
58+ self.suite = extra_args['suite']
59 self.component = extra_args['ogrecomponent']
60 self.arch_indep = extra_args.get('arch_indep', False)
61 self.build_debug_symbols = extra_args.get('build_debug_symbols', False)
62@@ -67,23 +68,19 @@
63 def doRunBuild(self):
64 """Run the sbuild process to build the package."""
65 args = ["sbuild-package", self._buildid, self.arch_tag]
66- if self.suite:
67- args.extend([self.suite])
68- args.extend(self._sbuildargs)
69- args.extend(["--dist=" + self.suite])
70- else:
71- args.extend(['autobuild'])
72- args.extend(self._sbuildargs)
73- args.extend(["--dist=autobuild"])
74+ args.append(self.suite)
75+ args.extend(self._sbuildargs)
76+ args.append("--archive=" + self.distribution)
77+ args.append("--dist=" + self.suite)
78 if self.arch_indep:
79- args.extend(["-A"])
80+ args.append("-A")
81 if self.archive_purpose:
82- args.extend(["--purpose=" + self.archive_purpose])
83+ args.append("--purpose=" + self.archive_purpose)
84 if self.build_debug_symbols:
85- args.extend(["--build-debug-symbols"])
86- args.extend(["--architecture=" + self.arch_tag])
87- args.extend(["--comp=" + self.component])
88- args.extend([self._dscfile])
89+ args.append("--build-debug-symbols")
90+ args.append("--architecture=" + self.arch_tag)
91+ args.append("--comp=" + self.component)
92+ args.append(self._dscfile)
93 self.runSubProcess( self._sbuildpath, args )
94
95 def iterate_SBUILD(self, success):
96
97=== modified file 'lpbuildd/tests/test_binarypackage.py'
98--- lpbuildd/tests/test_binarypackage.py 2014-05-04 21:35:37 +0000
99+++ lpbuildd/tests/test_binarypackage.py 2014-08-06 08:01:43 +0000
100@@ -77,7 +77,8 @@
101 # after INIT.
102 self.buildmanager.initiate(
103 {'foo_1.dsc': ''}, 'chroot.tar.gz',
104- {'suite': 'warty', 'ogrecomponent': 'main'})
105+ {'distribution': 'ubuntu', 'suite': 'warty',
106+ 'ogrecomponent': 'main'})
107
108 # Skip DebianBuildManager states to the state directly before
109 # SBUILD.
110@@ -88,8 +89,8 @@
111 self.assertEqual(BinaryPackageBuildState.SBUILD, self.getState())
112 expected_command = [
113 'sbuildpath', 'sbuild-package', self.buildid, 'i386', 'warty',
114- 'sbuildargs', '--dist=warty', '--architecture=i386', '--comp=main',
115- 'foo_1.dsc',
116+ 'sbuildargs', '--archive=ubuntu', '--dist=warty',
117+ '--architecture=i386', '--comp=main', 'foo_1.dsc',
118 ]
119 self.assertEqual(expected_command, self.buildmanager.commands[-1])
120 self.assertEqual(
121@@ -212,7 +213,8 @@
122 # pretends that it was terminated by a signal.
123 self.buildmanager.initiate(
124 {'foo_1.dsc': ''}, 'chroot.tar.gz',
125- {'suite': 'warty', 'ogrecomponent': 'main'})
126+ {'distribution': 'ubuntu', 'suite': 'warty',
127+ 'ogrecomponent': 'main'})
128
129 self.buildmanager.abort()
130 expected_command = [
131
132=== modified file 'template-buildd-slave.conf'
133--- template-buildd-slave.conf 2013-11-02 19:56:38 +0000
134+++ template-buildd-slave.conf 2014-08-06 08:01:43 +0000
135@@ -23,7 +23,7 @@
136
137 [binarypackagemanager]
138 sbuildpath = /usr/share/launchpad-buildd/slavebin/sbuild-package
139-sbuildargs = --nolog --batch --archive=ubuntu
140+sbuildargs = --nolog --batch
141
142 [sourcepackagerecipemanager]
143 buildrecipepath = /usr/share/launchpad-buildd/slavebin/buildrecipe

Subscribers

People subscribed via source and target branches

to all changes: