[yum-cvs] yum/yum config.py,1.68,1.69

Seth Vidal skvidal at login.linux.duke.edu
Wed Jun 22 04:27:48 UTC 2005


Update of /home/groups/yum/cvs/yum/yum
In directory login:/tmp/cvs-serv26619

Modified Files:
	config.py 
Log Message:

Check in terje rosten's patch to config.py to handle reposdir as a list, not
a string


Index: config.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/config.py,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- config.py	20 Jun 2005 00:10:10 -0000	1.68
+++ config.py	22 Jun 2005 04:27:46 -0000	1.69
@@ -740,32 +740,35 @@
     # read each of them in using confpp, then parse them same as any other repo
     # section - as above.
 
-    reposdir = conf.reposdir
-    if os.path.exists(conf.installroot + '/' + reposdir):
-        reposdir = conf.installroot + '/' + reposdir
-    
-    reposglob = reposdir + '/*.repo'
-    if os.path.exists(reposdir) and os.path.isdir(reposdir):
-        repofn = glob.glob(reposglob)
-        repofn.sort()
-        
-        for fn in repofn:
-            if not os.path.isfile(fn):
-                continue
+    reposdirs = []
+    for dir in conf.reposdir:
+        if os.path.exists(conf.installroot + '/' + dir):
+            reposdirs.append(conf.installroot + '/' + dir)
+
+    repofn = []
+    for reposdir in reposdirs:
+        if os.path.exists(reposdir) and os.path.isdir(reposdir):
+            reposglob = reposdir + '/*.repo'
+            repofn.extend(glob.glob(reposglob))
+
+    repofn.sort()
+    for fn in repofn:
+        if not os.path.isfile(fn):
+            continue
+        try:
+            cfg, sections = parseDotRepo(fn)
+        except Errors.ConfigError, e:
+            print >> sys.stderr, e
+            continue
+
+        for section in sections:
             try:
-                cfg, sections = parseDotRepo(fn)
-            except Errors.ConfigError, e:
+                thisrepo = cfgParserRepo(section, conf, cfg)
+            except (Errors.RepoError, Errors.ConfigError), e:
                 print >> sys.stderr, e
                 continue
-
-            for section in sections:
-                try:
-                    thisrepo = cfgParserRepo(section, conf, cfg)
-                except (Errors.RepoError, Errors.ConfigError), e:
-                    print >> sys.stderr, e
-                    continue
-                else:
-                    reposlist.append(thisrepo)
+            else:
+                reposlist.append(thisrepo)
 
     # got our list of repo objects
     reposlist.sort()




More information about the Yum-cvs-commits mailing list