[Yum-devel] improvements for remove-with-leaves plugin

Casey Jao cjao at ugcs.caltech.edu
Sun Mar 20 23:40:10 UTC 2011


Hi,

Suppose we want to remove package A and all of its unused dependencies.
As written, the plugin will only remove the dependencies of A which
would become leaves after automatically installing A. In a situation like

A <-- B --> C --> D

where "X --> Y" means "Y depends on X".

where B, C, D were dep-installed, we clearly want to remove B, C, and D
as well. But the plugin will not do this because B won't be a leaf after
removing A.

I have attached sample code for an alternative approach. Instead of
removing only the dependencies which would become leaves after removing
A, we remove all dependencies of A whose reverse dependencies, after
removing A, would be all dep-installed. This approach would deal better
with dependency relationships like shown above, and it should also fix
the FIXME concerning circular dependencies.

Please let me know what you think. In particular, the plugin runs more
slowly now because it has to examine more packages.

Attached files:
remove-with-leaves.py (original)
remove-with-leaves-working.py (my version)
remove-with-leaves.diff

Regards,
Casey
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: remove-with-leaves.py
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20110320/6c546a65/attachment-0002.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: remove-with-leaves-working.py
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20110320/6c546a65/attachment-0003.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: remove-with-leaves.diff
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20110320/6c546a65/attachment-0001.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 553 bytes
Desc: OpenPGP digital signature
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20110320/6c546a65/attachment-0001.asc>


More information about the Yum-devel mailing list