Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 787755

Summary: sys-apps/portage: emerge option to recursively remove a package and its reverse dependencies
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: Core - Interface (emerge)Assignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal CC: esigra, gentoo, kingjon3377, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=416907
https://bugs.gentoo.org/show_bug.cgi?id=257009
https://bugs.gentoo.org/show_bug.cgi?id=476350
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 155723, 300071    

Description Zac Medico gentoo-dev 2021-05-02 18:18:02 UTC
An option to recursively remove a package and its reverse dependencies will complement the related option requested in bug 416907. It's possible to achieve an equivalent result by using emerge --deselect <packages> && emerge --depclean, but we need an automated way to determine the recursive reverse dependencies in the emerge --deselect <packages> list, and we don't want to invoke the global emerge --depclean command.
Comment 1 Zac Medico gentoo-dev 2021-05-02 18:45:32 UTC
This calculation is useful for various conflict resolution strategies, since it can be used to actively eliminate packages with conflicting or unsatisfiable dependencies. It can possibly be adapted as a means to automatically constrain the scope of emerge --keep-going calculations to fit the behavior described in bug 476350.
Comment 2 Zac Medico gentoo-dev 2021-05-02 18:54:05 UTC
Since emerge --depclean already builds a suitable dependency graph for this calculation, it's just a matter of performing the graph operations to determine which packages would have to be deselected, which should only be a few lines of code if expressed well.
Comment 3 Zac Medico gentoo-dev 2021-05-02 19:00:47 UTC
Simply traverse graph edges from the packages that we would like to remove, and use the PackageSet iterAtomsForPackage method to pair edges with matching @selected atoms that need to be deselected.