launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #02414
[Merge] lp:~wgrant/launchpad/bug-707189-forgetful-copier into lp:launchpad
William Grant has proposed merging lp:~wgrant/launchpad/bug-707189-forgetful-copier into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
#707189 Architecture-independent direct copies can sometimes forget to copy some architectures
https://bugs.launchpad.net/bugs/707189
For more details, see:
https://code.launchpad.net/~wgrant/launchpad/bug-707189-forgetful-copier/+merge/47341
PublishingSet.publishBinary takes a target DistroArchSeries and creates publications as appropriate, including expanding it to cover all enabled architectures if the binary is architecture-independent. In doing so it first checks if the binary is already published -- if so, it will not create another publication.
The refactor in r12220 broke this, such that it now checks if the *requested* architecture is already published, instead of the target architecture. This means that architectures after nominated arch-indep alphabetically (ie. lpia) will not be have arch-indep publications created.
--
https://code.launchpad.net/~wgrant/launchpad/bug-707189-forgetful-copier/+merge/47341
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/bug-707189-forgetful-copier into lp:launchpad.
=== modified file 'lib/lp/soyuz/model/publishing.py'
--- lib/lp/soyuz/model/publishing.py 2011-01-15 06:32:40 +0000
+++ lib/lp/soyuz/model/publishing.py 2011-01-25 00:33:53 +0000
@@ -1279,13 +1279,13 @@
pocket))
return secure_copies
- def publishBinary(self, archive, binarypackagerelease, distroarchseries,
+ def publishBinary(self, archive, binarypackagerelease, requested_arch,
component, section, priority, pocket):
"""See `IPublishingSet`."""
if not binarypackagerelease.architecturespecific:
- target_archs = distroarchseries.distroseries.enabled_architectures
+ target_archs = requested_arch.distroseries.enabled_architectures
else:
- target_archs = [distroarchseries]
+ target_archs = [requested_arch]
# DDEBs targeted to the PRIMARY archive are published in the
# corresponding DEBUG archive.
@@ -1306,7 +1306,7 @@
name=binarypackagerelease.name, exact_match=True,
version=binarypackagerelease.version,
status=active_publishing_status, pocket=pocket,
- distroarchseries=distroarchseries)
+ distroarchseries=arch)
if not bool(binaries_in_destination):
published_binaries.append(
getUtility(IPublishingSet).newBinaryPublication(
=== modified file 'lib/lp/soyuz/scripts/tests/test_copypackage.py'
--- lib/lp/soyuz/scripts/tests/test_copypackage.py 2011-01-11 07:50:10 +0000
+++ lib/lp/soyuz/scripts/tests/test_copypackage.py 2011-01-25 00:33:53 +0000
@@ -49,6 +49,7 @@
from lp.soyuz.interfaces.publishing import (
active_publishing_status,
IBinaryPackagePublishingHistory,
+ IPublishingSet,
ISourcePackagePublishingHistory,
)
from lp.soyuz.interfaces.queue import (
@@ -1085,6 +1086,36 @@
# The binary should not be published for hppa.
self.assertCopied(copies, nobby, ('i386',))
+ def test_copies_only_new_indep_publications(self):
+ # When copying architecture-independent binaries to a series with
+ # existing publications in some architectures, new publications
+ # are only created in the missing archs.
+
+ # Make a new architecture-specific source and binary.
+ archive = self.factory.makeArchive(
+ distribution=self.test_publisher.ubuntutest, virtualized=False)
+ source = self.test_publisher.getPubSource(
+ archive=archive, architecturehintlist='all')
+ [bin_i386, bin_hppa] = self.test_publisher.getPubBinaries(
+ pub_source=source)
+
+ # Now make a new distroseries with only i386.
+ nobby = self.createNobby(('i386', 'hppa'))
+
+ target_archive = self.factory.makeArchive(
+ distribution=self.test_publisher.ubuntutest, virtualized=False)
+ # Manually copy the indep pub to just i386.
+ getUtility(IPublishingSet).newBinaryPublication(
+ target_archive, bin_i386.binarypackagerelease, nobby['i386'],
+ bin_i386.component, bin_i386.section, bin_i386.priority,
+ bin_i386.pocket)
+ # Now we can copy the package with binaries.
+ copies = self.doCopy(
+ source, target_archive, nobby, source.pocket, True)
+
+ # The copy succeeds, and no i386 publication is created.
+ self.assertCopied(copies, nobby, ('hppa',))
+
class TestDoDelayedCopy(TestCaseWithFactory, BaseDoCopyTests):