[yum-commits] yum/sqlitesack.py

zpavlas at osuosl.org zpavlas at osuosl.org
Wed Jan 18 17:02:09 UTC 2012


 yum/sqlitesack.py |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 85745b0f777a60ead8b85acaedf2784e610ccf86
Author: Zdeněk Pavlas <zpavlas at redhat.com>
Date:   Wed Jan 18 14:56:05 2012 +0100

    Make searchFiles() a bit faster
    
    Current re_primary_filename(n) filter is:
    1) 'bin/' in n => True
    2) n.startswith('/etc/') => True
    3) n == '/usr/lib/sendmail' => True
    4) else => False
    
    re_primary_filename(glob) implies re_primary_filename(n)
    for every possible expansion n of that glob, so we don't
    have to search filelists when searching such globs.

diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
index 19193ad..f6df93e 100644
--- a/yum/sqlitesack.py
+++ b/yum/sqlitesack.py
@@ -917,8 +917,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
 
         # ultra simple optimization 
         if misc.re_primary_filename(name):
-            if not misc.re_glob(dirname): # is the dirname a glob?
-                return self._search_primary_files(name)
+            return self._search_primary_files(name)
         
         if len(self.filelistsdb) == 0:
             # grab repo object from primarydb and force filelists population in this sack using repo


More information about the Yum-commits mailing list