Merge lp:~wgrant/launchpad/bug-692114-recipes-main-component into lp:launchpad

Proposed by William Grant on 2010-12-20
Status: Merged
Approved by: Tim Penhey on 2010-12-20
Approved revision: no longer in the source branch.
Merged at revision: 12112
Proposed branch: lp:~wgrant/launchpad/bug-692114-recipes-main-component
Merge into: lp:launchpad
Diff against target: 42 lines (+10/-4)
2 files modified
lib/lp/code/model/sourcepackagerecipebuild.py (+4/-4)
lib/lp/code/model/tests/test_sourcepackagerecipebuild.py (+6/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/bug-692114-recipes-main-component
Reviewer Review Type Date Requested Status
Tim Penhey (community) code 2010-12-20 Approve on 2010-12-20
Steve Kowalik (community) code* 2010-12-20 Approve on 2010-12-20
Review via email: mp+44184@code.launchpad.net

Commit message

[r=stevenk,thumper][ui=none][bug=692114] Recipe builds now always build in main, since PPAs only have indices for main.

Description of the change

SourcePackageRecipeBuild.current_component is now always multiverse. Recipes only build into PPAs, and PPAs only support main, so multiverse is always wrong. New PPAs don't even have indices for the other components, so recipe builds fail!

This will need to become more dynamic when we start building recipes into other archive types, but for now setting it to main will work fine. Note that this does not affect the component used by the primary archive dependency.

To post a comment you must log in.
Steve Kowalik (stevenk) wrote :

After a discussion with William about this change, I'm happy with it.

review: Approve (code*)
Tim Penhey (thumper) :
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/code/model/sourcepackagerecipebuild.py'
2--- lib/lp/code/model/sourcepackagerecipebuild.py 2010-11-30 12:23:01 +0000
3+++ lib/lp/code/model/sourcepackagerecipebuild.py 2010-12-20 01:48:50 +0000
4@@ -61,9 +61,6 @@
5 from lp.code.model.sourcepackagerecipedata import SourcePackageRecipeData
6 from lp.registry.interfaces.pocket import PackagePublishingPocket
7 from lp.services.job.model.job import Job
8-from lp.soyuz.adapters.archivedependencies import (
9- default_component_dependency_name,
10- )
11 from lp.soyuz.interfaces.component import IComponentSet
12 from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild
13 from lp.soyuz.model.buildfarmbuildjob import BuildFarmBuildJob
14@@ -96,7 +93,10 @@
15
16 @property
17 def current_component(self):
18- return getUtility(IComponentSet)[default_component_dependency_name]
19+ # Since recipes only build into PPAs, they should always build
20+ # in main. This will need to change once other archives are
21+ # supported.
22+ return getUtility(IComponentSet)['main']
23
24 distroseries_id = Int(name='distroseries', allow_none=True)
25 distroseries = Reference(distroseries_id, 'DistroSeries.id')
26
27=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipebuild.py'
28--- lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2010-11-19 12:22:15 +0000
29+++ lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2010-12-20 01:48:50 +0000
30@@ -135,6 +135,12 @@
31 spb = self.makeSourcePackageRecipeBuild()
32 self.assertEqual(spb.distroseries.distribution, spb.distribution)
33
34+ def test_current_component(self):
35+ # Since recipes build only into PPAs, they always build in main.
36+ # PPAs lack indices for other components.
37+ spb = self.makeSourcePackageRecipeBuild()
38+ self.assertEqual('main', spb.current_component.name)
39+
40 def test_is_private(self):
41 # A source package recipe build is currently always public.
42 spb = self.makeSourcePackageRecipeBuild()