[Yum-devel] Resolving dependencies for postresolve-plugin actions

Panu Matilainen pmatilai at laiskiainen.org
Mon Feb 20 11:13:21 UTC 2006


Just got reminded of something that has bothered me for a while now by
getting bitten by it: we should have a second run of resolveDeps() if 
postresolve-stage plugin changes the transaction set. Otherwise it can 
leave rpmdb in inconsistent state - for example installonlyn plugin 
decides to remove old kernels but any kernel-module packages depending on 
it are still left on the system. Ditto for any other changes in 
postresolve, not having postresolve actions depsolved limits its usability 
in various other ways as well.

Something like this would be needed (just checking for tsInfo size isn't 
really sufficient but you'll get the idea):

--- __init__.py.2nd     2006-02-20 12:40:57.000000000 +0200
+++ __init__.py 2006-02-20 13:03:07.000000000 +0200
@@ -348,7 +348,11 @@
             packageSack or rpmdb, and pack up the ts accordingly"""
          self.plugins.run('preresolve')
          (rescode, restring) = self.resolveDeps()
+        tsize = len(self.tsInfo)
          self.plugins.run('postresolve', rescode=rescode, 
restring=restring)
+        # if tsInfo has changed need to rerun depsolve
+        if len(self.tsInfo) != tsize:
+            (rescode, restring) = self.resolveDeps()
          return rescode, restring

      def runTransaction(self, cb):

Another option would be to leave calling resolveDeps() up to the plugins 
if they need it.

 	- Panu -




More information about the Yum-devel mailing list