summaryrefslogtreecommitdiff
path: root/aptsources
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-02-13 18:36:57 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2007-02-13 18:36:57 +0100
commit4d7d86374effe9bfd3a360aaaa7b09758f5c948e (patch)
tree3ab29d32f4c1bd6adfd64b135f5e672c26637d00 /aptsources
parenta4bee532559a5022e54dac4cfbd9da23c7434a2f (diff)
downloadpython-apt-4d7d86374effe9bfd3a360aaaa7b09758f5c948e.tar.gz
* fixed crash in Mirror.has_repository
* fixed docstring
Diffstat (limited to 'aptsources')
-rw-r--r--aptsources/distinfo.py8
-rw-r--r--aptsources/distro.py2
2 files changed, 7 insertions, 3 deletions
diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py
index f3c68cae..261243b4 100644
--- a/aptsources/distinfo.py
+++ b/aptsources/distinfo.py
@@ -91,8 +91,12 @@ class Mirror:
def get_repositories_for_proto(self, proto):
return filter(lambda r: r.proto == proto, self.repositories)
def has_repository(self, proto, dir):
- return len(filter(lambda r: (r.proto == proto) and dir in r.dir,
- self.repositories)) > 0
+ if dir is None:
+ return False
+ for r in self.repositories:
+ if r.proto == proto and dir in r.dir:
+ return True
+ return False
def get_repo_urls(self):
return map(lambda r: r.get_url(self.hostname), self.repositories)
def get_location(self):
diff --git a/aptsources/distro.py b/aptsources/distro.py
index f53783dc..9643524b 100644
--- a/aptsources/distro.py
+++ b/aptsources/distro.py
@@ -174,7 +174,6 @@ class Distribution:
Enable a component in all main, child and source code sources
(excluding cdrom based sources)
- sourceslist: an aptsource.sources_list
comp: the component that should be enabled
"""
def add_component_only_once(source, comps_per_dist):
@@ -427,3 +426,4 @@ def get_distro():
release)
else:
return Distribution(id, codename, description, relase)
+