Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 136178 - virtual/xyz dependencies handled randomly by "emerge --depclean"
Summary: virtual/xyz dependencies handled randomly by "emerge --depclean"
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 139877 150716 151403 (view as bug list)
Depends on:
Blocks: 155723
  Show dependency tree
 
Reported: 2006-06-09 05:09 UTC by Joe Wells
Modified: 2007-07-04 03:28 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Output of "emerge -info" on my system. (emerge-info-output,8.26 KB, text/plain)
2006-06-09 05:10 UTC, Joe Wells
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Wells 2006-06-09 05:09:03 UTC
When more than one package does PROVIDE="virtual/xyz", and some other
package depends on virtual/xyz, then it will be somewhat random which
package "emerge --depclean" will believe satisifes the dependency.
Hence, it will be somewhat random whether "emerge --depclean" believes
that a package is not needed.

In my case, this arises with mail-mta/ssmtp and mail-mta/nullmailer,
both of which do PROVIDE="virtual/mta".  I have mail-mta/nullmailer in
/var/lib/portage/world, because it is the one I am actively using.  I
have not yet bothered to uninstall mail-mta/ssmtp.  There is at least
one needed package that depends on virtual/mta (e.g., in my case
sys-process/vixie-cron depends on it).

As a result, "emerge --pretend --depclean world" randomly either does
or does not report mail-mta/ssmtp as being unneeded.  (This also
affects net-mail/mailbase, because on my system it is only depended on
by mail-mta/ssmtp.)

In my case, the only problem caused is that some packages are
sometimes randomly not being detected as unneeded.  However, if I
didn't have mail-mta/nullmailer in /var/lib/portage/world, I think the
problem would be more serious and "emerge --depclean" would half of
the time be thinking that mail-mta/nullmailer should be removed.

It is not clear to me that this problem can be easily fixed within the
current framework.  How is emerge supposed to know which of two
packages providing virtual/xyz is the one that is really needed?
Perhaps it should simply be conservative and assume that all packages
providing virtual/xyz might really be needed?  Of course this defeats
the goal of "emerge --depclean" which is to remove obsolete cruft, but
perhaps this case is simply too complicated to safely handle by
automated means.

Even if it is not obvious how to fix this now, I think this bug report
could be useful input to anyone considering a redesign of the idea of
"emerge --depclean".

Despite involving both ssmtp and mailbase, I am pretty sure this is
_not_ a duplicate of bug 9941 and/or bug 9779.
Comment 1 Joe Wells 2006-06-09 05:10:30 UTC
Created attachment 88760 [details]
Output of "emerge -info" on my system.
Comment 2 Zac Medico gentoo-dev 2006-07-15 09:26:48 UTC
*** Bug 139877 has been marked as a duplicate of this bug. ***
Comment 3 Zac Medico gentoo-dev 2006-07-25 23:41:48 UTC
(In reply to comment #0)
> Perhaps it should simply be conservative and assume that all packages
> providing virtual/xyz might really be needed?

That's what I've done in svn r3986 and it's available in >=portage-2.1.1_pre3-r4.
Comment 4 Zac Medico gentoo-dev 2006-10-10 13:56:21 UTC
*** Bug 150716 has been marked as a duplicate of this bug. ***
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2006-10-14 18:05:48 UTC
*** Bug 151403 has been marked as a duplicate of this bug. ***
Comment 6 Zac Medico gentoo-dev 2007-07-04 03:28:56 UTC
(In reply to comment #3)
> (In reply to comment #0)
> > Perhaps it should simply be conservative and assume that all packages
> > providing virtual/xyz might really be needed?
> 
> That's what I've done in svn r3986 and it's available in
> >=portage-2.1.1_pre3-r4.

Apparently I reverted that change a while back.  I think the best solution for this bug is to simply add anything you want to keep to the world file.  I don't see any reason for depclean to be conservative with virtuals or even || (  ) dependencies for that matter.  The world file seems like an ideal way to declare the packages that you never want to have removed by depclean.  The packages that depclean removes are the same ones that `emerge --deep world` won't update.  Either unmerge them or add them to world and the problem is solved.