[Yum-devel] Two more plugin slots

Panu Matilainen pmatilai at laiskiainen.org
Wed Jun 1 16:22:51 UTC 2005


On Wed, 2005-06-01 at 17:51 +0300, Panu Matilainen wrote:
> The attached patch adds what I think are the two most crucial missing
> pieces in the current plugin infrastructure: preresolve and postresolve
> slots. 
> 
> Preresolve is needed for plugins which want to add/remove some packages
> to the transaction (and have their dependencies resolved) based perhaps
> on what else was in the transaction (feel free to come up with your own
> crack ideas :)
> 
> Postresolve is needed for taking custom action based on the dependency
> resolution process, a practical example would be the "don't let me eat
> myself" plugin discussed on yum-users list a few days ago.
> 
> Any big objections? Oh, one issue with the current patch: it would be
> nice to let the postresolve slot know the result code + string of
> resolveDeps() run. I'll check how to go about that + commit if nobody
> screams death to the apt-head to the general idea of these slots :)

Oh well, here's an updated patch with depsolve results passed to the
plugin (plus a missing ',' added in the previous patch :)

With this the "protect me" plugin can stop where it should (eg before
getting to the default prompt):

[root at weasel yum]# ./yummain.py remove python
Loading "protectcore" plugin
Setting up Remove Process
... 
[ enormous amount of deps to be removed ]
...
--> Processing Dependency: gail-devel >= 0.17 for package: glade2
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package glade2.x86_64 0:2.10.0-1 set to be erased
--> Running transaction check
Error: Transaction would remove protected package yum, aborting!

BTW resolving the removal dependencies seems strangely slow, considering
it's just in-memory rpmdb deps that need to be sorted out in that
situation. Not that removing huge amount of packages is really something
that happens every day but I would've expected it to be quite a bit
faster. Maybe I'll have a look if there's something to speed up one of
these days :)

	- Panu -
-------------- next part --------------
A non-text attachment was scrubbed...
Name: yum-plugin-resolve-slots.patch
Type: text/x-patch
Size: 2061 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20050601/a916854a/attachment.bin 


More information about the Yum-devel mailing list