It would be cool if emerge has an option (maybe as a suboption of depclean) to not only calculate whether a package could savely be removed but calculate what other packages has to be removed/modified to remove the package savely.
This is similar to apt purge, but given the useflag system calculation should be more compilcated but also more powerful.
What I have in mind is something like:
--with-other-packages-minimal: calculate beside the requested package the removal of all packages that are needed for savely removal. If the requested package is only depended because a useflag is active, the useflag will be deactivated
--with-other-packages: calculate beside the requested package the removal of all packages that are needed for savely removal.
The output can then look like so:
$ emerge --depclean --with-other-packages-minimal -a dev-foo/bar
This package changes are necessary:
[ebuild N ] dev-foo/foo
[ebuild R ] media-foo/something USE="-bar"
[ebuild remove ] dev-foo/bar2
[ebuild remove ] dev-foo/bar
The following use changes are necessary to savely remove dev-foo/bar:
The motivation behind this feature request is, that you sometimes want to remove packages, but ran through different stages of "emerge --depclean -av ..." or
"equery depends ..." to look what package has the wanted package as dependency, then looking whether the dependency can be eliminated via useflag, and if not, deciding to remove the package as well.
*** Bug 336889 has been marked as a duplicate of this bug. ***