[yum-git] yum/yumRepo.py

James Antill james at linux.duke.edu
Wed May 14 05:11:35 UTC 2008


 yum/yumRepo.py |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit c0ba4430f6c87484a4de1bdb63d1d01db4167f9c
Author: James Antill <james at and.org>
Date:   Wed May 14 00:59:05 2008 -0400

     Kind of fix yum behind password protected AP, aka. bug#446248 etc.
       Don't spam screen with html.
       Don't die on unicode() (hopefully :).
    
     No "you might be behind a protected AP" text though ... do we need it?

diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 2780e85..1527181 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -529,15 +529,22 @@ class YumRepository(Repository, config.RepoConf):
         
     def _replace_and_check_url(self, url_list):
         goodurls = []
+        skipped = None
         for url in url_list:
             url = parser.varReplace(url, self.yumvar)
             (s,b,p,q,f,o) = urlparse.urlparse(url)
             if s not in ['http', 'ftp', 'file', 'https']:
-                print 'YumRepo Warning: not using ftp, http[s], or file for repos, skipping - %s' % (url)
+                skipped = url
                 continue
             else:
                 goodurls.append(url)
 
+        if skipped is not None:
+            # Caller cleans up for us.
+            if goodurls:
+                print 'YumRepo Warning: Some mirror URLs are not using ftp, http[s] or file.\n Eg. %s' % misc.to_utf8(skipped)
+            else: # And raises in this case
+                print 'YumRepo Error: All mirror URLs are not using ftp, http[s] or file.\n Eg. %s' % misc.to_utf8(skipped)
         return goodurls
 
     def _geturls(self):



More information about the Yum-cvs-commits mailing list