1 |
James schrieb am 25.09.2008 20:32: |
2 |
> Surely many folks would benefit from a formal, systematic approach |
3 |
> to cleaning the world file? I know every now and then, when a gentoo |
4 |
> workstation gives me fits, I just emerge and unemerge things until |
5 |
> it's happy (while multitasking too much). Often this leads to |
6 |
> a polluted world file....... because I do not follow closely to |
7 |
> the process details (distracted) during the repair-episode. |
8 |
> |
9 |
|
10 |
Something in addition to this topic. |
11 |
|
12 |
I asked on IRC (#gentoo-portage) if it is possible to show the reverse |
13 |
dependencies of a package with portage. Zac Medico, one of the main |
14 |
portage developers told me that it is possible with depclean. |
15 |
|
16 |
emerge -pv --depclean <atom> |
17 |
|
18 |
So I thought of writing a little script which calls this command for |
19 |
every entry in the world file. As I have only limited programming skills |
20 |
I wrote something quick in perl. It should be no problem to do it with a |
21 |
shell script or something else too. It simply checks the output of |
22 |
depclean for strings which only occur when the package has or has no |
23 |
reverse dependencies. Then it prints the package to be checked and if it |
24 |
is needed in world or not. It actually does not remove anything, so it |
25 |
is up to you if you want to leave a package in world or not for whatever |
26 |
reason you have. |
27 |
|
28 |
The script could probably be improved in a few ways and it is slow as |
29 |
depclean takes some time. It works for current stable portage. I don't |
30 |
know if it will work for portage-2.2 as the output of depclean has |
31 |
changed as far as I know. |
32 |
|
33 |
Don't rely on this script to much. Because it works for me must not mean |
34 |
it does for you. I have tested some cases and I worked every time until |
35 |
now. So verify the output of a manual "emerge -pv --depclean <atom>" on |
36 |
the "unneeded" entry first to be sure it is really not needed. |
37 |
|
38 |
Regards, |
39 |
|
40 |
Daniel |