Gentoo Archives: gentoo-user

From: Michael Mol <mikemol@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] emerge --update behavior
Date: Mon, 02 Jan 2012 17:08:28
Message-Id: CA+czFiD2xYsPyCnFci_X0abCpq+22R9czfzg4VsP-_C8F-k8sA@mail.gmail.com
In Reply to: Re: [gentoo-user] emerge --update behavior by Michael Orlitzky
1 On Mon, Jan 2, 2012 at 11:33 AM, Michael Orlitzky <michael@××××××××.com> wrote:
2 > On 01/02/2012 11:16 AM, Michael Mol wrote:
3 >>>
4 >>>
5 >>> Fine for your home PC, doesn't cut it on servers. I have the following in
6 >>> one of my world files:
7 >>>
8 >>>  dev-php/PEAR-Mail
9 >>>  dev-php/PEAR-Mail_Mime
10 >>>  dev-php/PEAR-PEAR
11 >>>  dev-php/PEAR-Structures_Graph
12 >>>
13 >>> which of those do I want? At least one of them was installed to support a
14 >>> customer's custom PHP application. Maybe all of them were and they all
15 >>> belong in world. No one knows, this server is older than the current
16 >>> --update behavior.
17 >>>
18 >>> So which ones can I remove?
19 >>>
20 >>> Solutions involving time travel and/or losing customers will be
21 >>> disqualified.
22 >>
23 >>
24 >> Make a backup copy of your world file.
25 >>
26 >> 1a. Remove those four lines.
27 >> 2a. emerge -p --depclean
28 >> 3a. Did any of those show up in the to-be-removed set? Add them back.
29 >>
30 >> Alternately:
31 >> 1b. emerge -pev --tree --with-bdeps=y @world
32 >> 2b Find those packages in the output. The tree form of the display
33 >> will help you see if anything is depending on them.
34 >> 3b. If anything is depending on them, you should be able to safely
35 >> remove them from your world file. I'd follow up with the 1a, 2a, 3a
36 >> solution to be sure.
37 >>
38 >
39 > Sorry, but these won't work.
40 >
41 > Let's say that dev-php/PEAR-Mail_Mime has a dependency on dev-php/PEAR-Mail,
42 > but I have a customer who needs dev-php/PEAR-Mail for a contact form.
43 >
44 > Following your process, I would remove dev-php/PEAR-Mail from my world file.
45 > If I ever remove dev-php/PEAR-Mail_Mime, depclean will remove PEAR-Mail and
46 > break the guy's site.
47
48 That's the purpose of the "emerge -p" step. Presumably, you would see
49 that there's a package in the list that you're not comfortable with
50 removing, you'd decide you didn't want it removed, and you'd add it
51 back to your world set.
52
53 If you're not comfortable removing *any* package that's in your world
54 set, then, no, there's no way to tell the difference. From this point
55 forward, your best bet is to modify EMERGE_DEFAULT_OPTS to reflect the
56 safest practice for your environment. And start keeping a list of
57 packages installed to meet customers' requests. Portage apparently
58 supports your desired workflow, but it needs to be set up for it.
59
60 As to recovering from your current scenario...there might be some way
61 to watch your apache processes to identify which files get used over a
62 three-month span, from that list derive a list of which packages were
63 used, and from *that* list, derive a list of which packages weren't
64 used. (Or make an ebuild explicitly identifying the utilized
65 dependencies, and let depclean handle the rest)
66
67 --
68 :wq

Replies

Subject Author
Re: [gentoo-user] emerge --update behavior Michael Orlitzky <michael@××××××××.com>