summaryrefslogtreecommitdiff
path: root/aptsources/distro.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-09-28 16:25:09 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-09-28 16:25:09 +0200
commitbbe36232eb04a191d8fefee5bc65710e4347c0dd (patch)
tree390a370a564a752f1866da2f845f4663d19a6b42 /aptsources/distro.py
parentbb4108a5aee372c75e1743892e2b43b268efb562 (diff)
downloadpython-apt-bbe36232eb04a191d8fefee5bc65710e4347c0dd.tar.gz
add concept of "ParentComponent" for e.g. ubuntu/multiverse
that needs universe enabled as well (plus add test) LP: #829284
Diffstat (limited to 'aptsources/distro.py')
-rw-r--r--aptsources/distro.py14
1 files changed, 12 insertions, 2 deletions
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