3482
3485
distribution=distribution)
3484
3487
if archive is None:
3485
archive = self.makeArchive(
3486
distribution=distroseries.distribution,
3487
purpose=ArchivePurpose.PRIMARY)
3488
archive = distroseries.main_archive
3489
3490
if (sourcepackagename is None or
3490
3491
isinstance(sourcepackagename, basestring)):
3491
3492
sourcepackagename = self.getOrMakeSourcePackageName(
3492
3493
sourcepackagename)
3494
if component is None:
3495
component = self.makeComponent()
3495
if (component is None or isinstance(component, basestring)):
3496
component = self.makeComponent(component)
3497
3498
if urgency is None:
3498
3499
urgency = self.getAnySourcePackageUrgency()
3500
elif isinstance(urgency, basestring):
3501
urgency = SourcePackageUrgency.items[urgency.upper()]
3500
3503
section = self.makeSection(name=section_name)
3566
3569
build uses as its source.
3567
3570
:param sourcepackagename: when source_package_release is None, the
3568
3571
sourcepackagename from which the build will come.
3569
:param distroarchseries: The DistroArchSeries to use.
3570
:param archive: The Archive to use.
3572
:param distroarchseries: The DistroArchSeries to use. Defaults to the
3573
one from the source_package_release, or a new one if not provided.
3574
:param archive: The Archive to use. Defaults to the one from the
3575
source_package_release, or the distro arch series main archive
3571
3577
:param builder: An optional builder to assign.
3572
3578
:param status: The BuildStatus for the build.
3575
if source_package_release is None:
3576
archive = self.makeArchive()
3578
archive = source_package_release.upload_archive
3579
3580
if processor is None:
3580
3581
processor = self.makeProcessor()
3581
3582
if distroarchseries is None:
3615
3624
IStore(binary_package_build).flush()
3616
3625
return binary_package_build
3618
def makeSourcePackagePublishingHistory(self, sourcepackagename=None,
3619
distroseries=None, maintainer=None,
3620
creator=None, component=None,
3622
urgency=None, version=None,
3627
def makeSourcePackagePublishingHistory(self,
3625
builddependsindep=None,
3626
build_conflicts=None,
3627
build_conflicts_indep=None,
3628
architecturehintlist='all',
3630
date_uploaded=UTC_NOW,
3630
sourcepackagerelease=None,
3634
date_uploaded=UTC_NOW,
3633
3635
scheduleddeletiondate=None,
3634
dsc_standards_version='3.6.2',
3636
dsc_binaries='foo-bin',
3637
sourcepackagerelease=None,
3640
"""Make a `SourcePackagePublishingHistory`."""
3639
"""Make a `SourcePackagePublishingHistory`.
3641
:param sourcepackagerelease: The source package release to publish
3642
If not provided, a new one will be created.
3643
:param distroseries: The distro series in which to publish.
3644
Default to the source package release one, or a new one will
3645
be created when not provided.
3646
:param archive: The archive to publish into. Default to the
3647
initial source package release upload archive, or to the
3648
distro series main archive.
3649
:param pocket: The pocket to publish into. Can be specified as a
3650
string. Defaults to the RELEASE pocket.
3651
:param status: The publication status. Defaults to PENDING. If
3652
set to PUBLISHED, the publisheddate will be set to now.
3653
:param dateremoved: The removal date.
3654
:param date_uploaded: The upload date. Defaults to now.
3655
:param scheduleddeletiondate: The date where the publication
3656
is scheduled to be removed.
3657
:param ancestor: The publication ancestor parameter.
3658
:param **kwargs: All other parameters are passed through to the
3659
makeSourcePackageRelease call if needed.
3641
3661
if distroseries is None:
3662
if sourcepackagerelease is not None:
3663
distroseries = sourcepackagerelease.upload_distroseries
3645
distribution = archive.distribution
3646
distroseries = self.makeDistroRelease(distribution=distribution)
3668
distribution = archive.distribution
3669
distroseries = self.makeDistroRelease(
3670
distribution=distribution)
3648
3671
if archive is None:
3649
archive = self.makeArchive(
3650
distribution=distroseries.distribution,
3651
purpose=ArchivePurpose.PRIMARY)
3672
archive = distroseries.main_archive
3653
3674
if pocket is None:
3654
3675
pocket = self.getAnyPocket()
3676
elif isinstance(pocket, basestring):
3677
pocket = PackagePublishingPocket.items[pocket.upper()]
3656
3679
if status is None:
3657
3680
status = PackagePublishingStatus.PENDING
3681
elif isinstance(status, basestring):
3682
status = PackagePublishingStatus.items[status.upper()]
3659
3684
if sourcepackagerelease is None:
3660
3685
sourcepackagerelease = self.makeSourcePackageRelease(
3662
sourcepackagename=sourcepackagename,
3663
distroseries=distroseries,
3664
maintainer=maintainer,
3665
creator=creator, component=component,
3666
section_name=section_name,
3669
builddepends=builddepends,
3670
builddependsindep=builddependsindep,
3671
build_conflicts=build_conflicts,
3672
build_conflicts_indep=build_conflicts_indep,
3673
architecturehintlist=architecturehintlist,
3674
dsc_standards_version=dsc_standards_version,
3675
dsc_format=dsc_format,
3676
dsc_binaries=dsc_binaries,
3677
date_uploaded=date_uploaded)
3686
archive=archive, distroseries=distroseries,
3687
date_uploaded=date_uploaded, **kwargs)
3679
3689
spph = getUtility(IPublishingSet).newSourcePublication(
3680
3690
archive, sourcepackagerelease, distroseries,