From 9cab3c32bb04b8c87ec73f21566f3d25f5d986d9 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 5 Feb 2007 13:19:38 +0100 Subject: * aptsources/distinfo.py: - do not crash if the mirror file can not be read --- aptsources/distinfo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'aptsources') diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py index d7289b4b..f3c68cae 100644 --- a/aptsources/distinfo.py +++ b/aptsources/distinfo.py @@ -193,8 +193,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) -- cgit v1.2.3 From 4d7d86374effe9bfd3a360aaaa7b09758f5c948e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 13 Feb 2007 18:36:57 +0100 Subject: * fixed crash in Mirror.has_repository * fixed docstring --- aptsources/distinfo.py | 8 ++++++-- aptsources/distro.py | 2 +- debian/changelog | 12 ++++++++++++ debian/control | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) (limited to 'aptsources') 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) + diff --git a/debian/changelog b/debian/changelog index 9380ddbb..e5a5b660 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +python-apt (0.6.20ubuntu5) feisty; urgency=low + + * be more robust in has_repository (LP#84897) + + -- Michael Vogt Tue, 13 Feb 2007 17:49:55 +0100 + +python-apt (0.6.20ubuntu4) feisty; urgency=low + + * rebuild against latest libapt + + -- Michael Vogt Tue, 6 Feb 2007 16:40:37 +0100 + python-apt (0.6.20ubuntu3) feisty; urgency=low * fixes in the new 'aptsources' module diff --git a/debian/control b/debian/control index 9e304c29..bf1ca1de 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Maintainer: APT Development Team Uploaders: Matt Zimmerman , Michael Vogt Standards-Version: 3.7.2 XS-Python-Version: all -Build-Depends: debhelper (>= 5.0.37.1), libapt-pkg-dev (>= 0.6.45), apt-utils, python-all-dev, python-distutils-extra, cdbs, python-central (>= 0.5) +Build-Depends: debhelper (>= 5.0.37.1), libapt-pkg-dev (>= 0.6.46.4ubuntu7), apt-utils, python-all-dev, python-distutils-extra, cdbs, python-central (>= 0.5) Package: python-apt Architecture: any -- cgit v1.2.3 From d8f0eef84bc05f6e87ebf50bd8780accec03eacb Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 19 Feb 2007 12:17:58 +0100 Subject: * aptsources/distro.py: - fixed crash in add_source() --- aptsources/distro.py | 2 +- debian/changelog | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'aptsources') diff --git a/aptsources/distro.py b/aptsources/distro.py index 9643524b..7acd1942 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) diff --git a/debian/changelog b/debian/changelog index e5a5b660..cb818eea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +python-apt (0.6.20ubuntu6) feisty; urgency=low + + * aptsources/distro.py: + - fix crash in add_source (LP#85806) + + -- + python-apt (0.6.20ubuntu5) feisty; urgency=low * be more robust in has_repository (LP#84897) -- cgit v1.2.3 From 0b8033d96e6144f8bc05583be0b2d1743f3c73a6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 15 Mar 2007 13:09:32 +0100 Subject: * aptsources/distro.py: - fix typo (LP#84009) --- aptsources/distro.py | 5 ++--- debian/changelog | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'aptsources') diff --git a/aptsources/distro.py b/aptsources/distro.py index a95fecdd..16fb0dc7 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -426,8 +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) diff --git a/debian/changelog b/debian/changelog index 7e897122..05efcd08 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +python-apt (0.6.20ubuntu14) feisty; urgency=low + + * aptsources/distro.py: + - fix typo (LP#84009) + + -- + python-apt (0.6.20ubuntu13) feisty; urgency=low * fix in the duplicated source checking (thanks to Sebastian Heinlein) -- cgit v1.2.3