800
800
section=new_section,
801
801
archive=current.archive)
803
def copyTo(self, distroseries, pocket, archive):
803
def copyTo(self, distroseries, pocket, archive, policy=None):
804
804
"""See `ISourcePackagePublishingHistory`."""
805
component = self.component
806
section = self.section
807
if policy is not None:
808
packages = (self.sourcepackagerelease.sourcepackagename,)
809
override = policy.calculateSourceOverrides(
810
archive, distroseries, pocket, packages)
811
[spn, new_component, new_section] = override[0]
812
if new_component is not None:
813
component = new_component
814
if new_section is not None:
815
section = new_section
805
816
return getUtility(IPublishingSet).newSourcePublication(
807
818
self.sourcepackagerelease,
813
824
def getStatusSummaryForBuilds(self):
1327
1338
implements(IPublishingSet)
1329
def copyBinariesTo(self, binaries, distroseries, pocket, archive):
1340
def copyBinariesTo(self, binaries, distroseries, pocket, archive,
1330
1342
"""See `IPublishingSet`."""
1331
return self.publishBinaries(
1332
archive, distroseries, pocket,
1343
if policy is not None:
1345
for bpph in binaries:
1347
bpph.binarypackagerelease.binarypackagename,
1348
bpph.distroarchseries.architecturetag)] = bpph
1350
overrides = policy.calculateBinaryOverrides(
1351
archive, distroseries, pocket, bpn_archtag.keys())
1352
for bpn, das, component, section, priority in overrides:
1353
bpph = bpn_archtag[(bpn, das.architecturetag)]
1354
new_component = component or bpph.component
1355
new_section = section or bpph.section
1356
new_priority = priority or bpph.priority
1357
calculated = (new_component, new_section, new_priority)
1358
with_overrides[bpph.binarypackagerelease] = calculated
1360
with_overrides = dict(
1334
1361
(bpph.binarypackagerelease, (bpph.component, bpph.section,
1335
bpph.priority)) for bpph in binaries))
1362
bpph.priority)) for bpph in binaries)
1363
return self.publishBinaries(
1364
archive, distroseries, pocket, with_overrides)
1337
1366
def publishBinaries(self, archive, distroseries, pocket,