1 |
Alan McKinnon schrieb am 09.11.2008 07:13: |
2 |
> On Sunday 09 November 2008 06:04:02 Dale wrote: |
3 |
>> meino.cramer@×××.de wrote: |
4 |
>>> Hi, |
5 |
>>> |
6 |
>>> is there a way to list the package, which depend on |
7 |
>>> a given (known) package (in my case a library)? |
8 |
>>> |
9 |
>>> Kind regards, |
10 |
>>> Meino Cramer |
11 |
>> If I understand correctly, equery depends <package name> . That's if I |
12 |
>> understand correctly. If you don't have it, emerge gentoolkit. |
13 |
> |
14 |
> Just be aware that equery depends is somewhat broken |
15 |
> |
16 |
> It lists dependencies in the tree, not dependencies a specific machine is |
17 |
> using. Plus it doesn't find some valid deps either. |
18 |
> |
19 |
> It's still useful, but the user also has to use eix to determine which deps |
20 |
> are valid for them and which are not. |
21 |
> |
22 |
|
23 |
There is a possibility to get the reverse dependencies, but it seems |
24 |
almost nobody is aware of this because this function of portage is |
25 |
mostly used for cleaning up unneeded packages. But in order to remove |
26 |
unneeded packages portage has to know the reverse dependencies of each |
27 |
package to determine if it is unneeded. |
28 |
|
29 |
emerge -pv --depclean atom |
30 |
|
31 |
Always consider that equery and depclean only work on packages that are |
32 |
installed on the system and not for packages that are not. |
33 |
Gentoo-Portage [1] can list the reverse dependencies for packages that |
34 |
are not installed. |
35 |
|
36 |
|
37 |
|
38 |
Note the output of equery is sometimes wrong. To test this let us |
39 |
compare the output of the "emerge -pv depclean atom" with "equery |
40 |
depends atom". For example we want to check the reverse dependencies of |
41 |
x11-libs/gtk+ on my system. |
42 |
|
43 |
It is almost identical besides 1) media-video/mplayer and 2) |
44 |
sys-devel/gcc are listed only in equery and 3) net-www/gnash is only |
45 |
listed in depclean output. |
46 |
|
47 |
1) So why is mplayer listed in equery. The gtk use flag is globally on |
48 |
on my system but I have disabled gtk in package.use so equery is wrong here. |
49 |
|
50 |
2) Now for gcc I have no entry in package.use that disables it so it |
51 |
seems at the first glance equery is right. Lets take a look at the |
52 |
ebuild itself. The following is from the RDEPEND section. |
53 |
|
54 |
!build? ( |
55 |
gcj? ( |
56 |
gtk? ( |
57 |
x11-libs/libXt |
58 |
x11-libs/libX11 |
59 |
x11-libs/libXtst |
60 |
x11-proto/xproto |
61 |
x11-proto/xextproto |
62 |
>=x11-libs/gtk+-2.2 |
63 |
x11-libs/pango |
64 |
) |
65 |
|
66 |
To explain this, it says if the build flag is disabled and gcj and gtk |
67 |
are enabled it will depend on the the packages listed below gtk. I have |
68 |
build and gcj disabled but gtk enabled, so it does not fulfill the |
69 |
conditions needed for a gtk dependency and equery is wrong again. |
70 |
|
71 |
3) Now finally why does depclean list gnash and equery not. The gtk flag |
72 |
is enabled for the ebuild and the dependency list in the ebuild clearly |
73 |
shows: |
74 |
|
75 |
gtk? ( |
76 |
>x11-libs/gtk+-2 |
77 |
x11-libs/pango |
78 |
dev-libs/glib |
79 |
dev-libs/atk |
80 |
) |
81 |
|
82 |
I guess equery gets confused by the following construct in the ebuild |
83 |
which looks similar to the gcc case: |
84 |
|
85 |
!gtk? ( !kde? ( !qt3? ( !sdl? ( ( !fbcon? ( |
86 |
>x11-libs/gtk+-2 |
87 |
x11-libs/pango |
88 |
dev-libs/glib |
89 |
dev-libs/atk |
90 |
=kde-base/kdelibs-3.5* |
91 |
) ) ) ) ) ) |
92 |
|
93 |
This conditions doesn't match on my system so equery does not list |
94 |
gnash. In addition I think such conditions may cause some |
95 |
misunderstanding as they mean if gtk kde qt3 sdl and fbcon are all unset |
96 |
it should depend on gtk and kde which would be rather confusing for the |
97 |
user if he has this flags unset. |
98 |
|
99 |
|
100 |
|
101 |
[1] http://www.gentoo-portage.com/x11-libs/gtk+/RDep#ptabs |
102 |
|
103 |
Regards, |
104 |
|
105 |
Daniel |