[yum-commits] Branch 'yum-3_2_X' - 6 commits - yum/comps.py

James Antill james at osuosl.org
Mon Nov 2 21:49:56 UTC 2009


 yum/comps.py |   31 +++++++++++++++++++++++++------
 1 file changed, 25 insertions(+), 6 deletions(-)

New commits:
commit 748043076b0d734e16767ad66c7ccd97116efdde
Merge: 32158be... 6edfd84...
Author: James Antill <james at and.org>
Date:   Mon Nov 2 16:49:01 2009 -0500

    Merge commit '6edfd8428a6d424db8dd0ca641875d466d391b1b' into yum-3_2_X
    
    * commit '6edfd8428a6d424db8dd0ca641875d466d391b1b':
      Remove the repoid check, the base name check is "better" and this kills it
      Only search through non-locale group names, if we didn't match anything
      Match only current language instead of all in group/category searches.

commit 32158bea5ff6689262af78cc01ec8d009a867749
Author: James Antill <james at and.org>
Date:   Mon Nov 2 14:33:29 2009 -0500

    Only search through non-locale group names, if we didn't match anything

diff --git a/yum/comps.py b/yum/comps.py
index 8d3e171..f53b4f4 100755
--- a/yum/comps.py
+++ b/yum/comps.py
@@ -434,9 +434,20 @@ class Comps(object):
             else:
                 match = re.compile(fnmatch.translate(item), flags=re.I).match
 
+            done = False
             for group in self.groups:
                 for name in group.name, group.groupid, group.ui_name:
                     if match(name):
+                        done = True
+                        returns[group.groupid] = group
+                        break
+            if done:
+                continue
+
+            # If we didn't match to anything in the current locale, try others
+            for group in self.groups:
+                for name in group.translated_name.values():
+                    if match(name):
                         returns[group.groupid] = group
                         break
 
@@ -460,9 +471,19 @@ class Comps(object):
             else:
                 match = re.compile(fnmatch.translate(item), flags=re.I).match
 
+            done = False
             for cat in self.categories:
                 for name in cat.name, cat.categoryid, cat.ui_name:
                     if match(name):
+                        done = True
+                        returns[cat.categoryid] = cat
+                        break
+            if done:
+                continue
+
+            for cat in self.categories:
+                for name in cat.translated_name.values():
+                    if match(name):
                         returns[cat.categoryid] = cat
                         break
 
commit a81c72493604de2e97db13e210bc8c004257e8da
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Oct 31 14:49:47 2009 +0200

    Match only current language instead of all in group/category searches.

diff --git a/yum/comps.py b/yum/comps.py
index 1e91b64..8d3e171 100755
--- a/yum/comps.py
+++ b/yum/comps.py
@@ -435,11 +435,10 @@ class Comps(object):
                 match = re.compile(fnmatch.translate(item), flags=re.I).match
 
             for group in self.groups:
-                names = [ group.name, group.groupid ]
-                names.extend(group.translated_name.values())
-                for name in names:                
+                for name in group.name, group.groupid, group.ui_name:
                     if match(name):
                         returns[group.groupid] = group
+                        break
 
         return returns.values()
 
@@ -462,11 +461,10 @@ class Comps(object):
                 match = re.compile(fnmatch.translate(item), flags=re.I).match
 
             for cat in self.categories:
-                names = [ cat.name, cat.categoryid ]
-                names.extend(cat.translated_name.values())
-                for name in names:
+                for name in cat.name, cat.categoryid, cat.ui_name:
                     if match(name):
                         returns[cat.categoryid] = cat
+                        break
 
         return returns.values()
 
commit 6edfd8428a6d424db8dd0ca641875d466d391b1b
Author: James Antill <james at and.org>
Date:   Mon Nov 2 15:06:37 2009 -0500

    Remove the repoid check, the base name check is "better" and this kills it

diff --git a/yum/depsolve.py b/yum/depsolve.py
index 4c9ebd0..b645fbb 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -1177,12 +1177,6 @@ class Depsolve(object):
                 
                     pkgresults[po] += cpl*2
                 
-                # if a provider is from the same repo as the reqpo
-                # give it a slight nudge
-                if reqpo.repoid == po.repoid:
-                    self.verbose_logger.log(logginglevels.DEBUG_4,
-                        _('common repoid of %s between %s and %s' % (po.repoid, po, reqpo)))
-                    pkgresults[po] += 8
             pkgresults[po] += (len(po.name)*-1)
 
         bestorder = sorted(pkgresults.items(),
commit 7d9ebc18c334677902c622bbceb5a9e59c0a16eb
Author: James Antill <james at and.org>
Date:   Mon Nov 2 14:33:29 2009 -0500

    Only search through non-locale group names, if we didn't match anything

diff --git a/yum/comps.py b/yum/comps.py
index 8d3e171..f53b4f4 100755
--- a/yum/comps.py
+++ b/yum/comps.py
@@ -434,9 +434,20 @@ class Comps(object):
             else:
                 match = re.compile(fnmatch.translate(item), flags=re.I).match
 
+            done = False
             for group in self.groups:
                 for name in group.name, group.groupid, group.ui_name:
                     if match(name):
+                        done = True
+                        returns[group.groupid] = group
+                        break
+            if done:
+                continue
+
+            # If we didn't match to anything in the current locale, try others
+            for group in self.groups:
+                for name in group.translated_name.values():
+                    if match(name):
                         returns[group.groupid] = group
                         break
 
@@ -460,9 +471,19 @@ class Comps(object):
             else:
                 match = re.compile(fnmatch.translate(item), flags=re.I).match
 
+            done = False
             for cat in self.categories:
                 for name in cat.name, cat.categoryid, cat.ui_name:
                     if match(name):
+                        done = True
+                        returns[cat.categoryid] = cat
+                        break
+            if done:
+                continue
+
+            for cat in self.categories:
+                for name in cat.translated_name.values():
+                    if match(name):
                         returns[cat.categoryid] = cat
                         break
 
commit 913b3283bf4406839a63016d90748bae4d18e94c
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Oct 31 14:49:47 2009 +0200

    Match only current language instead of all in group/category searches.

diff --git a/yum/comps.py b/yum/comps.py
index 1e91b64..8d3e171 100755
--- a/yum/comps.py
+++ b/yum/comps.py
@@ -435,11 +435,10 @@ class Comps(object):
                 match = re.compile(fnmatch.translate(item), flags=re.I).match
 
             for group in self.groups:
-                names = [ group.name, group.groupid ]
-                names.extend(group.translated_name.values())
-                for name in names:                
+                for name in group.name, group.groupid, group.ui_name:
                     if match(name):
                         returns[group.groupid] = group
+                        break
 
         return returns.values()
 
@@ -462,11 +461,10 @@ class Comps(object):
                 match = re.compile(fnmatch.translate(item), flags=re.I).match
 
             for cat in self.categories:
-                names = [ cat.name, cat.categoryid ]
-                names.extend(cat.translated_name.values())
-                for name in names:
+                for name in cat.name, cat.categoryid, cat.ui_name:
                     if match(name):
                         returns[cat.categoryid] = cat
+                        break
 
         return returns.values()
 


More information about the Yum-commits mailing list