]>
Commit | Line | Data |
---|---|---|
63c2bb86 MT |
1 | From 90919c62214dd821048027cce5752a8d7f64d437 Mon Sep 17 00:00:00 2001 |
2 | From: Michael Tremer <michael.tremer@ipfire.org> | |
3 | Date: Wed, 29 Feb 2012 18:37:50 +0100 | |
4 | Subject: [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 | ||
10 | diff --git a/python/pakfire/downloader.py b/python/pakfire/downloader.py | |
11 | index 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 | -- | |
52 | 1.7.3.4 | |
53 |