[yum-cvs] plugins/fastestmirror

Luke Macken lmacken at linux.duke.edu
Mon Dec 3 18:37:52 UTC 2007


 plugins/fastestmirror/ChangeLog          |    3 +++
 plugins/fastestmirror/fastestmirror.conf |    1 +
 plugins/fastestmirror/fastestmirror.py   |    9 +++++----
 3 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 5cf2afa03f5fedeb45d7cde6e5dec60052c4ab74
Author: Luke Macken <lmacken at redhat.com>
Date:   Mon Dec 3 13:36:35 2007 -0500

    Support multiple mirror excludes in fastestmirror

diff --git a/plugins/fastestmirror/ChangeLog b/plugins/fastestmirror/ChangeLog
index d33e1fe..f6c73bf 100644
--- a/plugins/fastestmirror/ChangeLog
+++ b/plugins/fastestmirror/ChangeLog
@@ -1,3 +1,6 @@
+* Dec  3 2007 Luke Macken <lmacken at redhat.com> - 0.3.1
+- Support multiple excludes
+
 * Dec  3 2007 Luke Macken <lmacken at redhat.com> - 0.3.0
 - Throttle threads based on 'maxthreads' configuration option (rh#227772)
 - Add an exclude configuration option (rh#407471)
diff --git a/plugins/fastestmirror/fastestmirror.conf b/plugins/fastestmirror/fastestmirror.conf
index 76af534..5504a7d 100644
--- a/plugins/fastestmirror/fastestmirror.conf
+++ b/plugins/fastestmirror/fastestmirror.conf
@@ -5,3 +5,4 @@ socket_timeout=3
 hostfilepath=/var/cache/yum/timedhosts.txt
 maxhostfileage=10
 maxthreads=15
+#exclude=.gov, facebook
diff --git a/plugins/fastestmirror/fastestmirror.py b/plugins/fastestmirror/fastestmirror.py
index 9e782b0..717beeb 100644
--- a/plugins/fastestmirror/fastestmirror.py
+++ b/plugins/fastestmirror/fastestmirror.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Version: 0.3.0
+# Version: 0.3.1
 #
 # A plugin for the Yellowdog Updater Modified which sorts each repo's
 # mirrorlist by connection speed prior to download.
@@ -17,7 +17,7 @@
 #   hostfilepath=/var/cache/yum/timedhosts
 #   maxhostfileage=10
 #   maxthreads=15
-#   #exclude=.gov
+#   #exclude=.gov, facebook
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -89,8 +89,9 @@ def postreposetup_hook(conduit):
             repomirrors[str(repo)] = FastestMirror(repo.urls).get_mirrorlist()
         if exclude:
             for mirror in repomirrors[str(repo)]:
-                if exclude in host(mirror):
-                    conduit.info(2, "Excluding mirrors: %s" % host(mirror))
+                if filter(lambda exp: exp in host(mirror),
+                          exclude.replace(',', ' ').split()):
+                    conduit.info(2, "Excluding mirror: %s" % host(mirror))
                     repomirrors[str(repo)].remove(mirror)
         repo.urls = repomirrors[str(repo)]
         conduit.info(2, " * %s: %s" % (str(repo), host(repo.urls[0])))



More information about the Yum-cvs-commits mailing list