Merge lp:~michael.nelson/launchpad/506292-binarypackagebuild-rename into lp:launchpad
- 506292-binarypackagebuild-rename
- Merge into devel
Proposed by
Michael Nelson
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Julian Edwards | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | not available | ||||
Proposed branch: | lp:~michael.nelson/launchpad/506292-binarypackagebuild-rename | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
3064 lines (+446/-381) 64 files modified
lib/canonical/launchpad/database/__init__.py (+1/-1) lib/canonical/launchpad/interfaces/__init__.py (+1/-1) lib/canonical/launchpad/interfaces/_schema_circular_imports.py (+4/-3) lib/canonical/launchpad/security.py (+9/-7) lib/canonical/launchpad/webapp/configure.zcml (+2/-2) lib/lp/archiveuploader/nascentuploadfile.py (+2/-2) lib/lp/archiveuploader/tests/test_securityuploads.py (+3/-3) lib/lp/buildmaster/doc/buildqueue.txt (+11/-11) lib/lp/buildmaster/model/builder.py (+8/-8) lib/lp/buildmaster/tests/test_builder.py (+8/-8) lib/lp/buildmaster/tests/test_buildqueue.py (+5/-5) lib/lp/buildmaster/tests/test_manager.py (+6/-6) lib/lp/registry/browser/person.py (+2/-2) lib/lp/registry/model/distribution.py (+9/-7) lib/lp/registry/model/distroseries.py (+4/-3) lib/lp/registry/model/sourcepackage.py (+4/-3) lib/lp/soyuz/browser/archive.py (+3/-2) lib/lp/soyuz/browser/build.py (+17/-14) lib/lp/soyuz/browser/builder.py (+2/-2) lib/lp/soyuz/browser/configure.zcml (+5/-5) lib/lp/soyuz/browser/distributionsourcepackagerelease.py (+3/-3) lib/lp/soyuz/browser/publishing.py (+1/-1) lib/lp/soyuz/browser/tests/archive-views.txt (+4/-2) lib/lp/soyuz/browser/tests/builder-views.txt (+3/-2) lib/lp/soyuz/configure.zcml (+14/-13) lib/lp/soyuz/doc/build-estimated-dispatch-time.txt (+3/-2) lib/lp/soyuz/doc/build-failedtoupload-workflow.txt (+3/-2) lib/lp/soyuz/doc/build-notification.txt (+7/-5) lib/lp/soyuz/doc/build.txt (+36/-34) lib/lp/soyuz/doc/buildd-dispatching.txt (+5/-4) lib/lp/soyuz/doc/buildd-scoring.txt (+3/-2) lib/lp/soyuz/doc/buildd-slavescanner.txt (+24/-19) lib/lp/soyuz/doc/distroarchseriesbinarypackage.txt (+3/-3) lib/lp/soyuz/doc/gina-multiple-arch.txt (+4/-4) lib/lp/soyuz/doc/gina.txt (+4/-4) lib/lp/soyuz/doc/queuebuilder.txt (+10/-7) lib/lp/soyuz/doc/sourcepackagerelease.txt (+2/-2) lib/lp/soyuz/doc/soyuz-set-of-uploads.txt (+6/-5) lib/lp/soyuz/interfaces/binarypackagebuild.py (+12/-10) lib/lp/soyuz/interfaces/buildfarmbuildjob.py (+2/-2) lib/lp/soyuz/interfaces/buildpackagejob.py (+2/-2) lib/lp/soyuz/model/archive.py (+18/-15) lib/lp/soyuz/model/binarypackagebuild.py (+47/-41) lib/lp/soyuz/model/binarypackagerelease.py (+2/-1) lib/lp/soyuz/model/buildpackagejob.py (+3/-3) lib/lp/soyuz/model/distributionsourcepackagerelease.py (+10/-8) lib/lp/soyuz/model/distroarchseries.py (+4/-3) lib/lp/soyuz/model/publishedpackage.py (+1/-1) lib/lp/soyuz/model/publishing.py (+40/-31) lib/lp/soyuz/model/queue.py (+1/-1) lib/lp/soyuz/model/sourcepackagerelease.py (+5/-5) lib/lp/soyuz/scripts/buildd.py (+7/-5) lib/lp/soyuz/scripts/gina/handlers.py (+3/-3) lib/lp/soyuz/scripts/packagecopier.py (+1/-1) lib/lp/soyuz/scripts/tests/test_buildd_cronscripts.py (+4/-4) lib/lp/soyuz/scripts/tests/test_copypackage.py (+2/-3) lib/lp/soyuz/scripts/tests/test_populatearchive.py (+6/-5) lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt (+4/-2) lib/lp/soyuz/stories/soyuz/xx-binarypackagerelease-index.txt (+3/-2) lib/lp/soyuz/stories/soyuz/xx-build-record.txt (+4/-2) lib/lp/soyuz/stories/webservice/xx-builds.txt (+7/-6) lib/lp/soyuz/tests/test_archive.py (+2/-2) lib/lp/soyuz/tests/test_build.py (+13/-12) lib/lp/soyuz/tests/test_buildpackagejob.py (+2/-2) |
||||
To merge this branch: | bzr merge lp:~michael.nelson/launchpad/506292-binarypackagebuild-rename | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julian Edwards (community) | code rs | Approve | |
Canonical Launchpad Engineering | Pending | ||
Review via email: mp+23226@code.launchpad.net |
Commit message
Rename soyuz's Build class (and interface/sets) to BinaryPackageBuild.
Description of the change
This branch renames the soyuz Build class (and it's interfaces, sets) to BinaryPackageBuild.
It ensures that the API resource_type is still #build for the moment just to ensure there are no changes to the API.
I'm not expecting a normal review, but bigjools will take a quick look and rs it if he's happy with it.
To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote : | # |
review:
Approve
(code rs)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/canonical/launchpad/database/__init__.py' |
2 | --- lib/canonical/launchpad/database/__init__.py 2010-03-05 13:52:32 +0000 |
3 | +++ lib/canonical/launchpad/database/__init__.py 2010-04-13 06:59:32 +0000 |
4 | @@ -20,7 +20,7 @@ |
5 | from lp.soyuz.model.distroarchseriesbinarypackage import * |
6 | from lp.soyuz.model.distroarchseriesbinarypackagerelease import * |
7 | from lp.soyuz.model.processor import * |
8 | -from lp.soyuz.model.build import * |
9 | +from lp.soyuz.model.binarypackagebuild import * |
10 | from lp.buildmaster.model.builder import * |
11 | from lp.soyuz.model.publishing import * |
12 | from lp.soyuz.model.files import * |
13 | |
14 | === modified file 'lib/canonical/launchpad/interfaces/__init__.py' |
15 | --- lib/canonical/launchpad/interfaces/__init__.py 2010-03-05 13:52:32 +0000 |
16 | +++ lib/canonical/launchpad/interfaces/__init__.py 2010-04-13 06:59:32 +0000 |
17 | @@ -42,7 +42,7 @@ |
18 | from lp.bugs.interfaces.bugtarget import * |
19 | from lp.bugs.interfaces.bugtracker import * |
20 | from lp.bugs.interfaces.bugwatch import * |
21 | -from lp.soyuz.interfaces.build import * |
22 | +from lp.soyuz.interfaces.binarypackagebuild import * |
23 | from lp.buildmaster.interfaces.builder import * |
24 | from lp.soyuz.interfaces.buildrecords import * |
25 | from lp.registry.interfaces.codeofconduct import * |
26 | |
27 | === modified file 'lib/canonical/launchpad/interfaces/_schema_circular_imports.py' |
28 | --- lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2010-04-06 20:17:04 +0000 |
29 | +++ lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2010-04-13 06:59:32 +0000 |
30 | @@ -32,7 +32,7 @@ |
31 | from lp.bugs.interfaces.bugtracker import IBugTracker |
32 | from lp.bugs.interfaces.bugwatch import IBugWatch |
33 | from lp.buildmaster.interfaces.buildbase import BuildStatus |
34 | -from lp.soyuz.interfaces.build import IBuild |
35 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuild |
36 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
37 | from lp.blueprints.interfaces.specification import ISpecification |
38 | from lp.blueprints.interfaces.specificationbranch import ( |
39 | @@ -165,7 +165,7 @@ |
40 | 'params']['build_state'].vocabulary = BuildStatus |
41 | IHasBuildRecords['getBuildRecords'].queryTaggedValue( |
42 | LAZR_WEBSERVICE_EXPORTED)[ |
43 | - 'return_type'].value_type.schema = IBuild |
44 | + 'return_type'].value_type.schema = IBinaryPackageBuild |
45 | |
46 | ISourcePackage['distroseries'].schema = IDistroSeries |
47 | ISourcePackage['productseries'].schema = IProductSeries |
48 | @@ -185,7 +185,8 @@ |
49 | |
50 | # publishing.py |
51 | ISourcePackagePublishingHistoryPublic['getBuilds'].queryTaggedValue( |
52 | - LAZR_WEBSERVICE_EXPORTED)['return_type'].value_type.schema = IBuild |
53 | + LAZR_WEBSERVICE_EXPORTED)['return_type'].value_type.schema = ( |
54 | + IBinaryPackageBuild) |
55 | ISourcePackagePublishingHistoryPublic[ |
56 | 'getPublishedBinaries'].queryTaggedValue( |
57 | LAZR_WEBSERVICE_EXPORTED)[ |
58 | |
59 | === modified file 'lib/canonical/launchpad/security.py' |
60 | --- lib/canonical/launchpad/security.py 2010-03-25 08:48:14 +0000 |
61 | +++ lib/canonical/launchpad/security.py 2010-04-13 06:59:32 +0000 |
62 | @@ -73,7 +73,7 @@ |
63 | from lp.translations.interfaces.potemplate import IPOTemplate |
64 | from lp.soyuz.interfaces.binarypackagerelease import ( |
65 | IBinaryPackageReleaseDownloadCount) |
66 | -from lp.soyuz.interfaces.build import IBuild |
67 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuild |
68 | from lp.soyuz.interfaces.buildfarmbuildjob import IBuildFarmBuildJob |
69 | from lp.soyuz.interfaces.publishing import ( |
70 | IBinaryPackagePublishingHistory, IPublishingEdit, |
71 | @@ -1436,12 +1436,12 @@ |
72 | |
73 | |
74 | class AdminBuildRecord(AdminByBuilddAdmin): |
75 | - usedfor = IBuild |
76 | + usedfor = IBinaryPackageBuild |
77 | |
78 | |
79 | class EditBuildRecord(AdminByBuilddAdmin): |
80 | permission = 'launchpad.Edit' |
81 | - usedfor = IBuild |
82 | + usedfor = IBinaryPackageBuild |
83 | |
84 | def checkAuthenticated(self, user): |
85 | """Check write access for user and different kinds of archives. |
86 | @@ -1476,8 +1476,9 @@ |
87 | class ViewBuildRecord(EditBuildRecord): |
88 | permission = 'launchpad.View' |
89 | |
90 | - # This code MUST match the logic in IBuildSet.getBuildsForBuilder() |
91 | - # otherwise users are likely to get 403 errors, or worse. |
92 | + # This code MUST match the logic in |
93 | + # IBinaryPackageBuildSet.getBuildsForBuilder() otherwise users are |
94 | + # likely to get 403 errors, or worse. |
95 | def checkAuthenticated(self, user): |
96 | """Private restricts to admins and archive members.""" |
97 | if not self.obj.archive.private: |
98 | @@ -1518,7 +1519,7 @@ |
99 | """Permission to view an `IBuildFarmJob`. |
100 | |
101 | This permission is based entirely on permission to view the |
102 | - associated `IBuild` and/or `IBranch`. |
103 | + associated `IBinaryPackageBuild` and/or `IBranch`. |
104 | """ |
105 | permission = 'launchpad.View' |
106 | usedfor = IBuildFarmJob |
107 | @@ -2176,7 +2177,8 @@ |
108 | usedfor = IBinaryPackagePublishingHistory |
109 | |
110 | |
111 | -class ViewBinaryPackageReleaseDownloadCount(ViewSourcePackagePublishingHistory): |
112 | +class ViewBinaryPackageReleaseDownloadCount( |
113 | + ViewSourcePackagePublishingHistory): |
114 | """Restrict viewing of binary package download counts.""" |
115 | usedfor = IBinaryPackageReleaseDownloadCount |
116 | |
117 | |
118 | === modified file 'lib/canonical/launchpad/webapp/configure.zcml' |
119 | --- lib/canonical/launchpad/webapp/configure.zcml 2010-03-23 19:07:44 +0000 |
120 | +++ lib/canonical/launchpad/webapp/configure.zcml 2010-04-13 06:59:32 +0000 |
121 | @@ -62,7 +62,7 @@ |
122 | <!-- lazr.batchnavigator hook --> |
123 | <adapter |
124 | factory='.batching.FiniteSequenceAdapter' /> |
125 | - |
126 | + |
127 | <adapter |
128 | factory='.batching.FiniteSequenceAdapter' |
129 | for='storm.zope.interfaces.ISQLObjectResultSet' /> |
130 | @@ -216,7 +216,7 @@ |
131 | /> |
132 | |
133 | <adapter |
134 | - for="lp.soyuz.interfaces.build.IBuild" |
135 | + for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild" |
136 | provides="zope.traversing.interfaces.IPathAdapter" |
137 | factory="canonical.launchpad.webapp.tales.BuildImageDisplayAPI" |
138 | name="image" |
139 | |
140 | === modified file 'lib/lp/archiveuploader/nascentuploadfile.py' |
141 | --- lib/lp/archiveuploader/nascentuploadfile.py 2010-03-06 04:57:40 +0000 |
142 | +++ lib/lp/archiveuploader/nascentuploadfile.py 2010-04-13 06:59:32 +0000 |
143 | @@ -39,7 +39,7 @@ |
144 | IBinaryPackageNameSet) |
145 | from lp.soyuz.interfaces.binarypackagerelease import ( |
146 | BinaryPackageFormat) |
147 | -from lp.soyuz.interfaces.build import IBuildSet |
148 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
149 | from lp.soyuz.interfaces.component import IComponentSet |
150 | from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet |
151 | from lp.soyuz.interfaces.queue import ( |
152 | @@ -817,7 +817,7 @@ |
153 | status=BuildStatus.FULLYBUILT) |
154 | self.logger.debug("Build %s created" % build.id) |
155 | else: |
156 | - build = getUtility(IBuildSet).getByBuildID(build_id) |
157 | + build = getUtility(IBinaryPackageBuildSet).getByBuildID(build_id) |
158 | self.logger.debug("Build %s found" % build.id) |
159 | # Ensure gathered binary is related to a FULLYBUILT build |
160 | # record. It will be check in slave-scanner procedure to |
161 | |
162 | === modified file 'lib/lp/archiveuploader/tests/test_securityuploads.py' |
163 | --- lib/lp/archiveuploader/tests/test_securityuploads.py 2010-01-07 06:29:36 +0000 |
164 | +++ lib/lp/archiveuploader/tests/test_securityuploads.py 2010-04-13 06:59:32 +0000 |
165 | @@ -14,7 +14,7 @@ |
166 | TestUploadProcessorBase) |
167 | from lp.archiveuploader.uploadprocessor import UploadProcessor |
168 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
169 | -from lp.soyuz.model.build import Build |
170 | +from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
171 | from lp.soyuz.model.processor import ProcessorFamily |
172 | from canonical.launchpad.interfaces import ( |
173 | IDistributionSet, PackageUploadStatus) |
174 | @@ -73,7 +73,7 @@ |
175 | # Set up the uploadprocessor with appropriate options and logger |
176 | self.uploadprocessor = UploadProcessor( |
177 | self.options, self.layer.txn, self.log) |
178 | - self.builds_before_upload = Build.select().count() |
179 | + self.builds_before_upload = BinaryPackageBuild.select().count() |
180 | self.source_queue = None |
181 | self._uploadSource() |
182 | self.log.lines = [] |
183 | @@ -81,7 +81,7 @@ |
184 | |
185 | def assertBuildsCreated(self, amount): |
186 | """Assert that a given 'amount' of build records was created.""" |
187 | - builds_count = Build.select().count() |
188 | + builds_count = BinaryPackageBuild.select().count() |
189 | self.assertEqual( |
190 | self.builds_before_upload + amount, builds_count) |
191 | |
192 | |
193 | === modified file 'lib/lp/buildmaster/doc/buildqueue.txt' |
194 | --- lib/lp/buildmaster/doc/buildqueue.txt 2010-03-07 04:06:22 +0000 |
195 | +++ lib/lp/buildmaster/doc/buildqueue.txt 2010-04-13 06:59:32 +0000 |
196 | @@ -31,8 +31,8 @@ |
197 | The IBuild record related to this job is provided by the 'build' |
198 | attribute: |
199 | |
200 | - >>> from lp.soyuz.interfaces.build import IBuildSet |
201 | - >>> build = getUtility(IBuildSet).getByQueueEntry(bq) |
202 | + >>> from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
203 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bq) |
204 | >>> build.id |
205 | 8 |
206 | >>> build.buildstate.name |
207 | @@ -124,7 +124,7 @@ |
208 | True |
209 | >>> print job.logtail |
210 | Dummy sampledata entry, not processing |
211 | - >>> build = getUtility(IBuildSet).getByQueueEntry(job) |
212 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(job) |
213 | >>> print build.buildstate.name |
214 | BUILDING |
215 | >>> print job.lastscore |
216 | @@ -255,8 +255,8 @@ |
217 | Note that the results are ordered by descending BuildQueue.lastscore |
218 | and restricted |
219 | |
220 | - >>> for bq in getUtility(IBuildSet).calculateCandidates(archseries): |
221 | - ... build = getUtility(IBuildSet).getByQueueEntry(bq) |
222 | + >>> for bq in getUtility(IBinaryPackageBuildSet).calculateCandidates(archseries): |
223 | + ... build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bq) |
224 | ... print "%s (%s, %d)" % (build.title, bq.lastscore, bq.id) |
225 | hppa build of pmount 0.1-2 in ubuntu hoary RELEASE (1500, 4) |
226 | i386 build of alsa-utils 1.0.9a-4ubuntu1 in ubuntu hoary RELEASE (1000, 2) |
227 | @@ -287,8 +287,8 @@ |
228 | The fake language pack will be queued behind the other source packages |
229 | as intended. |
230 | |
231 | - >>> for bq in getUtility(IBuildSet).calculateCandidates(archseries): |
232 | - ... build = getUtility(IBuildSet).getByQueueEntry(bq) |
233 | + >>> for bq in getUtility(IBinaryPackageBuildSet).calculateCandidates(archseries): |
234 | + ... build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bq) |
235 | ... print "%s (%s, %d)" % (build.title, bq.lastscore, bq.id) |
236 | hppa build of pmount 0.1-2 in ubuntu hoary RELEASE (1500, 4) |
237 | i386 build of alsa-utils 1.0.9a-4ubuntu1 in ubuntu hoary RELEASE (1000, 2) |
238 | @@ -299,8 +299,8 @@ |
239 | Restricting the domain to only hoary/hppa: |
240 | |
241 | >>> archseries = [hoary['hppa']] |
242 | - >>> for bq in getUtility(IBuildSet).calculateCandidates(archseries): |
243 | - ... build = getUtility(IBuildSet).getByQueueEntry(bq) |
244 | + >>> for bq in getUtility(IBinaryPackageBuildSet).calculateCandidates(archseries): |
245 | + ... build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bq) |
246 | ... print "%s (%s, %d)" % (build.title, bq.lastscore, bq.id) |
247 | hppa build of pmount 0.1-2 in ubuntu hoary RELEASE (1500, 4) |
248 | hppa build of alsa-utils 1.0.9a-4 in ubuntu hoary RELEASE (500, 3) |
249 | @@ -308,12 +308,12 @@ |
250 | This method asserts a valid 'archseries' argument, None or an empty |
251 | list will result in a AssertionFailure. |
252 | |
253 | - >>> getUtility(IBuildSet).calculateCandidates(None).count() |
254 | + >>> getUtility(IBinaryPackageBuildSet).calculateCandidates(None).count() |
255 | Traceback (most recent call last): |
256 | ... |
257 | AssertionError: Given 'archseries' cannot be None/empty. |
258 | |
259 | - >>> getUtility(IBuildSet).calculateCandidates([]).count() |
260 | + >>> getUtility(IBinaryPackageBuildSet).calculateCandidates([]).count() |
261 | Traceback (most recent call last): |
262 | ... |
263 | AssertionError: Given 'archseries' cannot be None/empty. |
264 | |
265 | === modified file 'lib/lp/buildmaster/model/builder.py' |
266 | --- lib/lp/buildmaster/model/builder.py 2010-04-12 05:52:01 +0000 |
267 | +++ lib/lp/buildmaster/model/builder.py 2010-04-13 06:59:32 +0000 |
268 | @@ -55,7 +55,7 @@ |
269 | # XXX Michael Nelson 2010-01-13 bug=491330 |
270 | # These dependencies on soyuz will be removed when getBuildRecords() |
271 | # is moved. |
272 | -from lp.soyuz.interfaces.build import IBuildSet |
273 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
274 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
275 | from lp.soyuz.model.buildpackagejob import BuildPackageJob |
276 | |
277 | @@ -428,7 +428,7 @@ |
278 | def getBuildRecords(self, build_state=None, name=None, arch_tag=None, |
279 | user=None): |
280 | """See IHasBuildRecords.""" |
281 | - return getUtility(IBuildSet).getBuildsForBuilder( |
282 | + return getUtility(IBinaryPackageBuildSet).getBuildsForBuilder( |
283 | self.id, build_state, name, arch_tag, user) |
284 | |
285 | def slaveStatus(self): |
286 | @@ -695,7 +695,7 @@ |
287 | """See `IBuilderSet`.""" |
288 | # Avoiding circular imports. |
289 | from lp.soyuz.model.archive import Archive |
290 | - from lp.soyuz.model.build import Build |
291 | + from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
292 | from lp.soyuz.model.distroarchseries import ( |
293 | DistroArchSeries) |
294 | from lp.soyuz.model.processor import Processor |
295 | @@ -703,7 +703,7 @@ |
296 | store = Store.of(processor) |
297 | origin = ( |
298 | Archive, |
299 | - Build, |
300 | + BinaryPackageBuild, |
301 | BuildPackageJob, |
302 | BuildQueue, |
303 | DistroArchSeries, |
304 | @@ -712,11 +712,11 @@ |
305 | queue = store.using(*origin).find( |
306 | BuildQueue, |
307 | BuildPackageJob.job == BuildQueue.jobID, |
308 | - BuildPackageJob.build == Build.id, |
309 | - Build.distroarchseries == DistroArchSeries.id, |
310 | - Build.archive == Archive.id, |
311 | + BuildPackageJob.build == BinaryPackageBuild.id, |
312 | + BinaryPackageBuild.distroarchseries == DistroArchSeries.id, |
313 | + BinaryPackageBuild.archive == Archive.id, |
314 | DistroArchSeries.processorfamilyID == Processor.familyID, |
315 | - Build.buildstate == BuildStatus.NEEDSBUILD, |
316 | + BinaryPackageBuild.buildstate == BuildStatus.NEEDSBUILD, |
317 | Archive._enabled == True, |
318 | Processor.id == processor.id, |
319 | Archive.require_virtualized == virtualized, |
320 | |
321 | === modified file 'lib/lp/buildmaster/tests/test_builder.py' |
322 | --- lib/lp/buildmaster/tests/test_builder.py 2010-03-06 04:57:40 +0000 |
323 | +++ lib/lp/buildmaster/tests/test_builder.py 2010-04-13 06:59:32 +0000 |
324 | @@ -18,7 +18,7 @@ |
325 | from lp.buildmaster.model.buildfarmjobbehavior import IdleBuildBehavior |
326 | from lp.buildmaster.model.buildqueue import BuildQueue |
327 | from lp.soyuz.interfaces.archive import ArchivePurpose |
328 | -from lp.soyuz.interfaces.build import IBuildSet |
329 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
330 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
331 | from lp.soyuz.model.binarypackagebuildbehavior import ( |
332 | BinaryPackageBuildBehavior) |
333 | @@ -88,7 +88,7 @@ |
334 | # Asking frog to find a candidate should give us the joesppa build. |
335 | next_job = removeSecurityProxy( |
336 | self.frog_builder)._findBuildCandidate() |
337 | - build = getUtility(IBuildSet).getByQueueEntry(next_job) |
338 | + build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(next_job) |
339 | self.assertEqual('joesppa', build.archive.name) |
340 | |
341 | # If bob is in a failed state the joesppa build is still |
342 | @@ -97,7 +97,7 @@ |
343 | self.bob_builder.manual = False |
344 | next_job = removeSecurityProxy( |
345 | self.frog_builder)._findBuildCandidate() |
346 | - build = getUtility(IBuildSet).getByQueueEntry(next_job) |
347 | + build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(next_job) |
348 | self.assertEqual('joesppa', build.archive.name) |
349 | |
350 | |
351 | @@ -178,7 +178,7 @@ |
352 | # A PPA cannot start a build if it would use 80% or more of the |
353 | # builders. |
354 | next_job = removeSecurityProxy(self.builder4)._findBuildCandidate() |
355 | - build = getUtility(IBuildSet).getByQueueEntry(next_job) |
356 | + build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(next_job) |
357 | self.failIfEqual('joesppa', build.archive.name) |
358 | |
359 | def test_findBuildCandidate_first_build_finished(self): |
360 | @@ -186,7 +186,7 @@ |
361 | # will be the next build candidate. |
362 | self.joe_builds[0].buildstate = BuildStatus.FAILEDTOBUILD |
363 | next_job = removeSecurityProxy(self.builder4)._findBuildCandidate() |
364 | - build = getUtility(IBuildSet).getByQueueEntry(next_job) |
365 | + build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(next_job) |
366 | self.failUnlessEqual('joesppa', build.archive.name) |
367 | |
368 | |
369 | @@ -198,7 +198,7 @@ |
370 | # If a ppa is private it will be able to have parallel builds |
371 | # for the one architecture. |
372 | next_job = removeSecurityProxy(self.builder4)._findBuildCandidate() |
373 | - build = getUtility(IBuildSet).getByQueueEntry(next_job) |
374 | + build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(next_job) |
375 | self.failUnlessEqual('joesppa', build.archive.name) |
376 | |
377 | |
378 | @@ -225,7 +225,7 @@ |
379 | |
380 | next_job = removeSecurityProxy( |
381 | self.frog_builder)._findBuildCandidate() |
382 | - build = getUtility(IBuildSet).getByQueueEntry(next_job) |
383 | + build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(next_job) |
384 | self.failUnlessEqual('primary', build.archive.name) |
385 | self.failUnlessEqual('gedit', build.sourcepackagerelease.name) |
386 | |
387 | @@ -235,7 +235,7 @@ |
388 | build.builder = self.frog_builder |
389 | next_job = removeSecurityProxy( |
390 | self.frog_builder)._findBuildCandidate() |
391 | - build = getUtility(IBuildSet).getByQueueEntry(next_job) |
392 | + build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(next_job) |
393 | self.failUnlessEqual('primary', build.archive.name) |
394 | self.failUnlessEqual('firefox', build.sourcepackagerelease.name) |
395 | |
396 | |
397 | === modified file 'lib/lp/buildmaster/tests/test_buildqueue.py' |
398 | --- lib/lp/buildmaster/tests/test_buildqueue.py 2010-03-19 13:58:27 +0000 |
399 | +++ lib/lp/buildmaster/tests/test_buildqueue.py 2010-04-13 06:59:32 +0000 |
400 | @@ -26,7 +26,7 @@ |
401 | from lp.soyuz.interfaces.archive import ArchivePurpose |
402 | from lp.soyuz.model.processor import ProcessorFamilySet |
403 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
404 | -from lp.soyuz.model.build import Build |
405 | +from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
406 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
407 | from lp.testing import TestCaseWithFactory |
408 | from lp.testing.fakemethod import FakeMethod |
409 | @@ -341,7 +341,7 @@ |
410 | |
411 | # First mark all builds in the sample data as already built. |
412 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
413 | - sample_data = store.find(Build) |
414 | + sample_data = store.find(BinaryPackageBuild) |
415 | for build in sample_data: |
416 | build.buildstate = BuildStatus.FULLYBUILT |
417 | store.flush() |
418 | @@ -637,7 +637,7 @@ |
419 | |
420 | # First mark all builds in the sample data as already built. |
421 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
422 | - sample_data = store.find(Build) |
423 | + sample_data = store.find(BinaryPackageBuild) |
424 | for build in sample_data: |
425 | build.buildstate = BuildStatus.FULLYBUILT |
426 | store.flush() |
427 | @@ -843,7 +843,7 @@ |
428 | |
429 | # First mark all builds in the sample data as already built. |
430 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
431 | - sample_data = store.find(Build) |
432 | + sample_data = store.find(BinaryPackageBuild) |
433 | for build in sample_data: |
434 | build.buildstate = BuildStatus.FULLYBUILT |
435 | store.flush() |
436 | @@ -922,7 +922,7 @@ |
437 | |
438 | # First mark all builds in the sample data as already built. |
439 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
440 | - sample_data = store.find(Build) |
441 | + sample_data = store.find(BinaryPackageBuild) |
442 | for build in sample_data: |
443 | build.buildstate = BuildStatus.FULLYBUILT |
444 | store.flush() |
445 | |
446 | === modified file 'lib/lp/buildmaster/tests/test_manager.py' |
447 | --- lib/lp/buildmaster/tests/test_manager.py 2010-04-12 05:52:01 +0000 |
448 | +++ lib/lp/buildmaster/tests/test_manager.py 2010-04-13 06:59:32 +0000 |
449 | @@ -7,7 +7,7 @@ |
450 | import transaction |
451 | import unittest |
452 | |
453 | -from twisted.internet import defer, task, reactor |
454 | +from twisted.internet import defer |
455 | from twisted.internet.error import ( |
456 | ConnectionClosed, ProcessTerminated, TimeoutError) |
457 | from twisted.python.failure import Failure |
458 | @@ -30,7 +30,7 @@ |
459 | ResetDispatchResult, buildd_success_result_map) |
460 | from lp.buildmaster.tests.harness import BuilddManagerTestSetup |
461 | from lp.registry.interfaces.distribution import IDistributionSet |
462 | -from lp.soyuz.interfaces.build import IBuildSet |
463 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
464 | from lp.soyuz.tests.soyuzbuilddhelpers import BuildingSlave |
465 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
466 | |
467 | @@ -509,7 +509,7 @@ |
468 | self.assertEqual(job.builder, builder) |
469 | self.assertTrue(job.date_started is not None) |
470 | self.assertEqual(job.job.status, JobStatus.RUNNING) |
471 | - build = getUtility(IBuildSet).getByQueueEntry(job) |
472 | + build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(job) |
473 | self.assertEqual(build.buildstate, BuildStatus.BUILDING) |
474 | self.assertEqual(job.logtail, logtail) |
475 | |
476 | @@ -633,7 +633,7 @@ |
477 | job = getUtility(IBuildQueueSet).get(job.id) |
478 | self.assertTrue(job.builder is None) |
479 | self.assertTrue(job.date_started is None) |
480 | - build = getUtility(IBuildSet).getByQueueEntry(job) |
481 | + build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(job) |
482 | self.assertEqual(build.buildstate, BuildStatus.NEEDSBUILD) |
483 | |
484 | def testScanRescuesJobFromBrokenBuilder(self): |
485 | @@ -717,7 +717,7 @@ |
486 | builder.builderok = True |
487 | |
488 | job = builder.currentjob |
489 | - build = getUtility(IBuildSet).getByQueueEntry(job) |
490 | + build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(job) |
491 | self.assertEqual( |
492 | 'i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE', |
493 | build.title) |
494 | @@ -734,7 +734,7 @@ |
495 | def assertJobIsClean(self, job_id): |
496 | """Re-fetch the `IBuildQueue` record and check if it's clean.""" |
497 | job = getUtility(IBuildQueueSet).get(job_id) |
498 | - build = getUtility(IBuildSet).getByQueueEntry(job) |
499 | + build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(job) |
500 | self.assertEqual('NEEDSBUILD', build.buildstate.name) |
501 | self.assertEqual(None, job.builder) |
502 | self.assertEqual(None, job.date_started) |
503 | |
504 | === modified file 'lib/lp/registry/browser/person.py' |
505 | --- lib/lp/registry/browser/person.py 2010-04-06 20:17:04 +0000 |
506 | +++ lib/lp/registry/browser/person.py 2010-04-13 06:59:32 +0000 |
507 | @@ -173,7 +173,7 @@ |
508 | IBranchNamespaceSet, InvalidNamespace) |
509 | from lp.bugs.interfaces.bugtask import IBugTaskSet |
510 | from lp.buildmaster.interfaces.buildbase import BuildStatus |
511 | -from lp.soyuz.interfaces.build import IBuildSet |
512 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
513 | from canonical.launchpad.interfaces.launchpad import ( |
514 | ILaunchpadCelebrities, INotificationRecipientSet, UnknownRecipientError) |
515 | from canonical.launchpad.interfaces.message import ( |
516 | @@ -5189,7 +5189,7 @@ |
517 | the source package release. |
518 | """ |
519 | # Calculate all the failed builds with one query. |
520 | - build_set = getUtility(IBuildSet) |
521 | + build_set = getUtility(IBinaryPackageBuildSet) |
522 | package_release_ids = [ |
523 | package_release.id for package_release in package_releases] |
524 | all_builds = build_set.getBuildsBySourcePackageRelease( |
525 | |
526 | === modified file 'lib/lp/registry/model/distribution.py' |
527 | --- lib/lp/registry/model/distribution.py 2010-04-10 09:24:41 +0000 |
528 | +++ lib/lp/registry/model/distribution.py 2010-04-13 06:59:32 +0000 |
529 | @@ -39,7 +39,7 @@ |
530 | from lp.bugs.model.bugtarget import ( |
531 | BugTargetBase, HasBugHeatMixin, OfficialBugTagTargetMixin) |
532 | from lp.bugs.model.bugtask import BugTask |
533 | -from lp.soyuz.model.build import Build |
534 | +from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
535 | from lp.registry.model.distributionmirror import DistributionMirror |
536 | from lp.registry.model.distributionsourcepackage import ( |
537 | DistributionSourcePackage) |
538 | @@ -81,7 +81,7 @@ |
539 | from lp.bugs.interfaces.bugtarget import IHasBugHeat |
540 | from lp.bugs.interfaces.bugtask import ( |
541 | BugTaskStatus, UNRESOLVED_BUGTASK_STATUSES) |
542 | -from lp.soyuz.interfaces.build import IBuildSet |
543 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
544 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
545 | from lp.registry.interfaces.distribution import ( |
546 | IBaseDistribution, IDerivativeDistribution, IDistribution, |
547 | @@ -799,8 +799,9 @@ |
548 | arch_ids = DistroArchSeriesSet().getIdsForArchitectures( |
549 | self.architectures, arch_tag) |
550 | |
551 | - # Use the facility provided by IBuildSet to retrieve the records. |
552 | - return getUtility(IBuildSet).getBuildsByArchIds( |
553 | + # Use the facility provided by IBinaryPackageBuildSet to |
554 | + # retrieve the records. |
555 | + return getUtility(IBinaryPackageBuildSet).getBuildsByArchIds( |
556 | arch_ids, build_state, name, pocket) |
557 | |
558 | def getSourcePackageCaches(self, archive=None): |
559 | @@ -1058,9 +1059,10 @@ |
560 | DistroSeries.status != SeriesStatus.OBSOLETE, |
561 | BinaryPackageRelease.binarypackagename == BinaryPackageName.id, |
562 | DistroArchSeries.distroseries == DistroSeries.id, |
563 | - Build.distroarchseries == DistroArchSeries.id, |
564 | - BinaryPackageRelease.build == Build.id, |
565 | - Build.sourcepackagerelease == SourcePackageRelease.id, |
566 | + BinaryPackageBuild.distroarchseries == DistroArchSeries.id, |
567 | + BinaryPackageRelease.build == BinaryPackageBuild.id, |
568 | + (BinaryPackageBuild.sourcepackagerelease == |
569 | + SourcePackageRelease.id), |
570 | SourcePackageRelease.sourcepackagename == SourcePackageName.id, |
571 | DistributionSourcePackageCache.sourcepackagename == |
572 | SourcePackageName.id, |
573 | |
574 | === modified file 'lib/lp/registry/model/distroseries.py' |
575 | --- lib/lp/registry/model/distroseries.py 2010-04-08 18:40:18 +0000 |
576 | +++ lib/lp/registry/model/distroseries.py 2010-04-13 06:59:32 +0000 |
577 | @@ -90,7 +90,7 @@ |
578 | from canonical.launchpad.helpers import shortlist |
579 | from lp.soyuz.interfaces.archive import ( |
580 | ALLOW_RELEASE_BUILDS, ArchivePurpose, IArchiveSet, MAIN_ARCHIVE_PURPOSES) |
581 | -from lp.soyuz.interfaces.build import IBuildSet |
582 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
583 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
584 | from lp.soyuz.interfaces.binarypackagename import ( |
585 | IBinaryPackageName) |
586 | @@ -1110,8 +1110,9 @@ |
587 | arch_ids = DistroArchSeriesSet().getIdsForArchitectures( |
588 | self.architectures, arch_tag) |
589 | |
590 | - # Use the facility provided by IBuildSet to retrieve the records. |
591 | - return getUtility(IBuildSet).getBuildsByArchIds( |
592 | + # Use the facility provided by IBinaryPackageBuildSet to |
593 | + # retrieve the records. |
594 | + return getUtility(IBinaryPackageBuildSet).getBuildsByArchIds( |
595 | arch_ids, build_state, name, pocket) |
596 | |
597 | def createUploadedSourcePackageRelease( |
598 | |
599 | === modified file 'lib/lp/registry/model/sourcepackage.py' |
600 | --- lib/lp/registry/model/sourcepackage.py 2010-03-19 11:13:00 +0000 |
601 | +++ lib/lp/registry/model/sourcepackage.py 2010-04-13 06:59:32 +0000 |
602 | @@ -29,7 +29,8 @@ |
603 | from lp.bugs.model.bugtarget import BugTargetBase, HasBugHeatMixin |
604 | from lp.bugs.model.bugtask import BugTask |
605 | from lp.soyuz.interfaces.archive import IArchiveSet, ArchivePurpose |
606 | -from lp.soyuz.model.build import Build, BuildSet |
607 | +from lp.soyuz.model.binarypackagebuild import ( |
608 | + BinaryPackageBuild, BinaryPackageBuildSet) |
609 | from lp.soyuz.model.distributionsourcepackagerelease import ( |
610 | DistributionSourcePackageRelease) |
611 | from lp.soyuz.model.distroseriessourcepackagerelease import ( |
612 | @@ -530,7 +531,7 @@ |
613 | # We re-use the optional-parameter handling provided by BuildSet |
614 | # here, but pass None for the name argument as we've already |
615 | # matched on exact source package name. |
616 | - BuildSet().handleOptionalParamsForBuildQueries( |
617 | + BinaryPackageBuildSet().handleOptionalParamsForBuildQueries( |
618 | condition_clauses, clauseTables, build_state, name=None, |
619 | pocket=pocket, arch_tag=arch_tag) |
620 | |
621 | @@ -561,7 +562,7 @@ |
622 | |
623 | # End of duplication (see XXX cprov 2006-09-25 above). |
624 | |
625 | - return Build.select(' AND '.join(condition_clauses), |
626 | + return BinaryPackageBuild.select(' AND '.join(condition_clauses), |
627 | clauseTables=clauseTables, orderBy=orderBy) |
628 | |
629 | @property |
630 | |
631 | === modified file 'lib/lp/soyuz/browser/archive.py' |
632 | --- lib/lp/soyuz/browser/archive.py 2010-03-12 06:23:04 +0000 |
633 | +++ lib/lp/soyuz/browser/archive.py 2010-04-13 06:59:32 +0000 |
634 | @@ -64,7 +64,8 @@ |
635 | ArchivePermissionType, IArchivePermissionSet) |
636 | from lp.soyuz.interfaces.archivesubscriber import IArchiveSubscriberSet |
637 | from lp.soyuz.interfaces.binarypackagename import IBinaryPackageNameSet |
638 | -from lp.soyuz.interfaces.build import BuildSetStatus, IBuildSet |
639 | +from lp.soyuz.interfaces.binarypackagebuild import ( |
640 | + BuildSetStatus, IBinaryPackageBuildSet) |
641 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
642 | from lp.soyuz.interfaces.component import IComponentSet |
643 | from lp.registry.interfaces.series import SeriesStatus |
644 | @@ -192,7 +193,7 @@ |
645 | except ValueError: |
646 | return None |
647 | try: |
648 | - return getUtility(IBuildSet).getByBuildID(build_id) |
649 | + return getUtility(IBinaryPackageBuildSet).getByBuildID(build_id) |
650 | except NotFoundError: |
651 | return None |
652 | |
653 | |
654 | === modified file 'lib/lp/soyuz/browser/build.py' |
655 | --- lib/lp/soyuz/browser/build.py 2010-03-24 07:17:20 +0000 |
656 | +++ lib/lp/soyuz/browser/build.py 2010-04-13 06:59:32 +0000 |
657 | @@ -34,14 +34,15 @@ |
658 | from canonical.lazr.utils import safe_hasattr |
659 | from lp.buildmaster.interfaces.buildbase import BuildStatus |
660 | from lp.services.job.interfaces.job import JobStatus |
661 | -from lp.soyuz.interfaces.build import IBuild, IBuildRescoreForm, IBuildSet |
662 | +from lp.soyuz.interfaces.binarypackagebuild import ( |
663 | + IBinaryPackageBuild, IBuildRescoreForm, IBinaryPackageBuildSet) |
664 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
665 | from canonical.launchpad.interfaces.launchpad import UnexpectedFormData |
666 | from lp.soyuz.interfaces.queue import PackageUploadStatus |
667 | |
668 | |
669 | class BuildUrl: |
670 | - """Dynamic URL declaration for IBuild. |
671 | + """Dynamic URL declaration for IBinaryPackageBuild. |
672 | |
673 | When dealing with distribution builds we want to present them |
674 | under IDistributionSourcePackageRelease url: |
675 | @@ -74,19 +75,20 @@ |
676 | |
677 | |
678 | class BuildNavigation(GetitemNavigation, FileNavigationMixin): |
679 | - usedfor = IBuild |
680 | + usedfor = IBinaryPackageBuild |
681 | |
682 | |
683 | class BuildFacets(StandardLaunchpadFacets): |
684 | - """The links that will appear in the facet menu for an IBuild.""" |
685 | + """The links that will appear in the facet menu for an |
686 | + IBinaryPackageBuild.""" |
687 | enable_only = ['overview'] |
688 | |
689 | - usedfor = IBuild |
690 | + usedfor = IBinaryPackageBuild |
691 | |
692 | |
693 | class BuildContextMenu(ContextMenu): |
694 | """Overview menu for build records """ |
695 | - usedfor = IBuild |
696 | + usedfor = IBinaryPackageBuild |
697 | |
698 | links = ['ppa', 'records', 'retry', 'rescore'] |
699 | |
700 | @@ -123,7 +125,7 @@ |
701 | |
702 | |
703 | class BuildBreadcrumb(Breadcrumb): |
704 | - """Builds a breadcrumb for an `IBuild`.""" |
705 | + """Builds a breadcrumb for an `IBinaryPackageBuild`.""" |
706 | |
707 | @property |
708 | def text(self): |
709 | @@ -140,8 +142,8 @@ |
710 | |
711 | |
712 | class BuildView(LaunchpadView): |
713 | - """Auxiliary view class for IBuild""" |
714 | - __used_for__ = IBuild |
715 | + """Auxiliary view class for IBinaryPackageBuild""" |
716 | + __used_for__ = IBinaryPackageBuild |
717 | |
718 | @property |
719 | def label(self): |
720 | @@ -230,9 +232,9 @@ |
721 | |
722 | |
723 | class BuildRetryView(BuildView): |
724 | - """View class for retrying `IBuild`s""" |
725 | + """View class for retrying `IBinaryPackageBuild`s""" |
726 | |
727 | - __used_for__ = IBuild |
728 | + __used_for__ = IBinaryPackageBuild |
729 | |
730 | @property |
731 | def label(self): |
732 | @@ -293,8 +295,8 @@ |
733 | |
734 | |
735 | class CompleteBuild: |
736 | - """Super object to store related IBuild & IBuildQueue.""" |
737 | - delegates(IBuild) |
738 | + """Super object to store related IBinaryPackageBuild & IBuildQueue.""" |
739 | + delegates(IBinaryPackageBuild) |
740 | def __init__(self, build, buildqueue_record): |
741 | self.context = build |
742 | self._buildqueue_record = buildqueue_record |
743 | @@ -320,7 +322,8 @@ |
744 | |
745 | prefetched_data = dict() |
746 | build_ids = [build.id for build in builds] |
747 | - results = getUtility(IBuildSet).getQueueEntriesForBuildIDs(build_ids) |
748 | + results = getUtility(IBinaryPackageBuildSet).getQueueEntriesForBuildIDs( |
749 | + build_ids) |
750 | for (buildqueue, _builder, build_job) in results: |
751 | # Get the build's id, 'buildqueue', 'sourcepackagerelease' and |
752 | # 'buildlog' (from the result set) respectively. |
753 | |
754 | === modified file 'lib/lp/soyuz/browser/builder.py' |
755 | --- lib/lp/soyuz/browser/builder.py 2010-03-16 05:08:47 +0000 |
756 | +++ lib/lp/soyuz/browser/builder.py 2010-04-13 06:59:32 +0000 |
757 | @@ -29,7 +29,7 @@ |
758 | from canonical.lazr.utils import smartquote |
759 | from canonical.launchpad import _ |
760 | from lp.soyuz.browser.build import BuildRecordsView |
761 | -from lp.soyuz.interfaces.build import IBuildSet |
762 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
763 | from lp.buildmaster.interfaces.builder import IBuilderSet, IBuilder |
764 | from canonical.launchpad.interfaces.launchpad import NotFoundError |
765 | from canonical.launchpad.webapp import ( |
766 | @@ -52,7 +52,7 @@ |
767 | except ValueError: |
768 | return None |
769 | try: |
770 | - build = getUtility(IBuildSet).getByBuildID(build_id) |
771 | + build = getUtility(IBinaryPackageBuildSet).getByBuildID(build_id) |
772 | except NotFoundError: |
773 | return None |
774 | else: |
775 | |
776 | === modified file 'lib/lp/soyuz/browser/configure.zcml' |
777 | --- lib/lp/soyuz/browser/configure.zcml 2010-03-22 07:10:45 +0000 |
778 | +++ lib/lp/soyuz/browser/configure.zcml 2010-04-13 06:59:32 +0000 |
779 | @@ -335,17 +335,17 @@ |
780 | attribute_to_parent="archive" |
781 | urldata="lp.soyuz.browser.archivepermission.ArchivePermissionURL"/> |
782 | <browser:defaultView |
783 | - for="lp.soyuz.interfaces.build.IBuild" |
784 | + for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild" |
785 | name="+index"/> |
786 | <browser:url |
787 | - for="lp.soyuz.interfaces.build.IBuild" |
788 | + for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild" |
789 | urldata="lp.soyuz.browser.build.BuildUrl"/> |
790 | <browser:navigation |
791 | module="lp.soyuz.browser.build" |
792 | classes=" |
793 | BuildNavigation"/> |
794 | <browser:pages |
795 | - for="lp.soyuz.interfaces.build.IBuild" |
796 | + for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild" |
797 | class="lp.soyuz.browser.build.BuildView" |
798 | permission="launchpad.View"> |
799 | <browser:page |
800 | @@ -354,7 +354,7 @@ |
801 | template="../templates/build-index.pt"/> |
802 | </browser:pages> |
803 | <browser:pages |
804 | - for="lp.soyuz.interfaces.build.IBuild" |
805 | + for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild" |
806 | class="lp.soyuz.browser.build.BuildRetryView" |
807 | permission="launchpad.Edit"> |
808 | <browser:page |
809 | @@ -363,7 +363,7 @@ |
810 | template="../templates/build-retry.pt"/> |
811 | </browser:pages> |
812 | <browser:pages |
813 | - for="lp.soyuz.interfaces.build.IBuild" |
814 | + for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild" |
815 | class="lp.soyuz.browser.build.BuildRescoringView" |
816 | permission="launchpad.Admin"> |
817 | <browser:page |
818 | |
819 | === modified file 'lib/lp/soyuz/browser/distributionsourcepackagerelease.py' |
820 | --- lib/lp/soyuz/browser/distributionsourcepackagerelease.py 2010-03-08 13:07:07 +0000 |
821 | +++ lib/lp/soyuz/browser/distributionsourcepackagerelease.py 2010-04-13 06:59:32 +0000 |
822 | @@ -21,7 +21,7 @@ |
823 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb |
824 | from canonical.launchpad.webapp.interfaces import NotFoundError |
825 | from lp.archivepublisher.debversion import Version |
826 | -from lp.soyuz.interfaces.build import IBuildSet |
827 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
828 | from lp.soyuz.interfaces.distributionsourcepackagerelease import ( |
829 | IDistributionSourcePackageRelease) |
830 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
831 | @@ -47,7 +47,7 @@ |
832 | except ValueError: |
833 | return None |
834 | try: |
835 | - return getUtility(IBuildSet).getByBuildID(build_id) |
836 | + return getUtility(IBinaryPackageBuildSet).getByBuildID(build_id) |
837 | except NotFoundError: |
838 | return None |
839 | |
840 | @@ -119,7 +119,7 @@ |
841 | :return: a `list` of dictionaries containing 'distroseries' and its |
842 | grouped 'builds' ordered by descending distroseries versions. |
843 | """ |
844 | - # Build a local list of `IBuilds` ordered by ascending |
845 | + # Build a local list of `IBinaryPackageBuilds` ordered by ascending |
846 | # 'architecture_tag'. |
847 | cached_builds = sorted( |
848 | self.context.builds, key=operator.attrgetter('arch_tag')) |
849 | |
850 | === modified file 'lib/lp/soyuz/browser/publishing.py' |
851 | --- lib/lp/soyuz/browser/publishing.py 2009-06-25 04:06:00 +0000 |
852 | +++ lib/lp/soyuz/browser/publishing.py 2010-04-13 06:59:32 +0000 |
853 | @@ -18,7 +18,7 @@ |
854 | |
855 | from canonical.cachedproperty import cachedproperty |
856 | from canonical.launchpad.browser.librarian import ProxiedLibraryFileAlias |
857 | -from lp.soyuz.interfaces.build import BuildSetStatus |
858 | +from lp.soyuz.interfaces.binarypackagebuild import BuildSetStatus |
859 | from lp.soyuz.interfaces.packagediff import IPackageDiff |
860 | from lp.soyuz.interfaces.publishing import ( |
861 | PackagePublishingStatus, IBinaryPackagePublishingHistory, |
862 | |
863 | === modified file 'lib/lp/soyuz/browser/tests/archive-views.txt' |
864 | --- lib/lp/soyuz/browser/tests/archive-views.txt 2010-03-06 04:57:40 +0000 |
865 | +++ lib/lp/soyuz/browser/tests/archive-views.txt 2010-04-13 06:59:32 +0000 |
866 | @@ -356,13 +356,15 @@ |
867 | Let's set some builds appropriately to see the results. |
868 | |
869 | >>> from lp.buildmaster.interfaces.buildbase import BuildStatus |
870 | - >>> from lp.soyuz.interfaces.build import IBuildSet |
871 | + >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
872 | + ... IBinaryPackageBuildSet) |
873 | >>> warty_hppa = getUtility(IDistributionSet)['ubuntu']['warty']['hppa'] |
874 | >>> source = view.filtered_sources[0] |
875 | >>> ignore = source.sourcepackagerelease.createBuild( |
876 | ... distroarchseries=warty_hppa, archive=view.context, |
877 | ... pocket=source.pocket) |
878 | - >>> builds = getUtility(IBuildSet).getBuildsForArchive(view.context) |
879 | + >>> builds = getUtility(IBinaryPackageBuildSet).getBuildsForArchive( |
880 | + ... view.context) |
881 | >>> for build in builds: |
882 | ... print build.title |
883 | hppa build of cdrkit 1.0 in ubuntu warty RELEASE |
884 | |
885 | === modified file 'lib/lp/soyuz/browser/tests/builder-views.txt' |
886 | --- lib/lp/soyuz/browser/tests/builder-views.txt 2010-03-10 12:50:18 +0000 |
887 | +++ lib/lp/soyuz/browser/tests/builder-views.txt 2010-04-13 06:59:32 +0000 |
888 | @@ -2,7 +2,8 @@ |
889 | |
890 | >>> from zope.component import getMultiAdapter, getUtility |
891 | >>> from lp.buildmaster.interfaces.builder import IBuilderSet |
892 | - >>> from lp.soyuz.interfaces.build import IBuildSet |
893 | + >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
894 | + ... IBinaryPackageBuildSet) |
895 | >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest |
896 | |
897 | >>> builder = getUtility(IBuilderSet).get(1) |
898 | @@ -176,7 +177,7 @@ |
899 | >>> print frog.builderok |
900 | True |
901 | |
902 | - >>> build_set = getUtility(IBuildSet) |
903 | + >>> build_set = getUtility(IBinaryPackageBuildSet) |
904 | >>> build = build_set.getByQueueEntry(frog.currentjob) |
905 | >>> print build.title |
906 | i386 build of privacy-test 666 in ubuntutest breezy-autotest RELEASE |
907 | |
908 | === modified file 'lib/lp/soyuz/configure.zcml' |
909 | --- lib/lp/soyuz/configure.zcml 2010-03-24 17:07:08 +0000 |
910 | +++ lib/lp/soyuz/configure.zcml 2010-04-13 06:59:32 +0000 |
911 | @@ -406,7 +406,7 @@ |
912 | <require |
913 | permission="launchpad.Commercial" |
914 | set_attributes="authorized_size buildd_secret arm_builds_allowed |
915 | - external_dependencies private |
916 | + external_dependencies private |
917 | require_virtualized relative_build_score "/> |
918 | <require |
919 | permission="launchpad.Admin" |
920 | @@ -487,19 +487,19 @@ |
921 | deletePackagesetUploader"/> |
922 | </securedutility> |
923 | |
924 | - <!-- Build --> |
925 | + <!-- BinaryPackageBuild --> |
926 | |
927 | <class |
928 | - class="canonical.launchpad.database.Build"> |
929 | + class="lp.soyuz.model.binarypackagebuild.BinaryPackageBuild"> |
930 | <require |
931 | permission="launchpad.View" |
932 | - interface="lp.soyuz.interfaces.build.IBuildView"/> |
933 | + interface="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuildView"/> |
934 | <require |
935 | permission="launchpad.Edit" |
936 | - interface="lp.soyuz.interfaces.build.IBuildEdit"/> |
937 | + interface="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuildEdit"/> |
938 | <require |
939 | permission="launchpad.Admin" |
940 | - interface="lp.soyuz.interfaces.build.IBuildAdmin"/> |
941 | + interface="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuildAdmin"/> |
942 | |
943 | <!-- XXX cprov 2005-10-27 |
944 | |
945 | @@ -507,21 +507,22 @@ |
946 | |
947 | <require |
948 | permission="launchpad.Edit" |
949 | - set_attributes="buildlog datebuilt buildduration builder buildstate dependencies upload_log"/> |
950 | + set_attributes="buildlog datebuilt buildduration builder |
951 | + buildstate dependencies upload_log"/> |
952 | </class> |
953 | <adapter |
954 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
955 | - for="lp.soyuz.interfaces.build.IBuild" |
956 | + for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild" |
957 | factory="lp.soyuz.browser.build.BuildBreadcrumb" |
958 | permission="zope.Public"/> |
959 | |
960 | - <!-- BuildSet --> |
961 | + <!-- BinaryPackageBuildSet --> |
962 | |
963 | <securedutility |
964 | - class="canonical.launchpad.database.BuildSet" |
965 | - provides="lp.soyuz.interfaces.build.IBuildSet"> |
966 | + class="lp.soyuz.model.binarypackagebuild.BinaryPackageBuildSet" |
967 | + provides="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuildSet"> |
968 | <allow |
969 | - interface="lp.soyuz.interfaces.build.IBuildSet"/> |
970 | + interface="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuildSet"/> |
971 | </securedutility> |
972 | |
973 | <!-- DistroArchSeriesBinaryPackage --> |
974 | @@ -848,7 +849,7 @@ |
975 | <allow |
976 | interface="lp.soyuz.interfaces.buildpackagejob.IBuildPackageJob"/> |
977 | </class> |
978 | - <!-- |
979 | + <!-- |
980 | The registration below is used to discover all build farm job classes |
981 | that implement the `IBuildFarmJob` interface. Please see bug #503839 |
982 | for more detail. |
983 | |
984 | === modified file 'lib/lp/soyuz/doc/build-estimated-dispatch-time.txt' |
985 | --- lib/lp/soyuz/doc/build-estimated-dispatch-time.txt 2010-03-17 05:58:22 +0000 |
986 | +++ lib/lp/soyuz/doc/build-estimated-dispatch-time.txt 2010-04-13 06:59:32 +0000 |
987 | @@ -58,8 +58,9 @@ |
988 | >>> import pytz |
989 | >>> bob_the_builder = builder_set.get(1) |
990 | >>> cur_bqueue = bob_the_builder.currentjob |
991 | - >>> from lp.soyuz.interfaces.build import IBuildSet |
992 | - >>> cur_build = getUtility(IBuildSet).getByQueueEntry(cur_bqueue) |
993 | + >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
994 | + ... IBinaryPackageBuildSet) |
995 | + >>> cur_build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(cur_bqueue) |
996 | |
997 | Make sure the job at hand is currently being built. |
998 | |
999 | |
1000 | === modified file 'lib/lp/soyuz/doc/build-failedtoupload-workflow.txt' |
1001 | --- lib/lp/soyuz/doc/build-failedtoupload-workflow.txt 2010-03-26 19:22:58 +0000 |
1002 | +++ lib/lp/soyuz/doc/build-failedtoupload-workflow.txt 2010-04-13 06:59:32 +0000 |
1003 | @@ -16,9 +16,10 @@ |
1004 | buildmaster/slave-scanner code, an build notification will be issued. |
1005 | See more information in build-notification.txt file. |
1006 | |
1007 | - >>> from lp.soyuz.interfaces.build import IBuildSet |
1008 | + >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
1009 | + ... IBinaryPackageBuildSet) |
1010 | >>> from lp.testing.mail_helpers import pop_notifications |
1011 | - >>> buildset = getUtility(IBuildSet) |
1012 | + >>> buildset = getUtility(IBinaryPackageBuildSet) |
1013 | |
1014 | Let's use a sampledata build record in FAILEDTOUPLOAD: |
1015 | |
1016 | |
1017 | === modified file 'lib/lp/soyuz/doc/build-notification.txt' |
1018 | --- lib/lp/soyuz/doc/build-notification.txt 2010-03-26 17:31:48 +0000 |
1019 | +++ lib/lp/soyuz/doc/build-notification.txt 2010-04-13 06:59:32 +0000 |
1020 | @@ -2,9 +2,10 @@ |
1021 | Build Notification System |
1022 | ========================= |
1023 | |
1024 | -IBuild instance implements the 'notify' method which sends a status |
1025 | -report about the current record to the ISourcePackageRelease.creator |
1026 | -and the package uploader's preferred email address. |
1027 | +IBinaryPackageBuild instance implements the 'notify' method which sends |
1028 | +a status report about the current record to the |
1029 | +ISourcePackageRelease.creator and the package uploader's preferred email |
1030 | +address. |
1031 | |
1032 | We rely on get_contact_email_addresses() to DTRT, either use the |
1033 | Team.contactaddress of the Launchpad Buildd Celebrity or the |
1034 | @@ -15,9 +16,10 @@ |
1035 | All build states are supported by the current implementation, however |
1036 | only failures should be reported this time. |
1037 | |
1038 | - >>> from lp.soyuz.interfaces.build import IBuildSet |
1039 | + >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
1040 | + ... IBinaryPackageBuildSet) |
1041 | >>> from lp.testing.mail_helpers import pop_notifications |
1042 | - >>> buildset = getUtility(IBuildSet) |
1043 | + >>> buildset = getUtility(IBinaryPackageBuildSet) |
1044 | |
1045 | To avoid consequences of modified sampledata, specially if we add |
1046 | more builds for test we are going to pick a specific build record |
1047 | |
1048 | === modified file 'lib/lp/soyuz/doc/build.txt' |
1049 | --- lib/lp/soyuz/doc/build.txt 2010-03-26 19:22:58 +0000 |
1050 | +++ lib/lp/soyuz/doc/build.txt 2010-04-13 06:59:32 +0000 |
1051 | @@ -137,8 +137,9 @@ |
1052 | If the build does not have any uploads, None is returned: |
1053 | |
1054 | >>> from lp.buildmaster.interfaces.buildbase import BuildStatus |
1055 | - >>> from lp.soyuz.interfaces.build import IBuildSet |
1056 | - >>> at_build = getUtility(IBuildSet).getByBuildID(15) |
1057 | + >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
1058 | + ... IBinaryPackageBuildSet) |
1059 | + >>> at_build = getUtility(IBinaryPackageBuildSet).getByBuildID(15) |
1060 | >>> print at_build.package_upload |
1061 | None |
1062 | |
1063 | @@ -147,7 +148,7 @@ |
1064 | >>> firefox_build.can_be_retried |
1065 | False |
1066 | |
1067 | - >>> frozen_build = getUtility(IBuildSet).getByBuildID(9) |
1068 | + >>> frozen_build = getUtility(IBinaryPackageBuildSet).getByBuildID(9) |
1069 | >>> frozen_build.title |
1070 | u'i386 build of pmount 0.1-1 in ubuntu warty RELEASE' |
1071 | >>> frozen_build.buildstate.title |
1072 | @@ -155,12 +156,12 @@ |
1073 | >>> frozen_build.can_be_retried |
1074 | False |
1075 | |
1076 | -See section 'AssertionErrors in IBuild' for further documentation about |
1077 | -consequences of an denied 'retry' action. |
1078 | +See section 'AssertionErrors in IBinaryPackageBuild' for further |
1079 | +documentation about consequences of an denied 'retry' action. |
1080 | |
1081 | Let's retrieve a build record that can be retried. |
1082 | |
1083 | - >>> active_build = getUtility(IBuildSet).getByBuildID(9) |
1084 | + >>> active_build = getUtility(IBinaryPackageBuildSet).getByBuildID(9) |
1085 | |
1086 | >>> print active_build.title |
1087 | i386 build of pmount 0.1-1 in ubuntu warty RELEASE |
1088 | @@ -235,7 +236,7 @@ |
1089 | |
1090 | In order to call storeUploadLog() again for the same build, we have to |
1091 | remove the previously stored 'upload_log'. See the check below in |
1092 | -'AssertionErrors in IBuild' for more detail. |
1093 | +'AssertionErrors in IBinaryPackageBuild' for more detail. |
1094 | |
1095 | >>> login('foo.bar@canonical.com') |
1096 | >>> active_build.upload_log = None |
1097 | @@ -373,7 +374,7 @@ |
1098 | Invoke createBinaryPackageRelease with all required arguments. |
1099 | |
1100 | # Load a build from the samepledata for creating binaries. |
1101 | - >>> pmount_build = getUtility(IBuildSet).getByBuildID(19) |
1102 | + >>> pmount_build = getUtility(IBinaryPackageBuildSet).getByBuildID(19) |
1103 | |
1104 | >>> bin = pmount_build.createBinaryPackageRelease( |
1105 | ... binarypackagename, version, summary, description, |
1106 | @@ -453,7 +454,7 @@ |
1107 | The BuildSet class gives us some useful ways to consider the |
1108 | collection of builds. |
1109 | |
1110 | - >>> bs = getUtility(IBuildSet) |
1111 | + >>> bs = getUtility(IBinaryPackageBuildSet) |
1112 | |
1113 | We can find builds given a source package release and architecture tag. |
1114 | |
1115 | @@ -461,7 +462,7 @@ |
1116 | >>> i386_builds.count() |
1117 | 4 |
1118 | |
1119 | -IHasBuildRecords uses a base method provided by IBuildSet, |
1120 | +IHasBuildRecords uses a base method provided by IBinaryPackageBuildSet, |
1121 | getBuildsByArchIds(): |
1122 | |
1123 | It receives list of architectures IDs: |
1124 | @@ -519,8 +520,8 @@ |
1125 | ... bs.getBuildsByArchIds(arch_ids, name='commercialpackage')] |
1126 | [('PARTNER', u'i386 build of commercialpackage 1.0-1 in ubuntu breezy-autotest RELEASE')] |
1127 | |
1128 | -`IBuildSet` also provides getStatusSummaryForBuilds which summarizes the |
1129 | -build status of a set of builds: |
1130 | +`IBinaryPackageBuildSet` also provides getStatusSummaryForBuilds which |
1131 | +summarizes the build status of a set of builds: |
1132 | |
1133 | First we'll define a helper to print the build summary: |
1134 | |
1135 | @@ -543,11 +544,12 @@ |
1136 | data from the database for a given set of builds: |
1137 | |
1138 | >>> from storm.expr import In |
1139 | - >>> from lp.soyuz.model.build import Build |
1140 | + >>> from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
1141 | >>> from canonical.launchpad.webapp.interfaces import ( |
1142 | ... IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR) |
1143 | >>> store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
1144 | - >>> results = list(store.find(Build, In(Build.id, (2,6,7,8)))) |
1145 | + >>> results = list(store.find( |
1146 | + ... BinaryPackageBuild, In(BinaryPackageBuild.id, (2,6,7,8)))) |
1147 | >>> rset = removeSecurityProxy(bs)._prefetchBuildData(results) |
1148 | >>> def filename_or_none(item): |
1149 | ... if item is not None: |
1150 | @@ -768,7 +770,7 @@ |
1151 | if user is not passed then the query runs anonymously which means private |
1152 | builds are excluded from anything returned. |
1153 | |
1154 | -Log in as admin to avoid security on IBuild for the moment. |
1155 | +Log in as admin to avoid security on IBinaryPackageBuild for the moment. |
1156 | |
1157 | >>> login('foo.bar@canonical.com') |
1158 | |
1159 | @@ -889,16 +891,16 @@ |
1160 | 4 |
1161 | |
1162 | |
1163 | -== AssertionErrors in IBuild == |
1164 | +== AssertionErrors in IBinaryPackageBuild == |
1165 | |
1166 | Build records inserted by gina don't provide calculated_buildstart |
1167 | value, since they miss fields used in its calculation. |
1168 | |
1169 | - >>> gina_build = getUtility(IBuildSet).getByBuildID(10) |
1170 | + >>> gina_build = getUtility(IBinaryPackageBuildSet).getByBuildID(10) |
1171 | >>> gina_build.title |
1172 | u'i386 build of cnews cr.g7-37 in ubuntu warty RELEASE' |
1173 | |
1174 | -even if IBuild.was_built return true: |
1175 | +even if IBinaryPackageBuild.was_built return true: |
1176 | |
1177 | >>> gina_build.was_built |
1178 | True |
1179 | @@ -916,10 +918,10 @@ |
1180 | its result in case of success, i.e., we should not be able to retry a |
1181 | build for a released pocket. |
1182 | |
1183 | -All those conditions are controlled by IBuild.can_be_retried() property |
1184 | -(see above). |
1185 | +All those conditions are controlled by |
1186 | +IBinaryPackageBuild.can_be_retried() property (see above). |
1187 | |
1188 | - >>> failed_build = getUtility(IBuildSet).getByBuildID(6) |
1189 | + >>> failed_build = getUtility(IBinaryPackageBuildSet).getByBuildID(6) |
1190 | |
1191 | >>> failed_build.title |
1192 | u'i386 build of foobar 1.0 in ubuntu warty RELEASE' |
1193 | @@ -963,7 +965,7 @@ |
1194 | storeUploadLog() refuses to override any previously stored |
1195 | 'upload_log'. |
1196 | |
1197 | - >>> failedtoupload_build = getUtility(IBuildSet).getByBuildID(22) |
1198 | + >>> failedtoupload_build = getUtility(IBinaryPackageBuildSet).getByBuildID(22) |
1199 | >>> print failedtoupload_build.title |
1200 | i386 build of cdrkit 1.0 in ubuntu breezy-autotest RELEASE |
1201 | |
1202 | @@ -993,17 +995,17 @@ |
1203 | |
1204 | == Updating build-dependencies line == |
1205 | |
1206 | -The IBuild.dependencies field is only filled when a build job is |
1207 | -collected as MANUALDEPWAIT, its content is informed by the |
1208 | +The IBinaryPackageBuild.dependencies field is only filled when a build |
1209 | +job is collected as MANUALDEPWAIT, its content is informed by the |
1210 | buildd-slave in the apt-dependencies format. |
1211 | |
1212 | - >>> depwait_build = getUtility(IBuildSet).getByBuildID(12) |
1213 | + >>> depwait_build = getUtility(IBinaryPackageBuildSet).getByBuildID(12) |
1214 | >>> print depwait_build.dependencies |
1215 | cpp (>= 4:4.0.1-3), gcc-4.0 (>= 4.0.1-2) |
1216 | |
1217 | -IBuild.updateDependencies is designed to process this field and |
1218 | -eliminate dependencies that can be satisfied. It is used as part of the |
1219 | -auto-depwait processing where all builds marked as MANUALDEPWAIT are |
1220 | +IBinaryPackageBuild.updateDependencies is designed to process this field |
1221 | +and eliminate dependencies that can be satisfied. It is used as part of |
1222 | +the auto-depwait processing where all builds marked as MANUALDEPWAIT are |
1223 | re-processed and the ones with empty dependencies are re-queued. |
1224 | |
1225 | If nothing has changed, which is the case of the current |
1226 | @@ -1107,7 +1109,7 @@ |
1227 | It depends on the callsite to decide whether or not to 'retry' a |
1228 | build after calling updateDependencies, to encapsulate such decision |
1229 | for performing the mentioned auto-depwait procedure we have a utility |
1230 | -in IBuildSet called retryDepWaiting(). |
1231 | +in IBinaryPackageBuildSet called retryDepWaiting(). |
1232 | |
1233 | >>> print depwait_build.buildstate.name |
1234 | MANUALDEPWAIT |
1235 | @@ -1125,7 +1127,7 @@ |
1236 | Then we can run the utility method for the target distroarchseries and |
1237 | expect depwait_build to be 'retried' and scored. |
1238 | |
1239 | - >>> getUtility(IBuildSet).retryDepWaiting(hoaryi386) |
1240 | + >>> getUtility(IBinaryPackageBuildSet).retryDepWaiting(hoaryi386) |
1241 | |
1242 | >>> print depwait_build.buildstate.name |
1243 | NEEDSBUILD |
1244 | @@ -1173,8 +1175,8 @@ |
1245 | |
1246 | == Build record security == |
1247 | |
1248 | -IBuild's content class is wrapped in a Zope security wrapper that prevents |
1249 | -access to private builds for unauthorised users. |
1250 | +IBinaryPackageBuild's content class is wrapped in a Zope security |
1251 | +wrapper that prevents access to private builds for unauthorised users. |
1252 | |
1253 | Accessing the cprov builds when logged in as admin will see the records: |
1254 | |
1255 | @@ -1373,7 +1375,7 @@ |
1256 | datetime.timedelta(0, 3600) |
1257 | |
1258 | |
1259 | -== IBuildSet.getBuildsBySourcePackageRelease() == |
1260 | +== IBinaryPackageBuildSet.getBuildsBySourcePackageRelease() == |
1261 | |
1262 | getBuildsBySourcePackageRelease() will return all the Build records for |
1263 | all the SourcePackageRelease IDs passed. |
1264 | @@ -1481,7 +1483,7 @@ |
1265 | A call to getBuildsForBuilder returns only those builds that were |
1266 | built by the specified builder, ordered by datebuilt DESC: |
1267 | |
1268 | - >>> frog_builds = getUtility(IBuildSet).getBuildsForBuilder( |
1269 | + >>> frog_builds = getUtility(IBinaryPackageBuildSet).getBuildsForBuilder( |
1270 | ... frog_builder.id) |
1271 | >>> print_build_details(frog_builds) |
1272 | ubuntu-team: i386 build of laterbuildsrc 666 in ubuntutest |
1273 | |
1274 | === modified file 'lib/lp/soyuz/doc/buildd-dispatching.txt' |
1275 | --- lib/lp/soyuz/doc/buildd-dispatching.txt 2010-04-08 15:29:39 +0000 |
1276 | +++ lib/lp/soyuz/doc/buildd-dispatching.txt 2010-04-13 06:59:32 +0000 |
1277 | @@ -131,8 +131,9 @@ |
1278 | |
1279 | >>> job.id |
1280 | 2 |
1281 | - >>> from lp.soyuz.interfaces.build import IBuildSet |
1282 | - >>> build = getUtility(IBuildSet).getByQueueEntry(job) |
1283 | + >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
1284 | + ... IBinaryPackageBuildSet) |
1285 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(job) |
1286 | >>> build.buildstate.name |
1287 | 'NEEDSBUILD' |
1288 | >>> job.builder is None |
1289 | @@ -172,7 +173,7 @@ |
1290 | >>> job.builder.id == bob_builder.id |
1291 | True |
1292 | |
1293 | - >>> build = getUtility(IBuildSet).getByQueueEntry(job) |
1294 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(job) |
1295 | >>> build.buildstate.name |
1296 | 'BUILDING' |
1297 | |
1298 | @@ -209,7 +210,7 @@ |
1299 | |
1300 | The build job's archive requires virtualized builds. |
1301 | |
1302 | - >>> build = getUtility(IBuildSet).getByQueueEntry(ppa_job) |
1303 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(ppa_job) |
1304 | >>> build.archive.require_virtualized |
1305 | True |
1306 | |
1307 | |
1308 | === modified file 'lib/lp/soyuz/doc/buildd-scoring.txt' |
1309 | --- lib/lp/soyuz/doc/buildd-scoring.txt 2010-02-17 13:01:41 +0000 |
1310 | +++ lib/lp/soyuz/doc/buildd-scoring.txt 2010-04-13 06:59:32 +0000 |
1311 | @@ -260,8 +260,9 @@ |
1312 | ... name='test-rebuild') |
1313 | |
1314 | >>> bqc = setUpBuildQueueEntry(archive=copy) |
1315 | - >>> from lp.soyuz.interfaces.build import IBuildSet |
1316 | - >>> build = getUtility(IBuildSet).getByQueueEntry(bqc) |
1317 | + >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
1318 | + ... IBinaryPackageBuildSet) |
1319 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqc) |
1320 | >>> bqc.score() |
1321 | >>> bqc.lastscore |
1322 | -10 |
1323 | |
1324 | === modified file 'lib/lp/soyuz/doc/buildd-slavescanner.txt' |
1325 | --- lib/lp/soyuz/doc/buildd-slavescanner.txt 2010-04-12 05:52:01 +0000 |
1326 | +++ lib/lp/soyuz/doc/buildd-slavescanner.txt 2010-04-13 06:59:32 +0000 |
1327 | @@ -75,14 +75,15 @@ |
1328 | following states: FAILEDTOBUILD and CHROOTWAIT |
1329 | |
1330 | >>> from lp.buildmaster.interfaces.builder import IBuilderSet |
1331 | - >>> from lp.soyuz.interfaces.build import IBuildSet |
1332 | + >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
1333 | + ... IBinaryPackageBuildSet) |
1334 | >>> import datetime, pytz |
1335 | |
1336 | >>> UTC = pytz.timezone('UTC') |
1337 | |
1338 | We want to get a Build and make BuildQueue items for it: |
1339 | |
1340 | - >>> a_build = getUtility(IBuildSet).getByBuildID(8) |
1341 | + >>> a_build = getUtility(IBinaryPackageBuildSet).getByBuildID(8) |
1342 | |
1343 | To make testing easier we provide a convenience function to put a BuildQueue |
1344 | object into a preset fixed state: |
1345 | @@ -134,7 +135,7 @@ |
1346 | |
1347 | Do the test execution: |
1348 | |
1349 | - >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem3) |
1350 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem3) |
1351 | >>> a_builder.updateBuild(bqItem3) |
1352 | >>> build.builder is not None |
1353 | True |
1354 | @@ -164,7 +165,7 @@ |
1355 | |
1356 | Do the test execution: |
1357 | |
1358 | - >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem4) |
1359 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem4) |
1360 | >>> a_builder.updateBuild(bqItem4) |
1361 | CRITICAL:slave-scanner:***** bob is MANUALDEPWAIT ***** |
1362 | >>> build.builder is not None |
1363 | @@ -193,7 +194,7 @@ |
1364 | |
1365 | >>> bqItem5.builder.setSlaveForTesting( |
1366 | ... WaitingSlave('BuildStatus.CHROOTFAIL')) |
1367 | - >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem5) |
1368 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem5) |
1369 | >>> a_builder.updateBuild(bqItem5) |
1370 | CRITICAL:slave-scanner:***** bob is CHROOTWAIT ***** |
1371 | >>> build.builder is not None |
1372 | @@ -232,7 +233,7 @@ |
1373 | True |
1374 | >>> check_mail_sent(last_stub_mail_count) |
1375 | False |
1376 | - >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem6) |
1377 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem6) |
1378 | >>> print build.buildstate.title |
1379 | Pending build |
1380 | >>> job = bqItem6.specific_job.job |
1381 | @@ -341,7 +342,7 @@ |
1382 | (precisely on binary upload time), the build will be considered |
1383 | FAILEDTOUPLOAD: |
1384 | |
1385 | - >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem10) |
1386 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem10) |
1387 | >>> a_builder.updateBuild(bqItem10) |
1388 | WARNING:slave-scanner:Build ... upload failed. |
1389 | >>> build.builder is not None |
1390 | @@ -407,9 +408,9 @@ |
1391 | this case cleanly. We need to set the pocket to updates for this test as its |
1392 | uploading to warty. |
1393 | |
1394 | - >>> bqItem10 = getUtility(IBuildSet).getByBuildID( |
1395 | + >>> bqItem10 = getUtility(IBinaryPackageBuildSet).getByBuildID( |
1396 | ... 6).queueBuild() |
1397 | - >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem10) |
1398 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem10) |
1399 | |
1400 | XXX: The pocket attribute is not intended to be changed in regular code, but |
1401 | for this test we want to change it on the fly. An alternative would be to add |
1402 | @@ -482,7 +483,7 @@ |
1403 | 0 |
1404 | >>> check_mail_sent(last_stub_mail_count) |
1405 | False |
1406 | - >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem11) |
1407 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem11) |
1408 | >>> print build.buildstate.title |
1409 | Pending build |
1410 | >>> job = bqItem11.specific_job.job |
1411 | @@ -498,7 +499,7 @@ |
1412 | investigate why this build end up built. (should never happen in real |
1413 | cases, and even so should be refused when we try to upload it.) |
1414 | |
1415 | - >>> bqItem12 = getUtility(IBuildSet).getByBuildID( |
1416 | + >>> bqItem12 = getUtility(IBinaryPackageBuildSet).getByBuildID( |
1417 | ... 2).queueBuild() |
1418 | >>> setupBuildQueue(bqItem12, a_builder) |
1419 | >>> last_stub_mail_count = len(stub.test_emails) |
1420 | @@ -519,7 +520,7 @@ |
1421 | The buildlog is collected and compressed locally using gzip algorithm, |
1422 | let's see how this method works: |
1423 | |
1424 | - >>> bqItem10 = getUtility(IBuildSet).getByBuildID( |
1425 | + >>> bqItem10 = getUtility(IBinaryPackageBuildSet).getByBuildID( |
1426 | ... 6).queueBuild() |
1427 | >>> setupBuildQueue(bqItem10, a_builder) |
1428 | >>> bqItem10.builder.setSlaveForTesting(WaitingSlave('BuildStatus.OK')) |
1429 | @@ -696,7 +697,8 @@ |
1430 | tests. |
1431 | |
1432 | >>> current_job = a_builder.currentjob |
1433 | - >>> resurrect_build = getUtility(IBuildSet).getByQueueEntry(current_job) |
1434 | + >>> resurrect_build = getUtility(IBinaryPackageBuildSet).getByQueueEntry( |
1435 | + ... current_job) |
1436 | >>> resurrect_build.buildstate = BuildStatus.NEEDSBUILD |
1437 | >>> syncUpdate(resurrect_build) |
1438 | >>> current_job.builder = None |
1439 | @@ -708,7 +710,8 @@ |
1440 | corresponding build record as SUPERSEDED. |
1441 | |
1442 | >>> old_candidate = removeSecurityProxy(a_builder)._findBuildCandidate() |
1443 | - >>> build = getUtility(IBuildSet).getByQueueEntry(old_candidate) |
1444 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry( |
1445 | + ... old_candidate) |
1446 | >>> print build.buildstate.name |
1447 | NEEDSBUILD |
1448 | |
1449 | @@ -772,7 +775,7 @@ |
1450 | aside to convert these to unit-tests. |
1451 | |
1452 | >>> naked_build = removeSecurityProxy( |
1453 | - ... getUtility(IBuildSet).getByQueueEntry(new_candidate)) |
1454 | + ... getUtility(IBinaryPackageBuildSet).getByQueueEntry(new_candidate)) |
1455 | >>> original_archive = naked_build.archive |
1456 | >>> secure_pub = naked_build.current_source_publication |
1457 | >>> commit() |
1458 | @@ -819,7 +822,8 @@ |
1459 | >>> commit() |
1460 | >>> LaunchpadZopelessLayer.switchDbUser(config.builddmaster.dbuser) |
1461 | |
1462 | - >>> build = getUtility(IBuildSet).getByQueueEntry(current_job) |
1463 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry( |
1464 | + ... current_job) |
1465 | >>> print build.buildstate.name |
1466 | NEEDSBUILD |
1467 | |
1468 | @@ -1053,7 +1057,8 @@ |
1469 | >>> commit() |
1470 | >>> LaunchpadZopelessLayer.switchDbUser('launchpad') |
1471 | >>> login('foo.bar@canonical.com') |
1472 | - >>> build = getUtility(IBuildSet).getByQueueEntry(candidate) |
1473 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry( |
1474 | + ... candidate) |
1475 | >>> for build_file in build.sourcepackagerelease.files: |
1476 | ... removeSecurityProxy(build_file).libraryfile.restricted = True |
1477 | >>> private_ppa = factory.makeArchive( |
1478 | @@ -1087,7 +1092,7 @@ |
1479 | archive and not the one from the PPA, which on the absence of ancestry |
1480 | defaults to 'universe'. |
1481 | |
1482 | - >>> build = getUtility(IBuildSet).getByQueueEntry(candidate) |
1483 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(candidate) |
1484 | >>> print build.current_component.name |
1485 | main |
1486 | |
1487 | @@ -1312,7 +1317,7 @@ |
1488 | >>> a_builder.currentjob.destroySelf() |
1489 | |
1490 | >>> bqItem3 = a_build.queueBuild() |
1491 | - >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem3) |
1492 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem3) |
1493 | >>> removeSecurityProxy(build).pocket = ( |
1494 | ... PackagePublishingPocket.UPDATES) |
1495 | >>> last_stub_mail_count = len(stub.test_emails) |
1496 | |
1497 | === modified file 'lib/lp/soyuz/doc/distroarchseriesbinarypackage.txt' |
1498 | --- lib/lp/soyuz/doc/distroarchseriesbinarypackage.txt 2009-11-15 19:52:54 +0000 |
1499 | +++ lib/lp/soyuz/doc/distroarchseriesbinarypackage.txt 2010-04-13 06:59:32 +0000 |
1500 | @@ -28,7 +28,7 @@ |
1501 | |
1502 | >>> from lp.soyuz.model.publishing import ( |
1503 | ... BinaryPackagePublishingHistory) |
1504 | - >>> from lp.soyuz.model.build import Build |
1505 | + >>> from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
1506 | >>> from lp.soyuz.model.component import Component |
1507 | >>> from lp.soyuz.model.section import Section |
1508 | >>> from canonical.database.constants import UTC_NOW |
1509 | @@ -45,7 +45,7 @@ |
1510 | |
1511 | XXX: noodles 2008-11-05 bug=294585: The dependency on a database id |
1512 | needs to be removed. |
1513 | - >>> bpr = Build.get(8).createBinaryPackageRelease( |
1514 | + >>> bpr = BinaryPackageBuild.get(8).createBinaryPackageRelease( |
1515 | ... binarypackagename=firefox_name.id, |
1516 | ... version="120.6-0", |
1517 | ... summary="Firefox loves lollies", |
1518 | @@ -86,7 +86,7 @@ |
1519 | |
1520 | XXX: noodles 2008-11-06 bug=294585: The dependency on a database id |
1521 | needs to be removed. |
1522 | - >>> bpr = Build.get(9).createBinaryPackageRelease( |
1523 | + >>> bpr = BinaryPackageBuild.get(9).createBinaryPackageRelease( |
1524 | ... binarypackagename=pmount_name.id, |
1525 | ... version="cr98.34", |
1526 | ... summary="Pmount bakes cakes", |
1527 | |
1528 | === modified file 'lib/lp/soyuz/doc/gina-multiple-arch.txt' |
1529 | --- lib/lp/soyuz/doc/gina-multiple-arch.txt 2009-11-15 19:52:54 +0000 |
1530 | +++ lib/lp/soyuz/doc/gina-multiple-arch.txt 2010-04-13 06:59:32 +0000 |
1531 | @@ -9,7 +9,7 @@ |
1532 | ... BinaryPackagePublishingHistory, |
1533 | ... EmailAddress, |
1534 | ... BinaryPackageRelease, |
1535 | - ... Build) |
1536 | + ... BinaryPackageBuild) |
1537 | >>> from lp.registry.model.person import Person, WikiName |
1538 | >>> from lp.registry.model.teammembership import TeamParticipation |
1539 | >>> SSPPH = SourcePackagePublishingHistory |
1540 | @@ -22,7 +22,7 @@ |
1541 | >>> orig_email_count = EmailAddress.select().count() |
1542 | >>> orig_wiki_count = WikiName.select().count() |
1543 | >>> orig_bpr_count = BinaryPackageRelease.select().count() |
1544 | - >>> orig_build_count = Build.select().count() |
1545 | + >>> orig_build_count = BinaryPackageBuild.select().count() |
1546 | >>> orig_sbpph_count = SBPPH.select().count() |
1547 | |
1548 | Create a distribution series and an arch series for dapper: |
1549 | @@ -142,7 +142,7 @@ |
1550 | |
1551 | >>> print Person.select().count() - orig_person_count |
1552 | 2 |
1553 | - >>> print TeamParticipation.select().count() - orig_tp_count |
1554 | + >>> print TeamParticipation.select().count() - orig_tp_count |
1555 | 2 |
1556 | >>> print EmailAddress.select().count() - orig_email_count |
1557 | 2 |
1558 | @@ -153,7 +153,7 @@ |
1559 | |
1560 | >>> BinaryPackageRelease.select().count() - orig_bpr_count |
1561 | 4 |
1562 | - >>> Build.select().count() - orig_build_count |
1563 | + >>> BinaryPackageBuild.select().count() - orig_build_count |
1564 | 2 |
1565 | >>> SBPPH.select().count() - orig_sbpph_count |
1566 | 4 |
1567 | |
1568 | === modified file 'lib/lp/soyuz/doc/gina.txt' |
1569 | --- lib/lp/soyuz/doc/gina.txt 2010-04-05 18:18:20 +0000 |
1570 | +++ lib/lp/soyuz/doc/gina.txt 2010-04-13 06:59:32 +0000 |
1571 | @@ -13,7 +13,7 @@ |
1572 | ... BinaryPackagePublishingHistory, |
1573 | ... EmailAddress, |
1574 | ... BinaryPackageRelease, |
1575 | - ... Build) |
1576 | + ... BinaryPackageBuild) |
1577 | >>> from lp.registry.model.person import Person, WikiName |
1578 | >>> from lp.registry.model.teammembership import TeamParticipation |
1579 | >>> from lp.registry.interfaces.pocket import ( |
1580 | @@ -28,7 +28,7 @@ |
1581 | >>> orig_email_count = EmailAddress.select().count() |
1582 | >>> orig_wiki_count = WikiName.select().count() |
1583 | >>> orig_bpr_count = BinaryPackageRelease.select().count() |
1584 | - >>> orig_build_count = Build.select().count() |
1585 | + >>> orig_build_count = BinaryPackageBuild.select().count() |
1586 | >>> orig_sbpph_count = SBPPH.select().count() |
1587 | >>> orig_sspph_main_count = SSPPH.selectBy( |
1588 | ... componentID=1, pocket=PackagePublishingPocket.RELEASE).count() |
1589 | @@ -338,7 +338,7 @@ |
1590 | |
1591 | >>> BinaryPackageRelease.select().count() - orig_bpr_count |
1592 | 40 |
1593 | - >>> Build.select().count() - orig_build_count |
1594 | + >>> BinaryPackageBuild.select().count() - orig_build_count |
1595 | 13 |
1596 | >>> SBPPH.select().count() - orig_sbpph_count |
1597 | 46 |
1598 | @@ -526,7 +526,7 @@ |
1599 | 13 |
1600 | >>> BinaryPackageRelease.select().count() - orig_bpr_count |
1601 | 40 |
1602 | - >>> Build.select().count() - orig_build_count |
1603 | + >>> BinaryPackageBuild.select().count() - orig_build_count |
1604 | 13 |
1605 | |
1606 | But the overrides do generate extra publishing entries: |
1607 | |
1608 | === modified file 'lib/lp/soyuz/doc/queuebuilder.txt' |
1609 | --- lib/lp/soyuz/doc/queuebuilder.txt 2010-03-24 07:17:20 +0000 |
1610 | +++ lib/lp/soyuz/doc/queuebuilder.txt 2010-04-13 06:59:32 +0000 |
1611 | @@ -22,7 +22,7 @@ |
1612 | >>> from lp.registry.model.distroseries import DistroSeries |
1613 | >>> from lp.registry.interfaces.pocket import PackagePublishingPocket |
1614 | >>> from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
1615 | - >>> from lp.soyuz.model.build import Build |
1616 | + >>> from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
1617 | >>> from lp.soyuz.model.distroarchseries import ( |
1618 | ... DistroArchSeries, PocketChroot) |
1619 | |
1620 | @@ -119,7 +119,7 @@ |
1621 | |
1622 | Store current status of the database: |
1623 | |
1624 | - >>> old_build_ids = [build.id for build in Build.select()] |
1625 | + >>> old_build_ids = [build.id for build in BinaryPackageBuild.select()] |
1626 | >>> old_job_ids = [build_queue.id for build_queue in BuildQueue.select()] |
1627 | |
1628 | |
1629 | @@ -233,7 +233,8 @@ |
1630 | ... hoary, PackagePublishingPocket.RELEASE, warty.main_archive) |
1631 | |
1632 | >>> from lp.buildmaster.interfaces.buildbase import BuildStatus |
1633 | - >>> from lp.soyuz.interfaces.build import IBuildSet |
1634 | + >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
1635 | + ... IBinaryPackageBuildSet) |
1636 | >>> failed_build = pub_failed.sourcepackagerelease.createBuild( |
1637 | ... warty['i386'], PackagePublishingPocket.RELEASE, |
1638 | ... warty.main_archive, status=BuildStatus.FAILEDTOBUILD) |
1639 | @@ -306,7 +307,7 @@ |
1640 | |
1641 | Check that we only created new Build entries for the new hoary releases: |
1642 | |
1643 | - >>> new_builds = [build for build in Build.select() |
1644 | + >>> new_builds = [build for build in BinaryPackageBuild.select() |
1645 | ... if build.id not in old_build_ids] |
1646 | >>> for build in sorted(new_builds, key=operator.attrgetter('id')): |
1647 | ... print build.title |
1648 | @@ -324,7 +325,7 @@ |
1649 | |
1650 | And have a look at our architecture-independent-source's build: |
1651 | |
1652 | - >>> arch_indep_build = Build.selectOneBy( |
1653 | + >>> arch_indep_build = BinaryPackageBuild.selectOneBy( |
1654 | ... sourcepackagerelease=pub_all.sourcepackagerelease) |
1655 | |
1656 | >>> print arch_indep_build.title |
1657 | @@ -347,7 +348,8 @@ |
1658 | happen in parallel with build creation. |
1659 | |
1660 | >>> build_queue = active_jobs[0] |
1661 | - >>> build = getUtility(IBuildSet).getByQueueEntry(build_queue) |
1662 | + >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry( |
1663 | + ... build_queue) |
1664 | >>> print build.title |
1665 | i386 build of test-buildd 667 in ubuntu hoary RELEASE |
1666 | >>> build_queue.lastscore |
1667 | @@ -364,7 +366,8 @@ |
1668 | Missing BuildQueue records, resulting from given-back builds, are |
1669 | created in the last stage of the queue-builder script. |
1670 | |
1671 | - >>> given_back_build = getUtility(IBuildSet).getByQueueEntry(build_queue) |
1672 | + >>> given_back_build = getUtility(IBinaryPackageBuildSet).getByQueueEntry( |
1673 | + ... build_queue) |
1674 | >>> build_queue.destroySelf() |
1675 | >>> flush_database_updates() |
1676 | |
1677 | |
1678 | === modified file 'lib/lp/soyuz/doc/sourcepackagerelease.txt' |
1679 | --- lib/lp/soyuz/doc/sourcepackagerelease.txt 2010-03-20 23:16:42 +0000 |
1680 | +++ lib/lp/soyuz/doc/sourcepackagerelease.txt 2010-04-13 06:59:32 +0000 |
1681 | @@ -61,9 +61,9 @@ |
1682 | property only returns the non-PPA builds. |
1683 | |
1684 | >>> from canonical.launchpad.interfaces import IPersonSet |
1685 | - >>> from lp.soyuz.model.build import Build |
1686 | + >>> from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
1687 | >>> cprov_ppa = getUtility(IPersonSet).getByName('cprov').archive |
1688 | - >>> ff_ppa_build = Build.selectBy( |
1689 | + >>> ff_ppa_build = BinaryPackageBuild.selectBy( |
1690 | ... archive=cprov_ppa, sourcepackagerelease=spr) |
1691 | >>> ff_ppa_build.count() |
1692 | 1 |
1693 | |
1694 | === modified file 'lib/lp/soyuz/doc/soyuz-set-of-uploads.txt' |
1695 | --- lib/lp/soyuz/doc/soyuz-set-of-uploads.txt 2010-03-06 04:57:40 +0000 |
1696 | +++ lib/lp/soyuz/doc/soyuz-set-of-uploads.txt 2010-04-13 06:59:32 +0000 |
1697 | @@ -39,7 +39,7 @@ |
1698 | 4. A changes file that enumerates all the files in the upload, with |
1699 | correct md5 sum and file sizes. |
1700 | 5. Actual files uploaded that match the ones described in the changes file. |
1701 | - |
1702 | + |
1703 | If (1) is not available, the upload silently fails. |
1704 | If (2) is not available, the upload silently fails. |
1705 | If (3) or (4) is not available, the upload is rejected immediately with |
1706 | @@ -623,12 +623,12 @@ |
1707 | >>> from lp.buildmaster.interfaces.buildbase import BuildStatus |
1708 | >>> from lp.registry.model.sourcepackagename import SourcePackageName |
1709 | >>> from lp.registry.interfaces.pocket import PackagePublishingPocket |
1710 | - >>> from lp.soyuz.model.build import Build |
1711 | + >>> from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
1712 | >>> from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease |
1713 | >>> spn = SourcePackageName.selectOneBy(name="baz") |
1714 | >>> spr = SourcePackageRelease.selectOneBy(sourcepackagenameID=spn.id) |
1715 | >>> spr_id = spr.id |
1716 | - >>> builds = Build.selectBy(sourcepackagereleaseID=spr_id) |
1717 | + >>> builds = BinaryPackageBuild.selectBy(sourcepackagereleaseID=spr_id) |
1718 | >>> len(list(builds)) |
1719 | 0 |
1720 | |
1721 | @@ -642,7 +642,7 @@ |
1722 | |
1723 | Check build created |
1724 | |
1725 | - >>> len(list(Build.selectBy(sourcepackagereleaseID=spr_id))) |
1726 | + >>> len(list(BinaryPackageBuild.selectBy(sourcepackagereleaseID=spr_id))) |
1727 | 1 |
1728 | |
1729 | Upload the i386 binary: |
1730 | @@ -656,7 +656,8 @@ |
1731 | >>> from canonical.database.sqlbase import clear_current_connection_cache |
1732 | >>> clear_current_connection_cache() |
1733 | |
1734 | - >>> builds = list(Build.selectBy(sourcepackagereleaseID=spr_id)) |
1735 | + >>> builds = list(BinaryPackageBuild.selectBy( |
1736 | + ... sourcepackagereleaseID=spr_id)) |
1737 | >>> len(builds) |
1738 | 1 |
1739 | >>> builds[0].buildstate == BuildStatus.FULLYBUILT |
1740 | |
1741 | === renamed file 'lib/lp/soyuz/interfaces/build.py' => 'lib/lp/soyuz/interfaces/binarypackagebuild.py' |
1742 | --- lib/lp/soyuz/interfaces/build.py 2010-04-03 03:29:23 +0000 |
1743 | +++ lib/lp/soyuz/interfaces/binarypackagebuild.py 2010-04-13 06:59:32 +0000 |
1744 | @@ -3,16 +3,16 @@ |
1745 | |
1746 | # pylint: disable-msg=E0211,E0213 |
1747 | |
1748 | -"""Build interfaces.""" |
1749 | +"""BinaryPackageBuild interfaces.""" |
1750 | |
1751 | __metaclass__ = type |
1752 | |
1753 | __all__ = [ |
1754 | 'BuildSetStatus', |
1755 | 'CannotBeRescored', |
1756 | - 'IBuild', |
1757 | + 'IBinaryPackageBuild', |
1758 | 'IBuildRescoreForm', |
1759 | - 'IBuildSet', |
1760 | + 'IBinaryPackageBuildSet', |
1761 | ] |
1762 | |
1763 | from zope.interface import Interface, Attribute |
1764 | @@ -38,7 +38,7 @@ |
1765 | _message_prefix = "Cannot rescore build" |
1766 | |
1767 | |
1768 | -class IBuildView(IBuildBase): |
1769 | +class IBinaryPackageBuildView(IBuildBase): |
1770 | """A Build interface for items requiring launchpad.View.""" |
1771 | id = Int(title=_('ID'), required=True, readonly=True) |
1772 | |
1773 | @@ -151,7 +151,7 @@ |
1774 | """ |
1775 | |
1776 | |
1777 | -class IBuildEdit(Interface): |
1778 | +class IBinaryPackageBuildEdit(Interface): |
1779 | """A Build interface for items requiring launchpad.Edit.""" |
1780 | |
1781 | @export_write_operation() |
1782 | @@ -163,7 +163,7 @@ |
1783 | """ |
1784 | |
1785 | |
1786 | -class IBuildAdmin(Interface): |
1787 | +class IBinaryPackageBuildAdmin(Interface): |
1788 | """A Build interface for items requiring launchpad.Admin.""" |
1789 | |
1790 | @operation_parameters(score=Int(title=_("Score"), required=True)) |
1791 | @@ -172,9 +172,11 @@ |
1792 | """Change the build's score.""" |
1793 | |
1794 | |
1795 | -class IBuild(IBuildView, IBuildEdit, IBuildAdmin): |
1796 | +class IBinaryPackageBuild( |
1797 | + IBinaryPackageBuildView, IBinaryPackageBuildEdit, |
1798 | + IBinaryPackageBuildAdmin): |
1799 | """A Build interface""" |
1800 | - export_as_webservice_entry() |
1801 | + export_as_webservice_entry(singular_name='build', plural_name='builds') |
1802 | |
1803 | |
1804 | class BuildSetStatus(EnumeratedType): |
1805 | @@ -208,8 +210,8 @@ |
1806 | description="There are some builds currently building.") |
1807 | |
1808 | |
1809 | -class IBuildSet(Interface): |
1810 | - """Interface for BuildSet""" |
1811 | +class IBinaryPackageBuildSet(Interface): |
1812 | + """Interface for BinaryPackageBuildSet""" |
1813 | |
1814 | def getBuildBySRAndArchtag(sourcepackagereleaseID, archtag): |
1815 | """Return a build for a SourcePackageRelease and an ArchTag""" |
1816 | |
1817 | === modified file 'lib/lp/soyuz/interfaces/buildfarmbuildjob.py' |
1818 | --- lib/lp/soyuz/interfaces/buildfarmbuildjob.py 2010-03-16 05:08:47 +0000 |
1819 | +++ lib/lp/soyuz/interfaces/buildfarmbuildjob.py 2010-04-13 06:59:32 +0000 |
1820 | @@ -11,11 +11,11 @@ |
1821 | from canonical.launchpad import _ |
1822 | from lazr.restful.fields import Reference |
1823 | from lp.buildmaster.interfaces.buildfarmjob import IBuildFarmJob |
1824 | -from lp.soyuz.interfaces.build import IBuild |
1825 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuild |
1826 | |
1827 | |
1828 | class IBuildFarmBuildJob(IBuildFarmJob): |
1829 | """An `IBuildFarmJob` with an `IBuild` reference.""" |
1830 | build = Reference( |
1831 | - IBuild, title=_("Build"), required=True, readonly=True, |
1832 | + IBinaryPackageBuild, title=_("Build"), required=True, readonly=True, |
1833 | description=_("Build record associated with this job.")) |
1834 | |
1835 | === modified file 'lib/lp/soyuz/interfaces/buildpackagejob.py' |
1836 | --- lib/lp/soyuz/interfaces/buildpackagejob.py 2010-03-16 05:08:47 +0000 |
1837 | +++ lib/lp/soyuz/interfaces/buildpackagejob.py 2010-04-13 06:59:32 +0000 |
1838 | @@ -16,7 +16,7 @@ |
1839 | from canonical.launchpad import _ |
1840 | from lazr.restful.fields import Reference |
1841 | from lp.services.job.interfaces.job import IJob |
1842 | -from lp.soyuz.interfaces.build import IBuild |
1843 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuild |
1844 | from lp.soyuz.interfaces.buildfarmbuildjob import IBuildFarmBuildJob |
1845 | |
1846 | |
1847 | @@ -30,6 +30,6 @@ |
1848 | description=_("Data common to all job types.")) |
1849 | |
1850 | build = Reference( |
1851 | - IBuild, title=_("Build"), |
1852 | + IBinaryPackageBuild, title=_("Build"), |
1853 | required=True, readonly=True, |
1854 | description=_("Build record associated with this job.")) |
1855 | |
1856 | === modified file 'lib/lp/soyuz/model/archive.py' |
1857 | --- lib/lp/soyuz/model/archive.py 2010-04-08 02:35:06 +0000 |
1858 | +++ lib/lp/soyuz/model/archive.py 2010-04-13 06:59:32 +0000 |
1859 | @@ -42,7 +42,7 @@ |
1860 | from lp.soyuz.model.archivesubscriber import ArchiveSubscriber |
1861 | from lp.soyuz.model.binarypackagerelease import ( |
1862 | BinaryPackageReleaseDownloadCount) |
1863 | -from lp.soyuz.model.build import Build |
1864 | +from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
1865 | from lp.soyuz.model.distributionsourcepackagecache import ( |
1866 | DistributionSourcePackageCache) |
1867 | from lp.soyuz.model.distroseriespackagecache import DistroSeriesPackageCache |
1868 | @@ -71,7 +71,7 @@ |
1869 | from lp.soyuz.interfaces.archivesubscriber import ( |
1870 | ArchiveSubscriberStatus, IArchiveSubscriberSet, ArchiveSubscriptionError) |
1871 | from lp.soyuz.interfaces.binarypackagerelease import BinaryPackageFileType |
1872 | -from lp.soyuz.interfaces.build import IBuildSet |
1873 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
1874 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
1875 | from lp.soyuz.interfaces.component import IComponent, IComponentSet |
1876 | from lp.registry.interfaces.distroseries import IDistroSeriesSet |
1877 | @@ -211,7 +211,7 @@ |
1878 | for (family, archive_arch) in restricted_families: |
1879 | if family == arm: |
1880 | return (archive_arch is not None) |
1881 | - # ARM doesn't exist or isn't restricted. Either way, there is no |
1882 | + # ARM doesn't exist or isn't restricted. Either way, there is no |
1883 | # need for an explicit association. |
1884 | return False |
1885 | |
1886 | @@ -358,7 +358,7 @@ |
1887 | """See IHasBuildRecords""" |
1888 | # Ignore "user", since anyone already accessing this archive |
1889 | # will implicitly have permission to see it. |
1890 | - return getUtility(IBuildSet).getBuildsForArchive( |
1891 | + return getUtility(IBinaryPackageBuildSet).getBuildsForArchive( |
1892 | self, build_state, name, pocket, arch_tag) |
1893 | |
1894 | def getPublishedSources(self, name=None, version=None, status=None, |
1895 | @@ -873,17 +873,19 @@ |
1896 | store = Store.of(self) |
1897 | extra_exprs = [] |
1898 | if not include_needsbuild: |
1899 | - extra_exprs.append(Build.buildstate != BuildStatus.NEEDSBUILD) |
1900 | + extra_exprs.append( |
1901 | + BinaryPackageBuild.buildstate != BuildStatus.NEEDSBUILD) |
1902 | |
1903 | find_spec = ( |
1904 | - Build.buildstate, |
1905 | - Count(Build.id) |
1906 | + BinaryPackageBuild.buildstate, |
1907 | + Count(BinaryPackageBuild.id) |
1908 | ) |
1909 | - result = store.using(Build).find( |
1910 | + result = store.using(BinaryPackageBuild).find( |
1911 | find_spec, |
1912 | - Build.archive == self, |
1913 | + BinaryPackageBuild.archive == self, |
1914 | *extra_exprs |
1915 | - ).group_by(Build.buildstate).order_by(Build.buildstate) |
1916 | + ).group_by(BinaryPackageBuild.buildstate).order_by( |
1917 | + BinaryPackageBuild.buildstate) |
1918 | |
1919 | # Create a map for each count summary to a number of buildstates: |
1920 | count_map = { |
1921 | @@ -1137,8 +1139,8 @@ |
1922 | BinaryPackageRelease, |
1923 | BinaryPackageRelease.binarypackagename == name, |
1924 | BinaryPackageRelease.version == version, |
1925 | - Build.id == BinaryPackageRelease.buildID, |
1926 | - DistroArchSeries.id == Build.distroarchseriesID, |
1927 | + BinaryPackageBuild.id == BinaryPackageRelease.buildID, |
1928 | + DistroArchSeries.id == BinaryPackageBuild.distroarchseriesID, |
1929 | DistroArchSeries.architecturetag == archtag, |
1930 | BinaryPackagePublishingHistory.archive == self, |
1931 | BinaryPackagePublishingHistory.binarypackagereleaseID == |
1932 | @@ -1335,12 +1337,13 @@ |
1933 | |
1934 | extra_exprs = [] |
1935 | if build_status is not None: |
1936 | - extra_exprs.append(Build.buildstate == build_status) |
1937 | + extra_exprs.append(BinaryPackageBuild.buildstate == build_status) |
1938 | |
1939 | result_set = store.find( |
1940 | SourcePackageRelease, |
1941 | - Build.sourcepackagereleaseID == SourcePackageRelease.id, |
1942 | - Build.archive == self, |
1943 | + (BinaryPackageBuild.sourcepackagereleaseID == |
1944 | + SourcePackageRelease.id), |
1945 | + BinaryPackageBuild.archive == self, |
1946 | *extra_exprs) |
1947 | |
1948 | result_set.config(distinct=True).order_by(SourcePackageRelease.id) |
1949 | |
1950 | === renamed file 'lib/lp/soyuz/model/build.py' => 'lib/lp/soyuz/model/binarypackagebuild.py' |
1951 | --- lib/lp/soyuz/model/build.py 2010-03-07 04:06:22 +0000 |
1952 | +++ lib/lp/soyuz/model/binarypackagebuild.py 2010-04-13 06:59:32 +0000 |
1953 | @@ -4,7 +4,7 @@ |
1954 | # pylint: disable-msg=E0611,W0212 |
1955 | |
1956 | __metaclass__ = type |
1957 | -__all__ = ['Build', 'BuildSet'] |
1958 | +__all__ = ['BinaryPackageBuild', 'BinaryPackageBuildSet'] |
1959 | |
1960 | import apt_pkg |
1961 | import datetime |
1962 | @@ -49,8 +49,9 @@ |
1963 | from lp.services.job.model.job import Job |
1964 | from lp.soyuz.adapters.archivedependencies import get_components_for_building |
1965 | from lp.soyuz.interfaces.archive import ArchivePurpose |
1966 | -from lp.soyuz.interfaces.build import ( |
1967 | - BuildSetStatus, CannotBeRescored, IBuild, IBuildSet) |
1968 | +from lp.soyuz.interfaces.binarypackagebuild import ( |
1969 | + BuildSetStatus, CannotBeRescored, IBinaryPackageBuild, |
1970 | + IBinaryPackageBuildSet) |
1971 | from lp.buildmaster.interfaces.buildbase import IBuildBase |
1972 | from lp.soyuz.interfaces.publishing import active_publishing_status |
1973 | from lp.soyuz.model.binarypackagerelease import BinaryPackageRelease |
1974 | @@ -62,8 +63,8 @@ |
1975 | PackageUpload, PackageUploadBuild) |
1976 | |
1977 | |
1978 | -class Build(BuildBase, SQLBase): |
1979 | - implements(IBuildBase, IBuild) |
1980 | +class BinaryPackageBuild(BuildBase, SQLBase): |
1981 | + implements(IBuildBase, IBinaryPackageBuild) |
1982 | _table = 'Build' |
1983 | _defaultOrder = 'id' |
1984 | |
1985 | @@ -470,7 +471,7 @@ |
1986 | # Look for all sourcepackagerelease instances that match the name |
1987 | # and get the (successfully built) build records for this |
1988 | # package. |
1989 | - completed_builds = Build.select(""" |
1990 | + completed_builds = BinaryPackageBuild.select(""" |
1991 | Build.sourcepackagerelease = SourcePackageRelease.id AND |
1992 | Build.id != %s AND |
1993 | Build.buildduration IS NOT NULL AND |
1994 | @@ -693,11 +694,11 @@ |
1995 | raise NotFoundError(filename) |
1996 | |
1997 | |
1998 | -class BuildSet: |
1999 | - implements(IBuildSet) |
2000 | +class BinaryPackageBuildSet: |
2001 | + implements(IBinaryPackageBuildSet) |
2002 | |
2003 | def getBuildBySRAndArchtag(self, sourcepackagereleaseID, archtag): |
2004 | - """See `IBuildSet`""" |
2005 | + """See `IBinaryPackageBuildSet`""" |
2006 | clauseTables = ['DistroArchSeries'] |
2007 | query = ('Build.sourcepackagerelease = %s ' |
2008 | 'AND Build.distroarchseries = DistroArchSeries.id ' |
2009 | @@ -705,25 +706,25 @@ |
2010 | % sqlvalues(sourcepackagereleaseID, archtag) |
2011 | ) |
2012 | |
2013 | - return Build.select(query, clauseTables=clauseTables) |
2014 | + return BinaryPackageBuild.select(query, clauseTables=clauseTables) |
2015 | |
2016 | def getByBuildID(self, id): |
2017 | - """See `IBuildSet`.""" |
2018 | + """See `IBinaryPackageBuildSet`.""" |
2019 | try: |
2020 | - return Build.get(id) |
2021 | + return BinaryPackageBuild.get(id) |
2022 | except SQLObjectNotFound, e: |
2023 | raise NotFoundError(str(e)) |
2024 | |
2025 | def getPendingBuildsForArchSet(self, archseries): |
2026 | - """See `IBuildSet`.""" |
2027 | + """See `IBinaryPackageBuildSet`.""" |
2028 | if not archseries: |
2029 | return None |
2030 | |
2031 | archseries_ids = [d.id for d in archseries] |
2032 | |
2033 | - return Build.select( |
2034 | - AND(Build.q.buildstate==BuildStatus.NEEDSBUILD, |
2035 | - IN(Build.q.distroarchseriesID, archseries_ids)) |
2036 | + return BinaryPackageBuild.select( |
2037 | + AND(BinaryPackageBuild.q.buildstate==BuildStatus.NEEDSBUILD, |
2038 | + IN(BinaryPackageBuild.q.distroarchseriesID, archseries_ids)) |
2039 | ) |
2040 | |
2041 | def handleOptionalParamsForBuildQueries( |
2042 | @@ -775,7 +776,7 @@ |
2043 | |
2044 | def getBuildsForBuilder(self, builder_id, status=None, name=None, |
2045 | arch_tag=None, user=None): |
2046 | - """See `IBuildSet`.""" |
2047 | + """See `IBinaryPackageBuildSet`.""" |
2048 | queries = [] |
2049 | clauseTables = [] |
2050 | |
2051 | @@ -801,12 +802,13 @@ |
2052 | |
2053 | queries.append("builder=%s" % builder_id) |
2054 | |
2055 | - return Build.select(" AND ".join(queries), clauseTables=clauseTables, |
2056 | - orderBy=["-Build.datebuilt", "id"]) |
2057 | + return BinaryPackageBuild.select( |
2058 | + " AND ".join(queries), clauseTables=clauseTables, |
2059 | + orderBy=["-Build.datebuilt", "id"]) |
2060 | |
2061 | def getBuildsForArchive(self, archive, status=None, name=None, |
2062 | pocket=None, arch_tag=None): |
2063 | - """See `IBuildSet`.""" |
2064 | + """See `IBinaryPackageBuildSet`.""" |
2065 | queries = [] |
2066 | clauseTables = [] |
2067 | |
2068 | @@ -828,17 +830,18 @@ |
2069 | clause = " AND ".join(queries) |
2070 | |
2071 | return self._decorate_with_prejoins( |
2072 | - Build.select(clause, clauseTables=clauseTables, orderBy=orderBy)) |
2073 | + BinaryPackageBuild.select( |
2074 | + clause, clauseTables=clauseTables, orderBy=orderBy)) |
2075 | |
2076 | def getBuildsByArchIds(self, arch_ids, status=None, name=None, |
2077 | pocket=None): |
2078 | - """See `IBuildSet`.""" |
2079 | + """See `IBinaryPackageBuildSet`.""" |
2080 | # If not distroarchseries was found return empty list |
2081 | if not arch_ids: |
2082 | # XXX cprov 2006-09-08: returning and empty SelectResult to make |
2083 | # the callsites happy as bjorn suggested. However it would be |
2084 | # much clearer if we have something like SQLBase.empty() for this |
2085 | - return Build.select("2=1") |
2086 | + return BinaryPackageBuild.select("2=1") |
2087 | |
2088 | clauseTables = [] |
2089 | |
2090 | @@ -894,7 +897,7 @@ |
2091 | sqlvalues(ArchivePurpose.PRIMARY, ArchivePurpose.PARTNER))) |
2092 | |
2093 | return self._decorate_with_prejoins( |
2094 | - Build.select(' AND '.join(condition_clauses), |
2095 | + BinaryPackageBuild.select(' AND '.join(condition_clauses), |
2096 | clauseTables=clauseTables, orderBy=orderBy)) |
2097 | |
2098 | def _decorate_with_prejoins(self, result_set): |
2099 | @@ -906,12 +909,12 @@ |
2100 | return decorated_results |
2101 | |
2102 | def retryDepWaiting(self, distroarchseries): |
2103 | - """See `IBuildSet`. """ |
2104 | + """See `IBinaryPackageBuildSet`. """ |
2105 | # XXX cprov 20071122: use the root logger once bug 164203 is fixed. |
2106 | logger = logging.getLogger('retry-depwait') |
2107 | |
2108 | # Get the MANUALDEPWAIT records for all archives. |
2109 | - candidates = Build.selectBy( |
2110 | + candidates = BinaryPackageBuild.selectBy( |
2111 | buildstate=BuildStatus.MANUALDEPWAIT, |
2112 | distroarchseries=distroarchseries) |
2113 | |
2114 | @@ -937,7 +940,7 @@ |
2115 | |
2116 | def getBuildsBySourcePackageRelease(self, sourcepackagerelease_ids, |
2117 | buildstate=None): |
2118 | - """See `IBuildSet`.""" |
2119 | + """See `IBinaryPackageBuildSet`.""" |
2120 | if (sourcepackagerelease_ids is None or |
2121 | len(sourcepackagerelease_ids) == 0): |
2122 | return [] |
2123 | @@ -951,12 +954,12 @@ |
2124 | if buildstate is not None: |
2125 | query += "AND buildstate = %s" % sqlvalues(buildstate) |
2126 | |
2127 | - return Build.select( |
2128 | + return BinaryPackageBuild.select( |
2129 | query, orderBy=["-datecreated", "id"], |
2130 | clauseTables=["Archive"]) |
2131 | |
2132 | def getStatusSummaryForBuilds(self, builds): |
2133 | - """See `IBuildSet`.""" |
2134 | + """See `IBinaryPackageBuildSet`.""" |
2135 | # Create a small helper function to collect the builds for a given |
2136 | # list of build states: |
2137 | def collect_builds(*states): |
2138 | @@ -1024,26 +1027,27 @@ |
2139 | build_ids = [build.id for build in results] |
2140 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
2141 | origin = ( |
2142 | - Build, |
2143 | + BinaryPackageBuild, |
2144 | LeftJoin( |
2145 | SourcePackageRelease, |
2146 | - SourcePackageRelease.id == Build.sourcepackagereleaseID), |
2147 | + (SourcePackageRelease.id == |
2148 | + BinaryPackageBuild.sourcepackagereleaseID)), |
2149 | LeftJoin( |
2150 | SourcePackageName, |
2151 | SourcePackageName.id |
2152 | == SourcePackageRelease.sourcepackagenameID), |
2153 | LeftJoin(LibraryFileAlias, |
2154 | - LibraryFileAlias.id == Build.buildlogID), |
2155 | + LibraryFileAlias.id == BinaryPackageBuild.buildlogID), |
2156 | LeftJoin(LibraryFileContent, |
2157 | LibraryFileContent.id == LibraryFileAlias.contentID), |
2158 | LeftJoin( |
2159 | Builder, |
2160 | - Builder.id == Build.builderID), |
2161 | + Builder.id == BinaryPackageBuild.builderID), |
2162 | ) |
2163 | result_set = store.using(*origin).find( |
2164 | (SourcePackageRelease, LibraryFileAlias, SourcePackageName, |
2165 | LibraryFileContent, Builder), |
2166 | - In(Build.id, build_ids)) |
2167 | + In(BinaryPackageBuild.id, build_ids)) |
2168 | |
2169 | # Force query execution so that the ancillary data gets fetched |
2170 | # and added to StupidCache. |
2171 | @@ -1053,36 +1057,38 @@ |
2172 | return list(result_set) |
2173 | |
2174 | def getByQueueEntry(self, queue_entry): |
2175 | - """See `IBuildSet`.""" |
2176 | + """See `IBinaryPackageBuildSet`.""" |
2177 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
2178 | result_set = store.find( |
2179 | - Build, |
2180 | - BuildPackageJob.build == Build.id, |
2181 | + BinaryPackageBuild, |
2182 | + BuildPackageJob.build == BinaryPackageBuild.id, |
2183 | BuildPackageJob.job == BuildQueue.jobID, |
2184 | BuildQueue.job == queue_entry.job) |
2185 | |
2186 | return result_set.one() |
2187 | |
2188 | def getQueueEntriesForBuildIDs(self, build_ids): |
2189 | - """See `IBuildSet`.""" |
2190 | + """See `IBinaryPackageBuildSet`.""" |
2191 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
2192 | |
2193 | origin = ( |
2194 | BuildPackageJob, |
2195 | Join(BuildQueue, BuildPackageJob.job == BuildQueue.jobID), |
2196 | - Join(Build, BuildPackageJob.build == Build.id), |
2197 | + Join( |
2198 | + BinaryPackageBuild, |
2199 | + BuildPackageJob.build == BinaryPackageBuild.id), |
2200 | LeftJoin( |
2201 | Builder, |
2202 | BuildQueue.builderID == Builder.id), |
2203 | ) |
2204 | result_set = store.using(*origin).find( |
2205 | (BuildQueue, Builder, BuildPackageJob), |
2206 | - In(Build.id, build_ids)) |
2207 | + In(BinaryPackageBuild.id, build_ids)) |
2208 | |
2209 | return result_set |
2210 | |
2211 | def calculateCandidates(self, archseries): |
2212 | - """See `IBuildSet`.""" |
2213 | + """See `IBinaryPackageBuildSet`.""" |
2214 | if not archseries: |
2215 | raise AssertionError("Given 'archseries' cannot be None/empty.") |
2216 | |
2217 | |
2218 | === modified file 'lib/lp/soyuz/model/binarypackagerelease.py' |
2219 | --- lib/lp/soyuz/model/binarypackagerelease.py 2010-03-15 23:02:21 +0000 |
2220 | +++ lib/lp/soyuz/model/binarypackagerelease.py 2010-04-13 06:59:32 +0000 |
2221 | @@ -38,7 +38,8 @@ |
2222 | version = StringCol(dbName='version', notNull=True) |
2223 | summary = StringCol(dbName='summary', notNull=True, default="") |
2224 | description = StringCol(dbName='description', notNull=True) |
2225 | - build = ForeignKey(dbName='build', foreignKey='Build', notNull=True) |
2226 | + build = ForeignKey( |
2227 | + dbName='build', foreignKey='BinaryPackageBuild', notNull=True) |
2228 | binpackageformat = EnumCol(dbName='binpackageformat', notNull=True, |
2229 | schema=BinaryPackageFormat) |
2230 | component = ForeignKey(dbName='component', foreignKey='Component', |
2231 | |
2232 | === modified file 'lib/lp/soyuz/model/buildpackagejob.py' |
2233 | --- lib/lp/soyuz/model/buildpackagejob.py 2010-03-25 14:38:25 +0000 |
2234 | +++ lib/lp/soyuz/model/buildpackagejob.py 2010-04-13 06:59:32 +0000 |
2235 | @@ -22,7 +22,7 @@ |
2236 | from lp.registry.interfaces.sourcepackage import SourcePackageUrgency |
2237 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
2238 | from lp.soyuz.interfaces.archive import ArchivePurpose |
2239 | -from lp.soyuz.interfaces.build import IBuildSet |
2240 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
2241 | from lp.soyuz.interfaces.buildpackagejob import IBuildPackageJob |
2242 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
2243 | |
2244 | @@ -38,7 +38,7 @@ |
2245 | job = Reference(job_id, 'Job.id') |
2246 | |
2247 | build_id = Int(name='build', allow_none=False) |
2248 | - build = Reference(build_id, 'Build.id') |
2249 | + build = Reference(build_id, 'BinaryPackageBuild.id') |
2250 | |
2251 | def score(self): |
2252 | """See `IBuildPackageJob`.""" |
2253 | @@ -242,7 +242,7 @@ |
2254 | # Builds in those situation should not be built because they will |
2255 | # be wasting build-time, the former case already has a newer source |
2256 | # and the latter could not be built in DAK. |
2257 | - build_set = getUtility(IBuildSet) |
2258 | + build_set = getUtility(IBinaryPackageBuildSet) |
2259 | |
2260 | build = build_set.getByQueueEntry(job) |
2261 | if build.pocket == PackagePublishingPocket.SECURITY: |
2262 | |
2263 | === modified file 'lib/lp/soyuz/model/distributionsourcepackagerelease.py' |
2264 | --- lib/lp/soyuz/model/distributionsourcepackagerelease.py 2009-09-18 12:18:51 +0000 |
2265 | +++ lib/lp/soyuz/model/distributionsourcepackagerelease.py 2010-04-13 06:59:32 +0000 |
2266 | @@ -29,7 +29,7 @@ |
2267 | DistroSeriesBinaryPackage) |
2268 | from lp.soyuz.model.publishing import ( |
2269 | BinaryPackagePublishingHistory) |
2270 | -from lp.soyuz.model.build import Build |
2271 | +from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2272 | from lp.soyuz.model.publishing import \ |
2273 | SourcePackagePublishingHistory |
2274 | from lp.soyuz.interfaces.archive import MAIN_ARCHIVE_PURPOSES |
2275 | @@ -100,8 +100,9 @@ |
2276 | # distribution that were built for a PPA but have been published |
2277 | # in a main archive. |
2278 | builds_for_distro_exprs = ( |
2279 | - Build.sourcepackagerelease == self.sourcepackagerelease, |
2280 | - Build.distroarchseries == DistroArchSeries.id, |
2281 | + (BinaryPackageBuild.sourcepackagerelease == |
2282 | + self.sourcepackagerelease), |
2283 | + BinaryPackageBuild.distroarchseries == DistroArchSeries.id, |
2284 | DistroArchSeries.distroseries == DistroSeries.id, |
2285 | DistroSeries.distribution == self.distribution, |
2286 | ) |
2287 | @@ -109,9 +110,9 @@ |
2288 | # First, get all the builds built in a main archive (this will |
2289 | # include new and failed builds.) |
2290 | builds_built_in_main_archives = store.find( |
2291 | - Build, |
2292 | + BinaryPackageBuild, |
2293 | builds_for_distro_exprs, |
2294 | - Build.archive == Archive.id, |
2295 | + BinaryPackageBuild.archive == Archive.id, |
2296 | Archive.purpose.is_in(MAIN_ARCHIVE_PURPOSES)) |
2297 | |
2298 | # Next get all the builds that have a binary published in the |
2299 | @@ -119,9 +120,9 @@ |
2300 | # query, but not the new/failed ones. It will also include |
2301 | # ppa builds that have been published in main archives. |
2302 | builds_published_in_main_archives = store.find( |
2303 | - Build, |
2304 | + BinaryPackageBuild, |
2305 | builds_for_distro_exprs, |
2306 | - BinaryPackageRelease.build == Build.id, |
2307 | + BinaryPackageRelease.build == BinaryPackageBuild.id, |
2308 | BinaryPackagePublishingHistory.binarypackagerelease == |
2309 | BinaryPackageRelease.id, |
2310 | BinaryPackagePublishingHistory.archive == Archive.id, |
2311 | @@ -130,7 +131,8 @@ |
2312 | |
2313 | return builds_built_in_main_archives.union( |
2314 | builds_published_in_main_archives).order_by( |
2315 | - Desc(Build.datecreated), Desc(Build.id)) |
2316 | + Desc( |
2317 | + BinaryPackageBuild.datecreated), Desc(BinaryPackageBuild.id)) |
2318 | |
2319 | @property |
2320 | def binary_package_names(self): |
2321 | |
2322 | === modified file 'lib/lp/soyuz/model/distroarchseries.py' |
2323 | --- lib/lp/soyuz/model/distroarchseries.py 2010-02-22 10:31:48 +0000 |
2324 | +++ lib/lp/soyuz/model/distroarchseries.py 2010-04-13 06:59:32 +0000 |
2325 | @@ -26,7 +26,7 @@ |
2326 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
2327 | from lp.soyuz.interfaces.binarypackagename import IBinaryPackageName |
2328 | from lp.soyuz.interfaces.binarypackagerelease import IBinaryPackageReleaseSet |
2329 | -from lp.soyuz.interfaces.build import IBuildSet |
2330 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
2331 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
2332 | from lp.soyuz.interfaces.distroarchseries import ( |
2333 | IDistroArchSeries, IDistroArchSeriesSet, IPocketChroot) |
2334 | @@ -240,8 +240,9 @@ |
2335 | if arch_tag is not None and arch_tag != self.architecturetag: |
2336 | return EmptyResultSet() |
2337 | |
2338 | - # Use the facility provided by IBuildSet to retrieve the records. |
2339 | - return getUtility(IBuildSet).getBuildsByArchIds( |
2340 | + # Use the facility provided by IBinaryPackageBuildSet to |
2341 | + # retrieve the records. |
2342 | + return getUtility(IBinaryPackageBuildSet).getBuildsByArchIds( |
2343 | [self.id], build_state, name, pocket) |
2344 | |
2345 | def getReleasedPackages(self, binary_name, pocket=None, |
2346 | |
2347 | === modified file 'lib/lp/soyuz/model/publishedpackage.py' |
2348 | --- lib/lp/soyuz/model/publishedpackage.py 2009-06-25 04:06:00 +0000 |
2349 | +++ lib/lp/soyuz/model/publishedpackage.py 2010-04-13 06:59:32 +0000 |
2350 | @@ -53,7 +53,7 @@ |
2351 | binarypackagesummary = StringCol(immutable=True) |
2352 | binarypackagedescription = StringCol(immutable=True) |
2353 | binarypackageversion = StringCol(immutable=True) |
2354 | - build = ForeignKey(foreignKey='Build', dbName='build') |
2355 | + build = ForeignKey(foreignKey='BinaryPackageBuild', dbName='build') |
2356 | datebuilt = UtcDateTimeCol(immutable=True) |
2357 | sourcepackagerelease = ForeignKey(dbName="sourcepackagerelease", |
2358 | foreignKey="SourcePackageRelease", |
2359 | |
2360 | === modified file 'lib/lp/soyuz/model/publishing.py' |
2361 | --- lib/lp/soyuz/model/publishing.py 2010-04-03 03:29:23 +0000 |
2362 | +++ lib/lp/soyuz/model/publishing.py 2010-04-13 06:59:32 +0000 |
2363 | @@ -54,7 +54,8 @@ |
2364 | from lp.soyuz.model.packagediff import PackageDiff |
2365 | from lp.soyuz.interfaces.archive import ArchivePurpose |
2366 | from lp.soyuz.interfaces.archivearch import IArchiveArchSet |
2367 | -from lp.soyuz.interfaces.build import BuildSetStatus, IBuildSet |
2368 | +from lp.soyuz.interfaces.binarypackagebuild import ( |
2369 | + BuildSetStatus, IBinaryPackageBuildSet) |
2370 | from lp.soyuz.interfaces.component import IComponentSet |
2371 | from lp.soyuz.interfaces.publishing import ( |
2372 | active_publishing_status, IBinaryPackageFilePublishing, |
2373 | @@ -510,19 +511,19 @@ |
2374 | return the_url |
2375 | |
2376 | def _getAllowedArchitectures(self, available_archs): |
2377 | - """Filter out any restricted architectures not specifically allowed |
2378 | + """Filter out any restricted architectures not specifically allowed |
2379 | for an archive. |
2380 | |
2381 | :param available_archs: Architectures to consider |
2382 | :return: Sequence of `IDistroArch` instances. |
2383 | """ |
2384 | associated_proc_families = [ |
2385 | - archivearch.processorfamily for archivearch |
2386 | + archivearch.processorfamily for archivearch |
2387 | in getUtility(IArchiveArchSet).getByArchive(self.archive)] |
2388 | # Return all distroarches with unrestricted processor families or with |
2389 | # processor families the archive is explicitly associated with. |
2390 | return [distroarch for distroarch in available_archs |
2391 | - if not distroarch.processorfamily.restricted or |
2392 | + if not distroarch.processorfamily.restricted or |
2393 | distroarch.processorfamily in associated_proc_families] |
2394 | |
2395 | def createMissingBuilds(self, architectures_available=None, |
2396 | @@ -553,8 +554,8 @@ |
2397 | def _createMissingBuildForArchitecture(self, arch, logger=None): |
2398 | """Create a build for a given architecture if it doesn't exist yet. |
2399 | |
2400 | - Return the just-created `IBuild` record already scored or None |
2401 | - if a suitable build is already present. |
2402 | + Return the just-created `IBinaryPackageBuild` record already |
2403 | + scored or None if a suitable build is already present. |
2404 | """ |
2405 | build_candidate = self.sourcepackagerelease.getBuildByArch( |
2406 | arch, self.archive) |
2407 | @@ -804,8 +805,8 @@ |
2408 | datepublished = UtcDateTimeCol(default=None) |
2409 | datecreated = UtcDateTimeCol(default=UTC_NOW) |
2410 | datesuperseded = UtcDateTimeCol(default=None) |
2411 | - supersededby = ForeignKey(foreignKey='Build', dbName='supersededby', |
2412 | - default=None) |
2413 | + supersededby = ForeignKey( |
2414 | + foreignKey='BinaryPackageBuild', dbName='supersededby', default=None) |
2415 | datemadepending = UtcDateTimeCol(default=None) |
2416 | dateremoved = UtcDateTimeCol(default=None) |
2417 | pocket = EnumCol(dbName='pocket', schema=PackagePublishingPocket) |
2418 | @@ -1167,7 +1168,7 @@ |
2419 | # Import Build and DistroArchSeries locally to avoid circular |
2420 | # imports, since that Build uses SourcePackagePublishingHistory |
2421 | # and DistroArchSeries uses BinaryPackagePublishingHistory. |
2422 | - from lp.soyuz.model.build import Build |
2423 | + from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2424 | from lp.soyuz.model.distroarchseries import ( |
2425 | DistroArchSeries) |
2426 | |
2427 | @@ -1182,41 +1183,43 @@ |
2428 | # ensure that the result is limited to builds in those states. |
2429 | if build_states is not None: |
2430 | extra_exprs.append( |
2431 | - Build.buildstate.is_in(build_states)) |
2432 | + BinaryPackageBuild.buildstate.is_in(build_states)) |
2433 | |
2434 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
2435 | |
2436 | # We'll be looking for builds in the same distroseries as the |
2437 | # SPPH for the same release. |
2438 | builds_for_distroseries_expr = ( |
2439 | - Build.distroarchseriesID == DistroArchSeries.id, |
2440 | + BinaryPackageBuild.distroarchseriesID == DistroArchSeries.id, |
2441 | SourcePackagePublishingHistory.distroseriesID == |
2442 | DistroArchSeries.distroseriesID, |
2443 | SourcePackagePublishingHistory.sourcepackagereleaseID == |
2444 | - Build.sourcepackagereleaseID, |
2445 | + BinaryPackageBuild.sourcepackagereleaseID, |
2446 | In(SourcePackagePublishingHistory.id, source_publication_ids) |
2447 | ) |
2448 | |
2449 | # First, we'll find the builds that were built in the same |
2450 | # archive context as the published sources. |
2451 | builds_in_same_archive = store.find( |
2452 | - Build, |
2453 | + BinaryPackageBuild, |
2454 | builds_for_distroseries_expr, |
2455 | - SourcePackagePublishingHistory.archiveID == Build.archiveID, |
2456 | + (SourcePackagePublishingHistory.archiveID == |
2457 | + BinaryPackageBuild.archiveID), |
2458 | *extra_exprs) |
2459 | |
2460 | # Next get all the builds that have a binary published in the |
2461 | # same archive... even though the build was not built in |
2462 | # the same context archive. |
2463 | builds_copied_into_archive = store.find( |
2464 | - Build, |
2465 | + BinaryPackageBuild, |
2466 | builds_for_distroseries_expr, |
2467 | - SourcePackagePublishingHistory.archiveID != Build.archiveID, |
2468 | + (SourcePackagePublishingHistory.archiveID != |
2469 | + BinaryPackageBuild.archiveID), |
2470 | BinaryPackagePublishingHistory.archive == |
2471 | SourcePackagePublishingHistory.archiveID, |
2472 | BinaryPackagePublishingHistory.binarypackagerelease == |
2473 | BinaryPackageRelease.id, |
2474 | - BinaryPackageRelease.build == Build.id, |
2475 | + BinaryPackageRelease.build == BinaryPackageBuild.id, |
2476 | *extra_exprs) |
2477 | |
2478 | builds_union = builds_copied_into_archive.union( |
2479 | @@ -1228,7 +1231,10 @@ |
2480 | # can't sort on SourcePackagePublishingHistory.id after the |
2481 | # union. See bug 443353 for details. |
2482 | find_spec = ( |
2483 | - SourcePackagePublishingHistory, Build, DistroArchSeries) |
2484 | + SourcePackagePublishingHistory, |
2485 | + BinaryPackageBuild, |
2486 | + DistroArchSeries, |
2487 | + ) |
2488 | |
2489 | # Storm doesn't let us do builds_union.values('id') - |
2490 | # ('Union' object has no attribute 'columns'). So instead |
2491 | @@ -1237,7 +1243,7 @@ |
2492 | |
2493 | result_set = store.find( |
2494 | find_spec, builds_for_distroseries_expr, |
2495 | - Build.id.is_in(build_ids)) |
2496 | + BinaryPackageBuild.id.is_in(build_ids)) |
2497 | |
2498 | return result_set.order_by( |
2499 | SourcePackagePublishingHistory.id, |
2500 | @@ -1285,14 +1291,14 @@ |
2501 | # to avoid circular imports, since Build uses |
2502 | # SourcePackagePublishingHistory, BinaryPackageRelease uses Build |
2503 | # and DistroArchSeries uses BinaryPackagePublishingHistory. |
2504 | - from lp.soyuz.model.build import Build |
2505 | + from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2506 | from lp.soyuz.model.distroarchseries import ( |
2507 | DistroArchSeries) |
2508 | |
2509 | join = [ |
2510 | SourcePackagePublishingHistory.sourcepackagereleaseID == |
2511 | - Build.sourcepackagereleaseID, |
2512 | - BinaryPackageRelease.build == Build.id, |
2513 | + BinaryPackageBuild.sourcepackagereleaseID, |
2514 | + BinaryPackageRelease.build == BinaryPackageBuild.id, |
2515 | BinaryPackageRelease.binarypackagenameID == |
2516 | BinaryPackageName.id, |
2517 | SourcePackagePublishingHistory.distroseriesID == |
2518 | @@ -1326,7 +1332,7 @@ |
2519 | # to avoid circular imports, since Build uses |
2520 | # SourcePackagePublishingHistory and DistroArchSeries uses |
2521 | # BinaryPackagePublishingHistory. |
2522 | - from lp.soyuz.model.build import Build |
2523 | + from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2524 | from lp.soyuz.model.distroarchseries import ( |
2525 | DistroArchSeries) |
2526 | |
2527 | @@ -1338,12 +1344,15 @@ |
2528 | one_or_more_source_publications) |
2529 | |
2530 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
2531 | - published_builds = store.find( |
2532 | - (SourcePackagePublishingHistory, Build, DistroArchSeries), |
2533 | + published_builds = store.find(( |
2534 | + SourcePackagePublishingHistory, |
2535 | + BinaryPackageBuild, |
2536 | + DistroArchSeries |
2537 | + ), |
2538 | self._getSourceBinaryJoinForSources( |
2539 | source_publication_ids, active_binaries_only=False), |
2540 | BinaryPackagePublishingHistory.datepublished != None, |
2541 | - Build.buildstate.is_in(build_states)) |
2542 | + BinaryPackageBuild.buildstate.is_in(build_states)) |
2543 | |
2544 | published_builds.order_by( |
2545 | SourcePackagePublishingHistory.id, |
2546 | @@ -1361,7 +1370,7 @@ |
2547 | """See `IPublishingSet`.""" |
2548 | # Import Build locally to avoid circular imports, since that |
2549 | # Build already imports SourcePackagePublishingHistory. |
2550 | - from lp.soyuz.model.build import Build |
2551 | + from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2552 | |
2553 | source_publication_ids = self._extractIDs( |
2554 | one_or_more_source_publications) |
2555 | @@ -1374,9 +1383,9 @@ |
2556 | LibraryFileAlias.id == BinaryPackageFile.libraryfileID, |
2557 | BinaryPackageFile.binarypackagerelease == |
2558 | BinaryPackageRelease.id, |
2559 | - BinaryPackageRelease.buildID == Build.id, |
2560 | + BinaryPackageRelease.buildID == BinaryPackageBuild.id, |
2561 | SourcePackagePublishingHistory.sourcepackagereleaseID == |
2562 | - Build.sourcepackagereleaseID, |
2563 | + BinaryPackageBuild.sourcepackagereleaseID, |
2564 | BinaryPackagePublishingHistory.binarypackagereleaseID == |
2565 | BinaryPackageRelease.id, |
2566 | BinaryPackagePublishingHistory.archiveID == |
2567 | @@ -1542,8 +1551,8 @@ |
2568 | used in the calculation. |
2569 | """ |
2570 | builds = source_publication.getBuilds() |
2571 | - summary = getUtility(IBuildSet).getStatusSummaryForBuilds( |
2572 | - builds) |
2573 | + summary = getUtility( |
2574 | + IBinaryPackageBuildSet).getStatusSummaryForBuilds(builds) |
2575 | |
2576 | # We only augment the result if: |
2577 | # 1. we (the SPPH) are ourselves in an active publishing state, and |
2578 | |
2579 | === modified file 'lib/lp/soyuz/model/queue.py' |
2580 | --- lib/lp/soyuz/model/queue.py 2010-03-25 03:44:59 +0000 |
2581 | +++ lib/lp/soyuz/model/queue.py 2010-04-13 06:59:32 +0000 |
2582 | @@ -1370,7 +1370,7 @@ |
2583 | foreignKey='PackageUpload' |
2584 | ) |
2585 | |
2586 | - build = ForeignKey(dbName='build', foreignKey='Build') |
2587 | + build = ForeignKey(dbName='build', foreignKey='BinaryPackageBuild') |
2588 | |
2589 | def checkComponentAndSection(self): |
2590 | """See `IPackageUploadBuild`.""" |
2591 | |
2592 | === modified file 'lib/lp/soyuz/model/sourcepackagerelease.py' |
2593 | --- lib/lp/soyuz/model/sourcepackagerelease.py 2010-03-20 23:16:42 +0000 |
2594 | +++ lib/lp/soyuz/model/sourcepackagerelease.py 2010-04-13 06:59:32 +0000 |
2595 | @@ -45,7 +45,7 @@ |
2596 | PackageDiffAlreadyRequested, PackageDiffStatus) |
2597 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
2598 | from lp.soyuz.interfaces.sourcepackagerelease import ISourcePackageRelease |
2599 | -from lp.soyuz.model.build import Build |
2600 | +from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2601 | from lp.soyuz.model.files import SourcePackageReleaseFile |
2602 | from lp.soyuz.model.packagediff import PackageDiff |
2603 | from lp.soyuz.model.publishing import SourcePackagePublishingHistory |
2604 | @@ -144,7 +144,7 @@ |
2605 | # when copy-package works for copying packages across archives, |
2606 | # a build may well have a different archive to the corresponding |
2607 | # sourcepackagerelease. |
2608 | - return Build.select(""" |
2609 | + return BinaryPackageBuild.select(""" |
2610 | sourcepackagerelease = %s AND |
2611 | archive.id = build.archive AND |
2612 | archive.purpose IN %s |
2613 | @@ -327,7 +327,7 @@ |
2614 | # same datecreated. |
2615 | datecreated = datetime.datetime.now(pytz.timezone('UTC')) |
2616 | |
2617 | - return Build(distroarchseries=distroarchseries, |
2618 | + return BinaryPackageBuild(distroarchseries=distroarchseries, |
2619 | sourcepackagerelease=self, |
2620 | processor=processor, |
2621 | buildstate=status, |
2622 | @@ -356,7 +356,7 @@ |
2623 | """ % sqlvalues(self, distroarchseries.architecturetag, |
2624 | distroarchseries, archive) |
2625 | |
2626 | - select_results = Build.select( |
2627 | + select_results = BinaryPackageBuild.select( |
2628 | query, clauseTables=clauseTables, distinct=True, |
2629 | orderBy='-Build.id') |
2630 | |
2631 | @@ -440,7 +440,7 @@ |
2632 | # across all possible locations. |
2633 | query = " AND ".join(queries) |
2634 | |
2635 | - return Build.selectFirst(query, orderBy=['-datecreated']) |
2636 | + return BinaryPackageBuild.selectFirst(query, orderBy=['-datecreated']) |
2637 | |
2638 | def override(self, component=None, section=None, urgency=None): |
2639 | """See ISourcePackageRelease.""" |
2640 | |
2641 | === modified file 'lib/lp/soyuz/scripts/buildd.py' |
2642 | --- lib/lp/soyuz/scripts/buildd.py 2010-04-03 03:38:55 +0000 |
2643 | +++ lib/lp/soyuz/scripts/buildd.py 2010-04-13 06:59:32 +0000 |
2644 | @@ -23,7 +23,7 @@ |
2645 | from lp.registry.interfaces.series import SeriesStatus |
2646 | from lp.services.scripts.base import ( |
2647 | LaunchpadCronScript, LaunchpadScriptFailure) |
2648 | -from lp.soyuz.interfaces.build import IBuildSet |
2649 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
2650 | from lp.soyuz.pas import BuildDaemonPackagesArchSpecific |
2651 | |
2652 | # XXX cprov 2009-04-16: This function should live in |
2653 | @@ -161,7 +161,7 @@ |
2654 | """Create missing Buildd Jobs. """ |
2655 | self.logger.info("Scanning for build queue entries that are missing") |
2656 | |
2657 | - buildset = getUtility(IBuildSet) |
2658 | + buildset = getUtility(IBinaryPackageBuildSet) |
2659 | builds = buildset.getPendingBuildsForArchSet(archseries) |
2660 | |
2661 | if not builds: |
2662 | @@ -186,13 +186,15 @@ |
2663 | return |
2664 | |
2665 | # Get the current build job candidates. |
2666 | - candidates = getUtility(IBuildSet).calculateCandidates(archseries) |
2667 | + candidates = getUtility(IBinaryPackageBuildSet).calculateCandidates( |
2668 | + archseries) |
2669 | |
2670 | self.logger.info("Found %d build in NEEDSBUILD state. Rescoring" |
2671 | % candidates.count()) |
2672 | |
2673 | for job in candidates: |
2674 | - uptodate_build = getUtility(IBuildSet).getByQueueEntry(job) |
2675 | + uptodate_build = getUtility( |
2676 | + IBinaryPackageBuildSet).getByQueueEntry(job) |
2677 | if uptodate_build.buildstate != BuildStatus.NEEDSBUILD: |
2678 | continue |
2679 | job.score() |
2680 | @@ -250,7 +252,7 @@ |
2681 | "Could not find distribution: %s" % self.options.distribution) |
2682 | |
2683 | # Iterate over all supported distroarchseries with available chroot. |
2684 | - build_set = getUtility(IBuildSet) |
2685 | + build_set = getUtility(IBinaryPackageBuildSet) |
2686 | for distroseries in distribution: |
2687 | if distroseries.status == SeriesStatus.OBSOLETE: |
2688 | self.logger.debug( |
2689 | |
2690 | === modified file 'lib/lp/soyuz/scripts/gina/handlers.py' |
2691 | --- lib/lp/soyuz/scripts/gina/handlers.py 2010-03-06 04:57:40 +0000 |
2692 | +++ lib/lp/soyuz/scripts/gina/handlers.py 2010-04-13 06:59:32 +0000 |
2693 | @@ -848,7 +848,7 @@ |
2694 | def ensureBuild(self, binary, srcpkg, distroarchinfo, archtag): |
2695 | """Ensure a build record.""" |
2696 | # Avoid circular imports. |
2697 | - from lp.soyuz.model.build import Build |
2698 | + from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2699 | |
2700 | distroarchseries = distroarchinfo['distroarchseries'] |
2701 | distribution = distroarchseries.distroseries.distribution |
2702 | @@ -873,7 +873,7 @@ |
2703 | % quote(archtag)) |
2704 | |
2705 | try: |
2706 | - build = Build.selectOne(query, clauseTables) |
2707 | + build = BinaryPackageBuild.selectOne(query, clauseTables) |
2708 | except SQLObjectMoreThanOneResultError: |
2709 | # XXX kiko 2005-10-27: Untested. |
2710 | raise MultipleBuildError("More than one build was found " |
2711 | @@ -896,7 +896,7 @@ |
2712 | key = None |
2713 | |
2714 | processor = distroarchinfo['processor'] |
2715 | - build = Build(processor=processor.id, |
2716 | + build = BinaryPackageBuild(processor=processor.id, |
2717 | distroarchseries=distroarchseries.id, |
2718 | buildstate=BuildStatus.FULLYBUILT, |
2719 | sourcepackagerelease=srcpkg.id, |
2720 | |
2721 | === modified file 'lib/lp/soyuz/scripts/packagecopier.py' |
2722 | --- lib/lp/soyuz/scripts/packagecopier.py 2010-03-22 10:36:42 +0000 |
2723 | +++ lib/lp/soyuz/scripts/packagecopier.py 2010-04-13 06:59:32 +0000 |
2724 | @@ -28,7 +28,7 @@ |
2725 | from lp.buildmaster.interfaces.buildbase import BuildStatus |
2726 | from lp.soyuz.adapters.packagelocation import build_package_location |
2727 | from lp.soyuz.interfaces.archive import ArchivePurpose, CannotCopy |
2728 | -from lp.soyuz.interfaces.build import BuildSetStatus |
2729 | +from lp.soyuz.interfaces.binarypackagebuild import BuildSetStatus |
2730 | from lp.soyuz.interfaces.publishing import ( |
2731 | IBinaryPackagePublishingHistory, IPublishingSet, |
2732 | ISourcePackagePublishingHistory, active_publishing_status) |
2733 | |
2734 | === modified file 'lib/lp/soyuz/scripts/tests/test_buildd_cronscripts.py' |
2735 | --- lib/lp/soyuz/scripts/tests/test_buildd_cronscripts.py 2010-03-06 04:57:40 +0000 |
2736 | +++ lib/lp/soyuz/scripts/tests/test_buildd_cronscripts.py 2010-04-13 06:59:32 +0000 |
2737 | @@ -21,7 +21,7 @@ |
2738 | from lp.registry.interfaces.distribution import IDistributionSet |
2739 | from lp.services.scripts.base import LaunchpadScriptFailure |
2740 | from lp.soyuz.interfaces.component import IComponentSet |
2741 | -from lp.soyuz.model.build import Build |
2742 | +from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2743 | from lp.soyuz.scripts.buildd import QueueBuilder, RetryDepwait |
2744 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
2745 | |
2746 | @@ -228,7 +228,7 @@ |
2747 | self.number_of_pending_builds = self.getPendingBuilds().count() |
2748 | |
2749 | def getPendingBuilds(self): |
2750 | - return Build.selectBy(buildstate=BuildStatus.NEEDSBUILD) |
2751 | + return BinaryPackageBuild.selectBy(buildstate=BuildStatus.NEEDSBUILD) |
2752 | |
2753 | def getRetryDepwait(self, distribution=None): |
2754 | test_args = ['-n'] |
2755 | @@ -268,7 +268,7 @@ |
2756 | |
2757 | def testWorkingRun(self): |
2758 | """Modify sampledata and expects a new pending build to be created.""" |
2759 | - depwait_build = Build.get(12) |
2760 | + depwait_build = BinaryPackageBuild.get(12) |
2761 | |
2762 | # Moving the target source to universe, so it can reach the only |
2763 | # published binary we have in sampledata. |
2764 | @@ -287,7 +287,7 @@ |
2765 | self.layer.commit() |
2766 | |
2767 | # Reload the build record after the multiple commits. |
2768 | - depwait_build = Build.get(12) |
2769 | + depwait_build = BinaryPackageBuild.get(12) |
2770 | self.assertEqual( |
2771 | self.number_of_pending_builds + 1, |
2772 | self.getPendingBuilds().count()) |
2773 | |
2774 | === modified file 'lib/lp/soyuz/scripts/tests/test_copypackage.py' |
2775 | --- lib/lp/soyuz/scripts/tests/test_copypackage.py 2010-03-24 07:05:39 +0000 |
2776 | +++ lib/lp/soyuz/scripts/tests/test_copypackage.py 2010-04-13 06:59:32 +0000 |
2777 | @@ -30,7 +30,7 @@ |
2778 | from lp.soyuz.adapters.packagelocation import PackageLocationError |
2779 | from lp.soyuz.interfaces.archive import ( |
2780 | ArchivePurpose, CannotCopy) |
2781 | -from lp.soyuz.interfaces.build import BuildSetStatus |
2782 | +from lp.soyuz.interfaces.binarypackagebuild import BuildSetStatus |
2783 | from lp.soyuz.interfaces.component import IComponentSet |
2784 | from lp.soyuz.interfaces.publishing import ( |
2785 | IBinaryPackagePublishingHistory, ISourcePackagePublishingHistory, |
2786 | @@ -49,8 +49,7 @@ |
2787 | CopyChecker, do_copy, _do_delayed_copy, _do_direct_copy, PackageCopier, |
2788 | re_upload_file, UnembargoSecurityPackage, update_files_privacy) |
2789 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
2790 | -from lp.testing import ( |
2791 | - TestCase, TestCaseWithFactory) |
2792 | +from lp.testing import TestCaseWithFactory |
2793 | |
2794 | |
2795 | class ReUploadFileTestCase(TestCaseWithFactory): |
2796 | |
2797 | === modified file 'lib/lp/soyuz/scripts/tests/test_populatearchive.py' |
2798 | --- lib/lp/soyuz/scripts/tests/test_populatearchive.py 2010-03-06 04:57:40 +0000 |
2799 | +++ lib/lp/soyuz/scripts/tests/test_populatearchive.py 2010-04-13 06:59:32 +0000 |
2800 | @@ -23,7 +23,7 @@ |
2801 | from lp.services.job.interfaces.job import JobStatus |
2802 | from lp.soyuz.interfaces.archive import ArchivePurpose, IArchiveSet |
2803 | from lp.soyuz.interfaces.archivearch import IArchiveArchSet |
2804 | -from lp.soyuz.interfaces.build import IBuildSet |
2805 | +from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
2806 | from lp.soyuz.interfaces.packagecopyrequest import ( |
2807 | IPackageCopyRequestSet, PackageCopyStatus) |
2808 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
2809 | @@ -130,7 +130,7 @@ |
2810 | self._verifyClonedSourcePackages(copy_archive, hoary) |
2811 | |
2812 | # Now check that we have build records for the sources cloned. |
2813 | - builds = list(getUtility(IBuildSet).getBuildsForArchive( |
2814 | + builds = list(getUtility(IBinaryPackageBuildSet).getBuildsForArchive( |
2815 | copy_archive, status=BuildStatus.NEEDSBUILD)) |
2816 | |
2817 | # Please note: there will be no build for the pmount package |
2818 | @@ -331,7 +331,7 @@ |
2819 | self._verifyClonedSourcePackages(copy_archive, hoary) |
2820 | |
2821 | # Now check that we have zero build records for the sources cloned. |
2822 | - builds = list(getUtility(IBuildSet).getBuildsForArchive( |
2823 | + builds = list(getUtility(IBinaryPackageBuildSet).getBuildsForArchive( |
2824 | copy_archive, status=BuildStatus.NEEDSBUILD)) |
2825 | build_spns = [ |
2826 | get_spn(removeSecurityProxy(build)).name for build in builds] |
2827 | @@ -629,7 +629,7 @@ |
2828 | self._verifyClonedSourcePackages(copy_archive, hoary) |
2829 | |
2830 | # Now check that we have the build records expected. |
2831 | - builds = list(getUtility(IBuildSet).getBuildsForArchive( |
2832 | + builds = list(getUtility(IBinaryPackageBuildSet).getBuildsForArchive( |
2833 | copy_archive, status=BuildStatus.NEEDSBUILD)) |
2834 | build_spns = [ |
2835 | get_spn(removeSecurityProxy(build)).name for build in builds] |
2836 | @@ -669,7 +669,8 @@ |
2837 | self._verifyClonedSourcePackages(archive, hoary) |
2838 | |
2839 | # Get the binary builds generated for the copy archive at hand. |
2840 | - builds = list(getUtility(IBuildSet).getBuildsForArchive(archive)) |
2841 | + builds = list(getUtility(IBinaryPackageBuildSet).getBuildsForArchive( |
2842 | + archive)) |
2843 | # At least one binary build was generated for the target copy archive. |
2844 | self.assertTrue(len(builds) > 0) |
2845 | # Now check that the binary builds and their associated job records |
2846 | |
2847 | === modified file 'lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt' |
2848 | --- lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt 2010-03-06 04:57:40 +0000 |
2849 | +++ lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt 2010-04-13 06:59:32 +0000 |
2850 | @@ -412,10 +412,12 @@ |
2851 | |
2852 | >>> from lp.buildmaster.interfaces.buildbase import BuildStatus |
2853 | >>> from lp.registry.interfaces.person import IPersonSet |
2854 | - >>> from lp.soyuz.interfaces.build import IBuildSet |
2855 | + >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
2856 | + ... IBinaryPackageBuildSet) |
2857 | >>> login('foo.bar@canonical.com') |
2858 | >>> cprov_ppa = getUtility(IPersonSet).getByName('cprov').archive |
2859 | - >>> builds = getUtility(IBuildSet).getBuildsForArchive(cprov_ppa) |
2860 | + >>> builds = getUtility(IBinaryPackageBuildSet).getBuildsForArchive( |
2861 | + ... cprov_ppa) |
2862 | >>> builds[0].buildstate = BuildStatus.BUILDING |
2863 | >>> logout() |
2864 | |
2865 | |
2866 | === modified file 'lib/lp/soyuz/stories/soyuz/xx-binarypackagerelease-index.txt' |
2867 | --- lib/lp/soyuz/stories/soyuz/xx-binarypackagerelease-index.txt 2009-08-28 07:34:44 +0000 |
2868 | +++ lib/lp/soyuz/stories/soyuz/xx-binarypackagerelease-index.txt 2010-04-13 06:59:32 +0000 |
2869 | @@ -21,13 +21,14 @@ |
2870 | XXX: noodles 2009-01-16 bug 317863: move this into the STP. |
2871 | |
2872 | >>> from lp.soyuz.model.queue import PackageUploadBuild |
2873 | - >>> from lp.soyuz.interfaces.build import IBuildSet |
2874 | + >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
2875 | + ... IBinaryPackageBuildSet) |
2876 | >>> from lp.registry.interfaces.pocket import ( |
2877 | ... PackagePublishingPocket) |
2878 | >>> from zope.component import getUtility |
2879 | |
2880 | >>> login('foo.bar@canonical.com') |
2881 | - >>> build = getUtility(IBuildSet).getByBuildID(2) |
2882 | + >>> build = getUtility(IBinaryPackageBuildSet).getByBuildID(2) |
2883 | >>> package_upload = build.distroseries.createQueueEntry( |
2884 | ... PackagePublishingPocket.UPDATES, 'changes.txt', 'my changes', |
2885 | ... build.archive) |
2886 | |
2887 | === modified file 'lib/lp/soyuz/stories/soyuz/xx-build-record.txt' |
2888 | --- lib/lp/soyuz/stories/soyuz/xx-build-record.txt 2010-03-27 03:11:00 +0000 |
2889 | +++ lib/lp/soyuz/stories/soyuz/xx-build-record.txt 2010-04-13 06:59:32 +0000 |
2890 | @@ -23,8 +23,10 @@ |
2891 | >>> bob_builder.builderok = True |
2892 | |
2893 | # Set a known duration for the current job. |
2894 | - >>> from lp.soyuz.interfaces.build import IBuildSet |
2895 | - >>> build2 = getUtility(IBuildSet).getByQueueEntry(bob_builder.currentjob) |
2896 | + >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
2897 | + ... IBinaryPackageBuildSet) |
2898 | + >>> build2 = getUtility(IBinaryPackageBuildSet).getByQueueEntry( |
2899 | + ... bob_builder.currentjob) |
2900 | >>> in_progress_build = removeSecurityProxy(build2) |
2901 | >>> one_minute = datetime.timedelta(seconds=60) |
2902 | >>> in_progress_build.buildqueue_record.estimated_duration = one_minute |
2903 | |
2904 | === modified file 'lib/lp/soyuz/stories/webservice/xx-builds.txt' |
2905 | --- lib/lp/soyuz/stories/webservice/xx-builds.txt 2010-03-06 04:57:40 +0000 |
2906 | +++ lib/lp/soyuz/stories/webservice/xx-builds.txt 2010-04-13 06:59:32 +0000 |
2907 | @@ -64,17 +64,18 @@ |
2908 | >>> login('foo.bar@canonical.com') |
2909 | |
2910 | >>> from zope.component import getUtility |
2911 | - >>> from lp.soyuz.interfaces.build import IBuildSet |
2912 | + >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
2913 | + ... IBinaryPackageBuildSet) |
2914 | |
2915 | - >>> build = getUtility(IBuildSet).getByBuildID(26) |
2916 | + >>> build = getUtility(IBinaryPackageBuildSet).getByBuildID(26) |
2917 | >>> build.upload_log = build.buildlog |
2918 | |
2919 | >>> logout() |
2920 | |
2921 | -IBuild 'build_log_url' and 'upload_log_url' are webapp URLs, relative |
2922 | -to the build itself. This way API users can access private files |
2923 | -(stored in the restricted librarian) directly because they will be |
2924 | -proxied by the webapp. |
2925 | +IBinaryPackageBuild 'build_log_url' and 'upload_log_url' are webapp |
2926 | +URLs, relative to the build itself. This way API users can access |
2927 | +private files (stored in the restricted librarian) directly because they |
2928 | +will be proxied by the webapp. |
2929 | |
2930 | >>> builds = webservice.named_get( |
2931 | ... source_pub['self_link'], 'getBuilds').jsonBody() |
2932 | |
2933 | === modified file 'lib/lp/soyuz/tests/test_archive.py' |
2934 | --- lib/lp/soyuz/tests/test_archive.py 2010-03-17 09:55:40 +0000 |
2935 | +++ lib/lp/soyuz/tests/test_archive.py 2010-04-13 06:59:32 +0000 |
2936 | @@ -27,7 +27,7 @@ |
2937 | from lp.soyuz.interfaces.binarypackagerelease import BinaryPackageFormat |
2938 | from lp.soyuz.interfaces.processor import IProcessorFamilySet |
2939 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
2940 | -from lp.soyuz.model.build import Build |
2941 | +from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2942 | from lp.soyuz.model.binarypackagerelease import ( |
2943 | BinaryPackageReleaseDownloadCount) |
2944 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
2945 | @@ -413,7 +413,7 @@ |
2946 | self.ubuntutest, ArchivePurpose.PRIMARY) |
2947 | |
2948 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
2949 | - sample_data = store.find(Build) |
2950 | + sample_data = store.find(BinaryPackageBuild) |
2951 | for build in sample_data: |
2952 | build.buildstate = BuildStatus.FULLYBUILT |
2953 | store.flush() |
2954 | |
2955 | === modified file 'lib/lp/soyuz/tests/test_build.py' |
2956 | --- lib/lp/soyuz/tests/test_build.py 2010-03-06 04:57:40 +0000 |
2957 | +++ lib/lp/soyuz/tests/test_build.py 2010-04-13 06:59:32 +0000 |
2958 | @@ -16,7 +16,8 @@ |
2959 | from lp.buildmaster.interfaces.buildbase import BuildStatus, IBuildBase |
2960 | from lp.buildmaster.interfaces.builder import IBuilderSet |
2961 | from lp.buildmaster.model.buildqueue import BuildQueue |
2962 | -from lp.soyuz.interfaces.build import IBuild, IBuildSet |
2963 | +from lp.soyuz.interfaces.binarypackagebuild import ( |
2964 | + IBinaryPackageBuild, IBinaryPackageBuildSet) |
2965 | from lp.soyuz.interfaces.component import IComponentSet |
2966 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
2967 | from lp.soyuz.model.buildpackagejob import BuildPackageJob |
2968 | @@ -38,13 +39,13 @@ |
2969 | sourcename="gedit", status=PackagePublishingStatus.PUBLISHED) |
2970 | build = gedit_src_hist.createMissingBuilds()[0] |
2971 | |
2972 | - # The IBuild.calculated_buildstart property asserts |
2973 | + # The IBinaryPackageBuild.calculated_buildstart property asserts |
2974 | # that both datebuilt and buildduration are set. |
2975 | build.datebuilt = datetime.now(pytz.UTC) |
2976 | build.buildduration = timedelta(0, 1) |
2977 | |
2978 | self.assertProvides(build, IBuildBase) |
2979 | - self.assertProvides(build, IBuild) |
2980 | + self.assertProvides(build, IBinaryPackageBuild) |
2981 | |
2982 | class TestBuildUpdateDependencies(TestCaseWithFactory): |
2983 | |
2984 | @@ -53,7 +54,7 @@ |
2985 | def _setupSimpleDepwaitContext(self): |
2986 | """Use `SoyuzTestPublisher` to setup a simple depwait context. |
2987 | |
2988 | - Return an `IBuild` in MANUALDEWAIT state and depending on a |
2989 | + Return an `IBinaryPackageBuild` in MANUALDEWAIT state and depending on a |
2990 | binary that exists and is reachable. |
2991 | """ |
2992 | test_publisher = SoyuzTestPublisher() |
2993 | @@ -107,14 +108,14 @@ |
2994 | 0) |
2995 | |
2996 | def testUpdateDependenciesWorks(self): |
2997 | - # Calling `IBuild.updateDependencies` makes the build |
2998 | + # Calling `IBinaryPackageBuild.updateDependencies` makes the build |
2999 | # record ready for dispatch. |
3000 | depwait_build = self._setupSimpleDepwaitContext() |
3001 | depwait_build.updateDependencies() |
3002 | self.assertEquals(depwait_build.dependencies, '') |
3003 | |
3004 | def testInvalidDependencies(self): |
3005 | - # Calling `IBuild.updateDependencies` on a build with |
3006 | + # Calling `IBinaryPackageBuild.updateDependencies` on a build with |
3007 | # invalid 'dependencies' raises an AssertionError. |
3008 | # Anything not following '<name> [([relation] <version>)][, ...]' |
3009 | depwait_build = self._setupSimpleDepwaitContext() |
3010 | @@ -140,10 +141,10 @@ |
3011 | AssertionError, depwait_build.updateDependencies) |
3012 | |
3013 | def testBug378828(self): |
3014 | - # `IBuild.updateDependencies` copes with the scenario where |
3015 | - # the corresponding source publication is not active (deleted) |
3016 | - # and the source original component is not a valid ubuntu |
3017 | - # component. |
3018 | + # `IBinaryPackageBuild.updateDependencies` copes with the |
3019 | + # scenario where the corresponding source publication is not |
3020 | + # active (deleted) and the source original component is not a |
3021 | + # valid ubuntu component. |
3022 | depwait_build = self._setupSimpleDepwaitContext() |
3023 | |
3024 | depwait_build.current_source_publication.requestDeletion( |
3025 | @@ -194,7 +195,7 @@ |
3026 | |
3027 | # Short-cuts for our tests. |
3028 | self.archive = self.publisher.distroseries.main_archive |
3029 | - self.build_set = getUtility(IBuildSet) |
3030 | + self.build_set = getUtility(IBinaryPackageBuildSet) |
3031 | |
3032 | def test_getBuildsForArchive_no_params(self): |
3033 | # All builds should be returned when called without filtering |
3034 | @@ -218,7 +219,7 @@ |
3035 | super(TestBuildSetGetBuildsForBuilder, self).setUp() |
3036 | |
3037 | # Short-cuts for our tests. |
3038 | - self.build_set = getUtility(IBuildSet) |
3039 | + self.build_set = getUtility(IBinaryPackageBuildSet) |
3040 | |
3041 | # Create a 386 builder |
3042 | owner = self.factory.makePerson() |
3043 | |
3044 | === modified file 'lib/lp/soyuz/tests/test_buildpackagejob.py' |
3045 | --- lib/lp/soyuz/tests/test_buildpackagejob.py 2010-03-06 04:57:40 +0000 |
3046 | +++ lib/lp/soyuz/tests/test_buildpackagejob.py 2010-04-13 06:59:32 +0000 |
3047 | @@ -15,7 +15,7 @@ |
3048 | from lp.buildmaster.interfaces.builder import IBuilderSet |
3049 | from lp.soyuz.interfaces.archive import ArchivePurpose |
3050 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
3051 | -from lp.soyuz.model.build import Build |
3052 | +from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
3053 | from lp.soyuz.model.processor import ProcessorFamilySet |
3054 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
3055 | from lp.testing import TestCaseWithFactory |
3056 | @@ -126,7 +126,7 @@ |
3057 | |
3058 | # First mark all builds in the sample data as already built. |
3059 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
3060 | - sample_data = store.find(Build) |
3061 | + sample_data = store.find(BinaryPackageBuild) |
3062 | for build in sample_data: |
3063 | build.buildstate = BuildStatus.FULLYBUILT |
3064 | store.flush() |
rubber stamped!