1119
1118
section=self.section,
1120
1119
priority=self.priority)
1122
def getOtherPublicationsForSameSource(self, include_archindep=False):
1123
"""Return all the other published or pending binaries for this
1126
For example if source package foo builds:
1129
foo-common - arch-all (published in i386 and amd64)
1130
then if this publication is the arch-all amd64, return foo(i386),
1131
foo(amd64). If include_archindep is True then also return
1134
:param include_archindep: If True, return architecture independent
1135
publications too. Defaults to False.
1137
:return: an iterable of `BinaryPackagePublishingHistory`
1139
# Avoid circular wotsits.
1140
from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild
1141
from lp.soyuz.model.distroarchseries import DistroArchSeries
1142
from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
1143
source_select = Select(
1144
SourcePackageRelease.id,
1146
BinaryPackageBuild.source_package_release_id ==
1147
SourcePackageRelease.id,
1148
BinaryPackageRelease.build == BinaryPackageBuild.id,
1149
self.binarypackagereleaseID == BinaryPackageRelease.id,
1152
BinaryPackageBuild.source_package_release_id ==
1153
SourcePackageRelease.id,
1154
SourcePackageRelease.id.is_in(source_select),
1155
BinaryPackageRelease.build == BinaryPackageBuild.id,
1156
BinaryPackagePublishingHistory.binarypackagereleaseID ==
1157
BinaryPackageRelease.id,
1158
BinaryPackagePublishingHistory.archiveID == self.archive.id,
1159
BinaryPackagePublishingHistory.distroarchseriesID ==
1160
DistroArchSeries.id,
1161
DistroArchSeries.distroseriesID == self.distroseries.id,
1162
BinaryPackagePublishingHistory.pocket == self.pocket,
1163
BinaryPackagePublishingHistory.status.is_in(
1164
active_publishing_status),
1165
BinaryPackagePublishingHistory.id != self.id
1168
if not include_archindep:
1169
pubs.append(BinaryPackageRelease.architecturespecific == True)
1171
return IMasterStore(BinaryPackagePublishingHistory).find(
1172
BinaryPackagePublishingHistory,
1176
1121
def supersede(self, dominant=None, logger=None):
1177
1122
"""See `IBinaryPackagePublishingHistory`."""
1178
1123
# At this point only PUBLISHED (ancient versions) or PENDING (