]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blame - pakfire/patches/pakfire-0.9.20-dont-download-mirrorlists.patch
mc: Update to 4.8.2.
[people/arne_f/ipfire-3.x.git] / pakfire / patches / pakfire-0.9.20-dont-download-mirrorlists.patch
CommitLineData
63c2bb86
MT
1From 90919c62214dd821048027cce5752a8d7f64d437 Mon Sep 17 00:00:00 2001
2From: Michael Tremer <michael.tremer@ipfire.org>
3Date: Wed, 29 Feb 2012 18:37:50 +0100
4Subject: [PATCH] Don't download mirrorlist at repository initialization.
5
6---
7 python/pakfire/downloader.py | 9 +++++++--
8 1 files changed, 7 insertions(+), 2 deletions(-)
9
10diff --git a/python/pakfire/downloader.py b/python/pakfire/downloader.py
11index 3bfbff2..f89681f 100644
12--- a/python/pakfire/downloader.py
13+++ b/python/pakfire/downloader.py
14@@ -190,8 +190,6 @@ class MirrorList(object):
15 # Save URL to more mirrors.
16 self.mirrorlist = repo._mirrors
17
18- self.update(force=False)
19-
20 @property
21 def distro(self):
22 return self.repo.distro
23@@ -245,6 +243,7 @@ class MirrorList(object):
24 f.close()
25
26 # Read mirrorlist from cache and parse it.
27+ self.forget_mirrors()
28 with self.cache.open(cache_filename) as f:
29 self.parse_mirrordata(f.read())
30
31@@ -259,6 +258,9 @@ class MirrorList(object):
32
33 self.__mirrors.append(mirror)
34
35+ def forget_mirrors(self):
36+ self.__mirrors = []
37+
38 @property
39 def preferred(self):
40 """
41@@ -289,6 +291,9 @@ class MirrorList(object):
42 """
43 Return a MirrorGroup object for the given grabber.
44 """
45+ # Make sure the mirrorlist is up to date.
46+ self.update()
47+
48 # A list of mirrors that is passed to MirrorGroup.
49 mirrors = []
50
51--
521.7.3.4
53