[portage-2.1.11.62] I noticed I have busybox installed. Personally, I don't use it at all. $ equery d busybox * These packages depend on busybox: virtual/awk-0 (sys-apps/busybox) virtual/dev-manager-0 (sys-apps/busybox[mdev]) virtual/awk: RDEPEND=" || ( sys-apps/gawk sys-apps/mawk sys-apps/nawk sys-apps/busybox )" virtual/dev-manager: RDEPEND="|| ( virtual/udev sys-apps/busybox[mdev] sys-fs/devfsd sys-fs/static-dev sys-freebsd/freebsd-sbin )" I have sys-apps/gawk and virtual/udev, so I don't need busybox. It would be nice if --depclean could catch these situations. Furthermore, with full dep-tree resolution (something like --depclean --deep) it could reveal additional unnecessary packages we all may have in our systems. Reproducible: Always
More precisely, in the simplest form what I'm asking for is --depclean being able to deal with the || dependency operator. So that if only, say, virtual/awk depended on || ( busybox smthg1 smthg2 ), and virtual/dev-manager didn't exist, --depclean would remove busybox, because it can see that I also have sys-apps/gawk which is enough to satisfy the needs of virtual/awk. gawk is needed by some other packages, too, so there would be no offer of what to remove - whether busybox or gawk. The next step would be depclean's awareness of all ||-style dependencies of all installed packages and the ability to prune as many of those ||-alts as possible across all packages. That would also let depclean recognize the situation I described originally, where busybox is pulled in by two packages. With only the ability described in the previous paragraph, depclean wouldn't know that I don't need busybox: it would check the ||-alts of virtual/awk, know that I have both gawk and busybox, try to, sort of, "--pretend"-remove each one of them, but find out that both are needed by some other package and leave them both in place. Finally, the ultra version would be something like --depclean --deep. That would possibly lead to both unmerging and emerging operations in one go.
The behavior that you request is already implemented by these commits: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4f66159887fc4e3ec8bd87ae0f08ba249f98631b http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e6a9e9692a8e98ccf45d90447ae083619b6f47f9 For example, this behavior triggers removal of sys-apps/less as reported in bug 370295. (In reply to comment #0) > $ equery d busybox You should not trust equery depends, at least because of bug 370295. Use `emerge --pv --depclean <atom>` to check reverse dependencies as emerge sees them.
(In reply to comment #2) > The behavior that you request is already implemented by these commits: > > http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit; > h=4f66159887fc4e3ec8bd87ae0f08ba249f98631b > http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit; > h=e6a9e9692a8e98ccf45d90447ae083619b6f47f9 > > For example, this behavior triggers removal of sys-apps/less as reported in > bug 370295. > > (In reply to comment #0) > > $ equery d busybox > > You should not trust equery depends, at least because of bug 370295. > > Use `emerge --pv --depclean <atom>` to check reverse dependencies as emerge > sees them. Important stuff, thanks. Turns out I've got busybox for a different reason entirely: @system. Do you happen to know why is busybox in @system? I wonder if I should open a bug asking to have it removed.
(In reply to comment #3) > Important stuff, thanks. Turns out I've got busybox for a different reason > entirely: @system. Do you happen to know why is busybox in @system? I wonder > if I should open a bug asking to have it removed. It's in the system set since it's useful as a rescue shell if things like coreutils get broken somehow (see bug #94918). You can remove it from your system profile like this: mkdir -p /etc/portage/profile echo '-*sys-apps/busybox' >> /etc/portage/profile/packages This reverses the setting from ${PORTDIR}/profiles/default/linux/packages. *** This bug has been marked as a duplicate of bug 264434 ***