Gentoo Archives: gentoo-user

From: "Bo Ørsted Andresen" <bo.andresen@××××.dk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] emerge --depclean wants to remove required packages
Date: Tue, 27 Feb 2007 16:54:01
Message-Id: 200702271745.21439.bo.andresen@zlin.dk
In Reply to: Re: [gentoo-user] emerge --depclean wants to remove required packages by Alan McKinnon
1 On Tuesday 27 February 2007 16:47:15 Alan McKinnon wrote:
2 > > > You have a bunch of packages that --depclean wants to remove. It
3 > > > looks like they should not be removed.
4 > >
5 > > A bit curious how you've reached that conclusion? Why shouldn't they?
6 >
7 > The OP said in his original mail
8 >
9 > "when I run emerge
10 > --depclean wants remove packages that would break dependencies"
11 >
12 > Presumably he knows his system well enough to know that the packages in
13 > question are necessary.
14 >
15 > I probably worded my statement wrongly as well. As written it implies
16 > that --depclean erroneously wants to remove things that should remain
17 > according to information in the ebuilds. I should have said --depclean
18 > wants to remove things that the OP would prefer to remain.
19
20 There are at least three reasons why you cannot rely on `equery depends` to
21 tell you if a dependency which `emerge --depclean` is going to remove is
22 required or not.
23
24 1) USE conditionals. This is adressed in latest ~arch gentoolkit (0.2.3) which
25 prints the conditional. You still have to check the conditional yourself.
26
27 2) "|| ( bar baz )" blocks. `equery depends bar` and `equery depends baz` will
28 print foo as depending on them. portage and hence `emerge --depclean` only
29 requires one of them to satisfy the dep.
30
31 3) If the ebuild exists in the tree and has been modified since it was
32 installed `emerge --depclean` will use the modified ebuild from the tree.
33 `equery depend` will use the ebuild that was installed in /var/db/pkg.
34
35 In most if not all cases when `emerge --depclean` and `equery depends`
36 disagree the former is correct (as of portage-2.1.1 at least (or 2.1?)). If
37 you want to verify it with the latter you need to investigate the ebuild to
38 see if any of the mentioned three cases apply...
39
40 --
41 Bo Andresen