73
73
from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild
74
74
from lp.soyuz.model.files import SourcePackageReleaseFile
75
75
from lp.soyuz.model.packagediff import PackageDiff
76
from lp.soyuz.model.publishing import SourcePackagePublishingHistory
76
from lp.soyuz.model.publishing import (
77
BinaryPackagePublishingHistory,
78
SourcePackagePublishingHistory,
77
80
from lp.soyuz.model.queue import (
79
82
PackageUploadSource,
647
650
output = "\n\n".join(chunks)
648
651
return output.decode("utf-8", "replace")
653
def getActiveArchSpecificPublications(self, archive, distroseries,
655
"""Find architecture-specific binary publications for this release.
657
For example, say source package release contains binary packages of:
658
* "foo" for i386 (pending in i386)
659
* "foo" for amd64 (published in amd64)
660
* "foo-common" for the "all" architecture (pending or published in
661
various real processor architectures)
663
In that case, this search will return foo(i386) and foo(amd64). The
664
dominator uses this when figuring out whether foo-common can be
665
superseded: we don't track dependency graphs, but we know that the
666
architecture-specific "foo" releases are likely to depend on the
667
architecture-independent foo-common release.
669
:param archive: The `Archive` to search.
670
:param distroseries: The `DistroSeries` to search.
671
:param pocket: The `PackagePublishingPocket` to search.
672
:return: A Storm result set of active, architecture-specific
673
`BinaryPackagePublishingHistory` objects for this source package
674
release and the given `archive`, `distroseries`, and `pocket`.
676
# Avoid circular imports.
677
from lp.soyuz.interfaces.publishing import active_publishing_status
678
from lp.soyuz.model.binarypackagerelease import BinaryPackageRelease
679
from lp.soyuz.model.distroarchseries import DistroArchSeries
681
return Store.of(self).find(
682
BinaryPackagePublishingHistory,
683
BinaryPackageBuild.source_package_release_id == self.id,
684
BinaryPackageRelease.build == BinaryPackageBuild.id,
685
BinaryPackagePublishingHistory.binarypackagereleaseID ==
686
BinaryPackageRelease.id,
687
BinaryPackagePublishingHistory.archiveID == archive.id,
688
BinaryPackagePublishingHistory.distroarchseriesID ==
690
DistroArchSeries.distroseriesID == distroseries.id,
691
BinaryPackagePublishingHistory.pocket == pocket,
692
BinaryPackagePublishingHistory.status.is_in(
693
active_publishing_status),
694
BinaryPackageRelease.architecturespecific == True)