Merge lp:~stevenk/launchpad/fixes-bug-552560 into lp:launchpad

Proposed by Steve Kowalik
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merged at revision: 10986
Proposed branch: lp:~stevenk/launchpad/fixes-bug-552560
Merge into: lp:launchpad
Diff against target: 44 lines (+17/-0)
2 files modified
lib/lp/archivepublisher/publishing.py (+4/-0)
lib/lp/archivepublisher/tests/test_publisher.py (+13/-0)
To merge this branch: bzr merge lp:~stevenk/launchpad/fixes-bug-552560
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) code Approve
Review via email: mp+27126@code.launchpad.net

Description of the change

This branch changes the Origin and Label for the partner archive so that Ubuntu Software Centre can better show users which software comes from the partner archive on archive.canonical.com

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

The only minor issue I see is that your comments are lacking dots at the end of the sentences.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/archivepublisher/publishing.py'
2--- lib/lp/archivepublisher/publishing.py 2010-04-22 12:02:06 +0000
3+++ lib/lp/archivepublisher/publishing.py 2010-06-10 08:24:33 +0000
4@@ -428,6 +428,8 @@
5 """
6 if self.archive.is_ppa:
7 return self.archive.displayname
8+ elif self.archive.purpose == ArchivePurpose.PARTNER:
9+ return "Partner archive"
10 else:
11 return self.distro.displayname
12
13@@ -443,6 +445,8 @@
14 """
15 # XXX al-maisan, 2008-11-19, bug=299981. If this file is released
16 # from a copy archive then modify the origin to indicate so.
17+ if self.archive.purpose == ArchivePurpose.PARTNER:
18+ return "Canonical"
19 if not self.archive.is_ppa:
20 return self.distro.displayname
21 return "LP-PPA-%s" % get_ppa_reference(self.archive)
22
23=== modified file 'lib/lp/archivepublisher/tests/test_publisher.py'
24--- lib/lp/archivepublisher/tests/test_publisher.py 2010-06-08 14:03:59 +0000
25+++ lib/lp/archivepublisher/tests/test_publisher.py 2010-06-10 08:24:33 +0000
26@@ -1040,6 +1040,19 @@
27 self.assertTrue('Sources.gz\n' in stringified_contents)
28 self.assertTrue('Sources\n' in stringified_contents)
29
30+ # Partner archive architecture Release files 'Origin' contain
31+ # a string
32+ arch_release_file = os.path.join(
33+ publisher._config.distsroot, 'breezy-autotest',
34+ 'partner/source/Release')
35+ arch_release_contents = open(arch_release_file).read()
36+ self.assertEqual(
37+ self._getReleaseFileOrigin(arch_release_contents),
38+ 'Canonical')
39+
40+ # The Label: field should be set to the archive displayname
41+ self.assertEqual(release_contents[1], 'Label: Partner archive')
42+
43 def testWorldAndGroupReadablePackagesAndSources(self):
44 """Test Packages.gz and Sources.gz files are world and group readable.
45