From bbe36232eb04a191d8fefee5bc65710e4347c0dd Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 28 Sep 2011 16:25:09 +0200 Subject: add concept of "ParentComponent" for e.g. ubuntu/multiverse that needs universe enabled as well (plus add test) LP: #829284 --- aptsources/distro.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'aptsources/distro.py') diff --git a/aptsources/distro.py b/aptsources/distro.py index 41c86981..f777a4ea 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -291,6 +291,16 @@ class Distribution(object): comp: the component that should be enabled """ + comps = set([comp]) + # look for parent components that we may have to add + for source in self.main_sources: + for c in source.template.components: + if c.name == comp and c.parent_component: + comps.add(c.parent_component) + for c in comps: + self._enable_component(c) + + def _enable_component(self, comp): def add_component_only_once(source, comps_per_dist): """ @@ -298,12 +308,12 @@ class Distribution(object): a repository could be splitted into different apt lines. If not add the component """ - # if we don't that distro, just reutnr (can happen for e.g. + # if we don't have that distro, just return (can happen for e.g. # dapper-update only in deb-src if source.dist not in comps_per_dist: return # if we have seen this component already for this distro, - # return (nothing to do + # return (nothing to do) if comp in comps_per_dist[source.dist]: return # add it -- cgit v1.2.3