[yum-commits] Branch 'yum-3_2_X' - 2 commits - yum/rpmsack.py

James Antill james at osuosl.org
Thu Jun 3 15:44:23 UTC 2010


 yum/rpmsack.py |   20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

New commits:
commit e72347d0a3fb991f71a09d18f60ff49d7f33d51f
Author: James Antill <james at and.org>
Date:   Thu Jun 3 11:44:13 2010 -0400

    Don't fail for returnPackages(patterns=['[g]eany']) etc.

diff --git a/yum/rpmsack.py b/yum/rpmsack.py
index 627514b..fd7cc1f 100644
--- a/yum/rpmsack.py
+++ b/yum/rpmsack.py
@@ -407,7 +407,7 @@ class RPMDBPackageSack(PackageSackBase):
                 continue
 
             qpat = pat[0]
-            if qpat in ('?', '*'):
+            if qpat in ('?', '*', '['):
                 qpat = None
             if ignore_case:
                 if qpat is not None:
commit 7aa6510b3eddc293c0ca6c88247cfae2dbeb6d51
Author: James Antill <james at and.org>
Date:   Thu Jun 3 11:43:22 2010 -0400

    Don't bother looking for *, ? ... just wait for searchNames() to fail

diff --git a/yum/rpmsack.py b/yum/rpmsack.py
index c0b53ba..627514b 100644
--- a/yum/rpmsack.py
+++ b/yum/rpmsack.py
@@ -459,20 +459,16 @@ class RPMDBPackageSack(PackageSackBase):
         #  See if we can load the "patterns" via. dbMatch('name', ...) because
         # that's basically instant and walking the entire rpmdb isn't.
         if not self._completely_loaded and patterns and not ignore_case:
+            ret = []
             for pat in patterns:
-                if '?' in pat or '*' in pat:
+                #  We aren't wasting anything here, because the next bit
+                # will pick up any loads :)
+                pkgs = self.searchNames([pat])
+                if not pkgs:
                     break
+                ret.extend(pkgs)
             else:
-                ret = []
-                for pat in patterns:
-                    #  We aren't wasting anything here, because the next bit
-                    # will pick up any loads :)
-                    pkgs = self.searchNames([pat])
-                    if not pkgs:
-                        break
-                    ret.extend(pkgs)
-                else:
-                    return ret
+                return ret
 
         ret = []
         if patterns and not ignore_case:


More information about the Yum-commits mailing list