[Yum-devel] [PATCH] Don't cache fileRequires when the user has butchered their rpmdb

James Antill james at and.org
Wed Jan 27 16:12:00 UTC 2010


 Basically if something in the rpmdb has missing file requires, then
don't bother caching the file requires data ... we could actually save
the Unresolved data too, but I figured it wouldn't be common and we'd
just tell people to not do that (hint, tim ;).
 We did this at the entry point which we'd never hit, but missed the
one we can "easily" hit with rpm --nodeps ... oops.
---
 yum/rpmsack.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/yum/rpmsack.py b/yum/rpmsack.py
index 6840a57..b45f315 100644
--- a/yum/rpmsack.py
+++ b/yum/rpmsack.py
@@ -659,6 +659,11 @@ class RPMDBPackageSack(PackageSackBase):
          installedUnresolvedFileRequires,
          installedFileProvides) = data
 
+        #  Have to do this here, as well as in transactionCacheFileRequires,
+        # because fileRequiresData() calls us directly.
+        if installedUnresolvedFileRequires:
+            return
+
         fo = open(self._cachedir + '/file-requires.tmp', 'w')
         fo.write("%s\n" % rpmdbversion)
 
-- 
1.6.6



More information about the Yum-devel mailing list