[Yum-devel] [PATCH] make old installonly packages been erased by installonly_limit depend on the new one, so they will get pulled by skipbroken if the new installonly is pulled because of dep problems (rhbz #561928)

Tim Lauridsen tim.lauridsen at googlemail.com
Sun Feb 7 08:37:16 UTC 2010


---
 yum/__init__.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/yum/__init__.py b/yum/__init__.py
index 968362c..b9f9430 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -4025,10 +4025,14 @@ class YumBase(depsolve.Depsolve):
                                 continue
                             if numleft == 0:
                                 break
-                            toremove.append(po)
+                            toremove.append([po,m])
                             numleft -= 1
                         
-        map(self.tsInfo.addErase, toremove)
+        for po,rel in toremove:
+            txmbr = self.tsInfo.addErase(toremove)
+            # Add a dep relation to the new version of the package, causing this one to be erased
+            # this way skipbroken, should clean out the old one, if the new one is skipped
+            txmbr.depends_on.append(rel)
 
     def processTransaction(self, callback=None,rpmTestDisplay=None, rpmDisplay=None):
         '''
-- 
1.6.6



More information about the Yum-devel mailing list