[Yum-devel] [PATCH] when doing a localinstall check to see if the pkg we want to install is obsoleted by something already installed not just those things in the repos.

Seth Vidal skvidal at fedoraproject.org
Tue Jun 15 17:38:17 UTC 2010


---
 yum/__init__.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/yum/__init__.py b/yum/__init__.py
index 1d7637f..2db03ae 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -3698,6 +3698,11 @@ class YumBase(depsolve.Depsolve):
             self.logger.critical(_('Cannot add package %s to transaction. Not a compatible architecture: %s'), pkg, po.arch)
             return tx_return
         
+        obsoleters = po.obsoletedBy(self.rpmdb.searchObsoletes(po.name))
+        if obsoleters:
+            self.logger.critical(_('Cannot install package %s. It is obsoleted by installed package %s'), po, obsoleters[0])
+            return tx_return
+            
         # everything installed that matches the name
         installedByKey = self.rpmdb.searchNevra(name=po.name)
         # go through each package
-- 
1.7.0.1



More information about the Yum-devel mailing list