1141
1141
SeriesStatus.EXPERIMENTAL,
1144
def _getAllSources(self):
1145
"""Get all sources ever published in this series' main archives."""
1146
return IStore(SourcePackagePublishingHistory).find(
1147
SourcePackagePublishingHistory,
1148
SourcePackagePublishingHistory.distroseriesID == self.id,
1149
SourcePackagePublishingHistory.archiveID.is_in(
1150
self.distribution.all_distro_archive_ids),
1151
).order_by(SourcePackagePublishingHistory.id)
1153
def _getAllBinaries(self):
1154
"""Get all binaries ever published in this series' main archives."""
1155
return IStore(BinaryPackagePublishingHistory).find(
1156
BinaryPackagePublishingHistory,
1157
DistroArchSeries.distroseriesID == self.id,
1158
BinaryPackagePublishingHistory.distroarchseriesID
1159
== DistroArchSeries.id,
1160
BinaryPackagePublishingHistory.archiveID.is_in(
1161
self.distribution.all_distro_archive_ids),
1162
).order_by(BinaryPackagePublishingHistory.id)
1144
1164
def getAllPublishedSources(self):
1145
1165
"""See `IDistroSeries`."""
1146
1166
# Consider main archives only, and return all sources in
1147
1167
# the PUBLISHED state.
1148
archives = self.distribution.getArchiveIDList()
1149
return SourcePackagePublishingHistory.select("""
1150
distroseries = %s AND
1153
""" % sqlvalues(self, PackagePublishingStatus.PUBLISHED,
1168
return self._getAllSources().find(
1169
status=PackagePublishingStatus.PUBLISHED)
1157
1171
def getAllPublishedBinaries(self):
1158
1172
"""See `IDistroSeries`."""
1159
1173
# Consider main archives only, and return all binaries in
1160
1174
# the PUBLISHED state.
1161
archives = self.distribution.getArchiveIDList()
1162
return BinaryPackagePublishingHistory.select("""
1163
BinaryPackagePublishingHistory.distroarchseries =
1164
DistroArchSeries.id AND
1165
DistroArchSeries.distroseries = DistroSeries.id AND
1166
DistroSeries.id = %s AND
1167
BinaryPackagePublishingHistory.status = %s AND
1168
BinaryPackagePublishingHistory.archive in %s
1169
""" % sqlvalues(self, PackagePublishingStatus.PUBLISHED,
1171
clauseTables=["DistroArchSeries", "DistroSeries"],
1172
orderBy="BinaryPackagePublishingHistory.id")
1175
return self._getAllBinaries().find(
1176
status=PackagePublishingStatus.PUBLISHED)
1178
def getAllUncondemnedSources(self):
1179
"""See `IDistroSeries`."""
1180
return self._getAllSources().find(scheduleddeletiondate=None)
1182
def getAllUncondemnedBinaries(self):
1183
"""See `IDistroSeries`."""
1184
return self._getAllBinaries().find(scheduleddeletiondate=None)
1174
1186
def getSourcesPublishedForAllArchives(self):
1175
1187
"""See `IDistroSeries`."""