summaryrefslogtreecommitdiff
path: root/aptsources
diff options
context:
space:
mode:
authorSebastian Heinlein <sebi@sebi-laptop>2007-03-22 16:09:31 +0100
committerSebastian Heinlein <sebi@sebi-laptop>2007-03-22 16:09:31 +0100
commit9e5248060b5b6f8740f5df8bcffdfdf1fc50d4a3 (patch)
tree965612d37c30e4971e4ae9ab41fc181ab0bd8235 /aptsources
parent89e6314a71a56fbc7eb5600036bbb957f3b48034 (diff)
parent808dfe4f1df81228fc15a18e47cffcc62a830ed6 (diff)
downloadpython-apt-9e5248060b5b6f8740f5df8bcffdfdf1fc50d4a3.tar.gz
* merge with ubuntu
Diffstat (limited to 'aptsources')
-rw-r--r--aptsources/distinfo.py12
-rw-r--r--aptsources/distro.py9
2 files changed, 12 insertions, 9 deletions
diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py
index d7289b4b..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):
@@ -193,8 +197,8 @@ class DistInfo:
mirror_data = filter(match_mirror_line.match,
map(string.strip, open(value)))
except:
- print "ERROR: Failed to read mirror file"
- mirrors = []
+ print "WARNING: Failed to read mirror file"
+ mirror_data = []
for line in mirror_data:
if line.startswith("#LOC:"):
location = match_loc.sub(r"\1", line)
diff --git a/aptsources/distro.py b/aptsources/distro.py
index ac1b53e7..16fb0dc7 100644
--- a/aptsources/distro.py
+++ b/aptsources/distro.py
@@ -164,7 +164,7 @@ class Distribution:
new_source = self.sourceslist.add(type, uri, dist, comps, comment)
# if source code is enabled add a deb-src line after the new
# source
- if self.get_source_code == True and tpye == self.binary_type:
+ if self.get_source_code == True and type == self.binary_type:
self.sourceslist.add(self.source_type, uri, dist, comps, comment,
file=new_source.file,
pos=self.sourceslist.list.index(new_source)+1)
@@ -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,7 +426,7 @@ def get_distro():
return UbuntuDistribution(id, codename, description,
release)
elif id == "Debian":
- return DebianDistribution(id, codename, description,
- release)
+ return DebianDistribution(id, codename, description, release)
else:
- return Distribution(id, codename, description, relase)
+ return Distribution(id, codename, description, release)
+