From: Michael Tremer Date: Wed, 29 Feb 2012 17:37:50 +0000 (+0100) Subject: Don't download mirrorlist at repository initialization. X-Git-Tag: 0.9.21~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90919c62214dd821048027cce5752a8d7f64d437;p=pakfire.git Don't download mirrorlist at repository initialization. --- diff --git a/python/pakfire/downloader.py b/python/pakfire/downloader.py index 3bfbff21b..f89681f54 100644 --- a/python/pakfire/downloader.py +++ b/python/pakfire/downloader.py @@ -190,8 +190,6 @@ class MirrorList(object): # Save URL to more mirrors. self.mirrorlist = repo._mirrors - self.update(force=False) - @property def distro(self): return self.repo.distro @@ -245,6 +243,7 @@ class MirrorList(object): f.close() # Read mirrorlist from cache and parse it. + self.forget_mirrors() with self.cache.open(cache_filename) as f: self.parse_mirrordata(f.read()) @@ -259,6 +258,9 @@ class MirrorList(object): self.__mirrors.append(mirror) + def forget_mirrors(self): + self.__mirrors = [] + @property def preferred(self): """ @@ -289,6 +291,9 @@ class MirrorList(object): """ Return a MirrorGroup object for the given grabber. """ + # Make sure the mirrorlist is up to date. + self.update() + # A list of mirrors that is passed to MirrorGroup. mirrors = []