[Yum-devel] [PATCH 1/3] Do the pkgnames_loaded in the correct place, for _search

James Antill james at and.org
Mon Apr 12 16:21:32 UTC 2010


---
 yum/rpmsack.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/yum/rpmsack.py b/yum/rpmsack.py
index 4c17b67..179b008 100644
--- a/yum/rpmsack.py
+++ b/yum/rpmsack.py
@@ -1009,9 +1009,6 @@ class RPMDBPackageSack(PackageSackBase):
         ts = self.readOnlyTS()
         if name is not None:
             mi = ts.dbMatch('name', name)
-            #  We create POs out of all matching names, even if we don't return
-            # them.
-            self._pkgnames_loaded.add(name)
         elif arch is not None:
             mi = ts.dbMatch('arch', arch)
         else:
@@ -1022,6 +1019,10 @@ class RPMDBPackageSack(PackageSackBase):
             if hdr['name'] == 'gpg-pubkey':
                 continue
             po = self._makePackageObject(hdr, mi.instance())
+            #  We create POs out of all matching names, even if we don't return
+            # them.
+            self._pkgnames_loaded.add(po.name)
+
             for tag in ('arch', 'rel', 'ver', 'epoch'):
                 if loc[tag] is not None and loc[tag] != getattr(po, tag):
                     break
-- 
1.6.6.1



More information about the Yum-devel mailing list