Gentoo Archives: gentoo-user

From: "Holger Hoffstätte" <holger@××××××××××××××××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Rebuilding all dependants of a package
Date: Tue, 20 Feb 2018 21:32:07
Message-Id: pan$15c20$850a708f$d77b816$da0af338@applied-asynchrony.com
In Reply to: [gentoo-user] Re: Rebuilding all dependants of a package by "Holger Hoffstätte"
1 On Tue, 20 Feb 2018 09:56:15 +0000, Holger Hoffstätte wrote:
2
3 > On Mon, 19 Feb 2018 15:29:52 +0100, Branko Grubic wrote:
4 >
5 >> On Mon, 19 Feb 2018 12:55:08 +0000 (UTC)
6 >> Holger Hoffstätte <holger@××××××××××××××××××.com> wrote:
7 >>
8 >>> Hey,
9 >>>
10 >>> I'm not exactly new to portage, but one thing that I cannot seem to
11 >>> figure out is how to rebuild all dependants of a package. Not
12 >>> *dependencies*, dependants: packages that require said package.
13 >>>
14 >>> As a recent example: whenever go (the language) is updated to a new
15 >>> version (say from 1.9 to 1.10, as it happended recently), I'd like to
16 >>> rebuild docker & friends - or more specifically 'things that are
17 >>> compiled with go'.
18 >>>
19 >>> The --changed-deps option doesn't seem to do the trick, so instead I
20 >>> manually do a -vp --depclean on go and manually --oneshot all
21 >>> installed packages that have their hands on it. This is obviously
22 >>> stupid and error-prone.
23 >>>
24 >>> Am I missing something or is this really not easily possible?
25 >>> Basically I'm looking for a hard --oneshot --revdep-rebuild with a
26 >>> package argument.
27 >>>
28 >>> thanks,
29 >>> Holger
30 >>>
31 >>>
32 >>
33 >> I never needed this, so I don't know how to do it directly with emerge
34 >> (is it possible?), but you can use equery like this to get a list:
35 >>
36 >> equery -q d dev-lang/go
37 >>
38 >> -q/--quiet (minimal output)
39 >> (d)epends (list all packages directly depending on ATOM)
40 >>
41 >> to get a list of packages installed which depend on dev-lang/go
42 >> you can filter versions out of it and feed that to 'emerge -av1'.
43 >>
44 >> Or if you trust this ugly one-liner without filtering (probably ugliest
45 >> thing, but seems to do the job):
46 >>
47 >> emerge -av1 $(for i in $(equery -q d sys-apps/util-linux); do echo
48 >> "=$i"; done)
49 >
50 > That was useful and saved me the time to sed & grep my way through the
51 > equery output. Turning this into a generic script is easy enough.
52
53 For the peanut gallery..
54
55 Turns out it's not so clear-cut since equery d finds *all possible*
56 dependants, including those for unset USE flags.
57
58 Oh well..depclan & grep here we go..
59
60 -h

Replies

Subject Author
Re: [gentoo-user] Re: Rebuilding all dependants of a package Neil Bothwick <neil@××××××××××.uk>