~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/model/binarypackagebuildbehavior.py

Merged recipe-collection into buildqueue-creation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
from zope.interface import implements
15
15
 
16
16
from canonical.launchpad.webapp import urlappend
 
17
 
 
18
from lp.archiveuploader.permission import check_upload_to_pocket
17
19
from lp.buildmaster.interfaces.buildfarmjobbehavior import (
18
20
    IBuildFarmJobBehavior)
19
21
from lp.buildmaster.model.buildfarmjobbehavior import (
118
120
                    build.distroseries.name,
119
121
                    build.distroarchseries.architecturetag))
120
122
 
121
 
        # The main distribution has policies to prevent uploads to some
122
 
        # pockets (e.g. security) during different parts of the distribution
123
 
        # series lifecycle. These do not apply to PPA builds nor any archive
124
 
        # that allows release pocket updates.
125
 
        if (build.archive.purpose != ArchivePurpose.PPA and
126
 
            not build.archive.allowUpdatesToReleasePocket()):
127
 
            # XXX Robert Collins 2007-05-26: not an explicit CannotBuild
128
 
            # exception yet because the callers have not been audited
129
 
            assert build.distroseries.canUploadToPocket(build.pocket), (
130
 
                "%s (%s) can not be built for pocket %s: invalid pocket due "
131
 
                "to the series status of %s."
132
 
                % (build.title, build.id, build.pocket.name,
133
 
                   build.distroseries.name))
 
123
        # This should already have been checked earlier, but just check again 
 
124
        # here in case of programmer errors.
 
125
        check_upload_to_pocket(build.archive, build.distroseries, build.pocket)
134
126
 
135
127
    def slaveStatus(self, raw_slave_status):
136
128
        """Parse and return the binary build specific status info.
215
207
            # the built packages.
216
208
            args['archive_purpose'] = ArchivePurpose.PRIMARY.name
217
209
            args["ogrecomponent"] = (
218
 
                get_primary_current_component(build))
 
210
                get_primary_current_component(build.archive, 
 
211
                    build.distroseries, build.sourcepackagerelease.name))
219
212
        else:
220
213
            args['archive_purpose'] = archive_purpose.name
221
214
            args["ogrecomponent"] = (
222
215
                build.current_component.name)
223
216
 
224
 
        args['archives'] = get_sources_list_for_building(build)
 
217
        args['archives'] = get_sources_list_for_building(build, 
 
218
            build.distroarchseries, build.sourcepackagerelease.name)
225
219
 
226
220
        # Let the build slave know whether this is a build in a private
227
221
        # archive.