[yum-cvs] yum/yum __init__.py,1.196.2.6,1.196.2.7

Seth Vidal skvidal at linux.duke.edu
Wed May 24 07:05:04 UTC 2006


Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv25363/yum

Modified Files:
      Tag: yum-2_6_X
	__init__.py 
Log Message:

if a user wants to install package foo and package foo is obsoleted by bar
install bar instead.


Index: __init__.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v
retrieving revision 1.196.2.6
retrieving revision 1.196.2.7
diff -u -r1.196.2.6 -r1.196.2.7
--- __init__.py	8 May 2006 15:39:34 -0000	1.196.2.6
+++ __init__.py	24 May 2006 07:05:02 -0000	1.196.2.7
@@ -1719,7 +1719,16 @@
                     rel=po.rel, ver=po.ver):
                 self.errorlog(2, 'Package %s already installed and latest version' % po)
                 continue
-
+            
+            # make sure we're not installing a package which is obsoleted by something
+            # else in the repo
+            thispkgobsdict = self.up.checkForObsolete([po.pkgtup])
+            if thispkgobsdict.has_key(po.pkgtup):
+                obsoleting = thispkgobsdict[po.pkgtup][0]
+                obsoleting_pkg = self.getPackageObject(obsoleting)
+                self.install(po=obsoleting_pkg)
+                continue
+                
             txmbr = self.tsInfo.addInstall(po)
             tx_return.append(txmbr)
         




More information about the Yum-cvs-commits mailing list