[yum-cvs] yum/yum repos.py,1.89,1.90

Seth Vidal skvidal at linux.duke.edu
Wed Jan 11 07:15:24 UTC 2006


Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv31112/yum

Modified Files:
	repos.py 
Log Message:

allow repos to be specified with commas to --enablerepo and --disablerepo,
partial application of tim lauridsen's patch.


Index: repos.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/repos.py,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- repos.py	14 Dec 2005 21:17:21 -0000	1.89
+++ repos.py	11 Jan 2006 07:15:22 -0000	1.90
@@ -146,11 +146,13 @@
         """find all repositories matching fnmatch `pattern`"""
 
         result = []
-        match = re.compile(fnmatch.translate(pattern)).match
-
-        for name,repo in self.repos.items():
-            if match(name):
-                result.append(repo)
+        
+        for item in pattern.split(','):
+            item = item.strip()
+            match = re.compile(fnmatch.translate(item)).match
+            for name,repo in self.repos.items():
+                if match(name):
+                    result.append(repo)
         return result
         
     def disableRepo(self, repoid):
@@ -160,7 +162,7 @@
         returns repoid of disabled repos as list
         """
         repos = []
-        if _is_fnmatch_pattern(repoid):
+        if _is_fnmatch_pattern(repoid) or repoid.find(',') != -1:
             for repo in self.findRepos(repoid):
                 repos.append(repo.id)
                 repo.disable()
@@ -178,8 +180,7 @@
         returns repoid of enables repos as list
         """
         repos = []
-        
-        if _is_fnmatch_pattern(repoid):
+        if _is_fnmatch_pattern(repoid) or repoid.find(',') != -1:
             for repo in self.findRepos(repoid):
                 repos.append(repo.id)
                 repo.enable()




More information about the Yum-cvs-commits mailing list