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

skvidal at osuosl.org skvidal at osuosl.org
Wed Sep 2 18:59:00 UTC 2009


 yum/misc.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5ffd1896ecd4d6d503a5afe033ba6c4c7f155a79
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Wed Sep 2 14:58:30 2009 -0400

    make sure our glob match looks for something between [ ]'s

diff --git a/yum/misc.py b/yum/misc.py
index 68ab9e4..a8f7954 100644
--- a/yum/misc.py
+++ b/yum/misc.py
@@ -79,7 +79,7 @@ def re_glob(s):
     # re.match('.*[\*\?\[\]].*', name)
     global _re_compiled_glob_match
     if _re_compiled_glob_match is None:
-        _re_compiled_glob_match = re.compile('.*[\*\?\[\]].*')
+        _re_compiled_glob_match = re.compile('.*([*?]|\[.+\])')
     return _re_compiled_glob_match.match(s)
 
 _re_compiled_pri_fnames_match = None
commit 655adb93b4b680ed47108b0f61edc5f1ad5cc530
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Wed Sep 2 14:54:33 2009 -0400

    Revert " Fix for https://bugzilla.redhat.com/show_bug.cgi?id=520810"
    
    This reverts commit 12d9ee9ee22b68c70ebfc81b6f995626526d3cd2.

diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
index 0b96c8a..b6c14c5 100644
--- a/yum/sqlitesack.py
+++ b/yum/sqlitesack.py
@@ -836,7 +836,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
     def _search_primary_files(self, name):
         querytype = 'glob'
         if not misc.re_glob(name):
-            querytype = '='
+            querytype = '='        
         results = []
         
         for (rep,cache) in self.primarydb.items():
@@ -846,16 +846,6 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
             executeSQL(cur, "select DISTINCT pkgKey from files where name %s ?" % querytype, (name,))
             self._sql_pkgKey2po(rep, cur, results)
 
-            # https://bugzilla.redhat.com/show_bug.cgi?id=520810
-            # just b/c it looks like a glob doesn't mean it IS a glob:
-            # /usr/bin/[ is a legit file in coreutils but it looks (and acts) 
-            # just like a glob - so we need to do an ='s search even if it looks
-            # like a glob. This makes me cranky.
-            if querytype == 'glob':
-                querytype = '='
-                executeSQL(cur, "select DISTINCT pkgKey from files where name %s ?" % querytype, (name,))
-                self._sql_pkgKey2po(rep, cur, results)
-
         return misc.unique(results)
         
     @catchSqliteException
commit 12d9ee9ee22b68c70ebfc81b6f995626526d3cd2
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Wed Sep 2 11:01:04 2009 -0400

     Fix for https://bugzilla.redhat.com/show_bug.cgi?id=520810
    
     just b/c it looks like a glob doesn't mean it IS a glob:
     /usr/bin/[ is a legit file in coreutils but it looks (and acts)
     just like a glob - so we need to do an ='s search even if it looks
     like a glob. This makes me cranky.

diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
index b6c14c5..0b96c8a 100644
--- a/yum/sqlitesack.py
+++ b/yum/sqlitesack.py
@@ -836,7 +836,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
     def _search_primary_files(self, name):
         querytype = 'glob'
         if not misc.re_glob(name):
-            querytype = '='        
+            querytype = '='
         results = []
         
         for (rep,cache) in self.primarydb.items():
@@ -846,6 +846,16 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
             executeSQL(cur, "select DISTINCT pkgKey from files where name %s ?" % querytype, (name,))
             self._sql_pkgKey2po(rep, cur, results)
 
+            # https://bugzilla.redhat.com/show_bug.cgi?id=520810
+            # just b/c it looks like a glob doesn't mean it IS a glob:
+            # /usr/bin/[ is a legit file in coreutils but it looks (and acts) 
+            # just like a glob - so we need to do an ='s search even if it looks
+            # like a glob. This makes me cranky.
+            if querytype == 'glob':
+                querytype = '='
+                executeSQL(cur, "select DISTINCT pkgKey from files where name %s ?" % querytype, (name,))
+                self._sql_pkgKey2po(rep, cur, results)
+
         return misc.unique(results)
         
     @catchSqliteException


More information about the Yum-commits mailing list