[gentoo-user] Re: Rebuilding all dependants of a package

2018-02-20 Thread Holger Hoffstätte
On Tue, 20 Feb 2018 22:55:45 +, Neil Bothwick wrote:

> On Tue, 20 Feb 2018 21:29:42 + (UTC), Holger Hoffstätte wrote:
> 
>> > That was useful and saved me the time to sed & grep my way through the
>> > equery output. Turning this into a generic script is easy enough.  
>> 
>> For the peanut gallery..
>> 
>> Turns out it's not so clear-cut since equery d finds *all possible*
>> dependants, including those for unset USE flags.
>> 
>> Oh well..depclan & grep here we go..
>> 
> What's wrong with qdepends, which has an option to query reverse
> dependencies and uses the installed package databas for its information
> so it correctly considers USE flags?
> 
> qdepends is part f portage-utils, which you should have installed already.

Interesting! It seems there is nothing wrong with it other than the
fact that I didn't know about it, so thanks for the pointer!
qdepends -Q does indeed seem to do the same thing as my own script,
which of course I finished just 5 minutes ago. :)
It's also a lot faster than --depclean munging since it seems to
simply grep through the DEPEND/USE variables in one go. Nice!

Thanks!
Holger




Re: [gentoo-user] Re: Rebuilding all dependants of a package

2018-02-20 Thread Neil Bothwick
On Tue, 20 Feb 2018 21:29:42 + (UTC), Holger Hoffstätte wrote:

> > That was useful and saved me the time to sed & grep my way through the
> > equery output. Turning this into a generic script is easy enough.  
> 
> For the peanut gallery..
> 
> Turns out it's not so clear-cut since equery d finds *all possible*
> dependants, including those for unset USE flags.
> 
> Oh well..depclan & grep here we go..
> 
What's wrong with qdepends, which has an option to query reverse
dependencies and uses the installed package databas for its information
so it correctly considers USE flags?

qdepends is part f portage-utils, which you should have installed already.


-- 
Neil Bothwick

 Ralph's Observation - It is a mistake to allow any mechanical
 object to realize that you are in a hurry.


pgpk8UDhRIhKz.pgp
Description: OpenPGP digital signature


[gentoo-user] Re: Rebuilding all dependants of a package

2018-02-20 Thread Holger Hoffstätte
On Tue, 20 Feb 2018 09:56:15 +, Holger Hoffstätte wrote:

> On Mon, 19 Feb 2018 15:29:52 +0100, Branko Grubic wrote:
> 
>> On Mon, 19 Feb 2018 12:55:08 + (UTC)
>> Holger Hoffstätte  wrote:
>> 
>>> Hey,
>>> 
>>> I'm not exactly new to portage, but one thing that I cannot seem to
>>> figure out is how to rebuild all dependants of a package. Not
>>> *dependencies*, dependants: packages that require said package.
>>> 
>>> As a recent example: whenever go (the language) is updated to a new
>>> version (say from 1.9 to 1.10, as it happended recently), I'd like to
>>> rebuild docker & friends - or more specifically 'things that are
>>> compiled with go'.
>>> 
>>> The --changed-deps option doesn't seem to do the trick, so instead I
>>> manually do a -vp --depclean on go and manually --oneshot all
>>> installed packages that have their hands on it. This is obviously
>>> stupid and error-prone.
>>> 
>>> Am I missing something or is this really not easily possible?
>>> Basically I'm looking for a hard --oneshot --revdep-rebuild with a
>>> package argument.
>>> 
>>> thanks,
>>> Holger
>>> 
>>> 
>> 
>> I never needed this, so I don't know how to do it directly with emerge
>> (is it possible?), but you can use equery like this to get a list:
>> 
>> equery -q d dev-lang/go
>> 
>> -q/--quiet (minimal output)
>> (d)epends (list all packages directly depending on ATOM)
>> 
>> to get a list of packages installed which depend on dev-lang/go
>> you can filter versions out of it and feed that to 'emerge -av1'.
>> 
>> Or if you trust this ugly one-liner without filtering (probably ugliest
>> thing, but seems to do the job):
>> 
>> emerge -av1 $(for i in $(equery -q d sys-apps/util-linux); do echo
>> "=$i"; done)
> 
> That was useful and saved me the time to sed & grep my way through the
> equery output. Turning this into a generic script is easy enough.

For the peanut gallery..

Turns out it's not so clear-cut since equery d finds *all possible*
dependants, including those for unset USE flags.

Oh well..depclan & grep here we go..

-h




[gentoo-user] Re: Rebuilding all dependants of a package

2018-02-20 Thread Holger Hoffstätte
On Mon, 19 Feb 2018 17:05:03 +0200, Alan McKinnon wrote:

> On 19/02/2018 14:55, Holger Hoffstätte wrote:
>> Hey,
>> 
>> I'm not exactly new to portage, but one thing that I cannot seem to figure
>> out is how to rebuild all dependants of a package. Not *dependencies*,
>> dependants: packages that require said package.
>> 
>> As a recent example: whenever go (the language) is updated to a new version
>> (say from 1.9 to 1.10, as it happended recently), I'd like to rebuild docker
>> & friends - or more specifically 'things that are compiled with go'.
>> 
>> The --changed-deps option doesn't seem to do the trick, so instead I manually
>> do a -vp --depclean on go and manually --oneshot all installed packages that
>> have their hands on it. This is obviously stupid and error-prone.
>> 
>> Am I missing something or is this really not easily possible?
>> Basically I'm looking for a hard --oneshot --revdep-rebuild with a package
>> argument.
> 
> 
> There isn't really a one-shot way to do this easily. Ebuilds do not 
> contain dependants, they contain dependencies and that is a one-way 
> arrow. So you end up having to walk the tree to get the information you 
> are after.

There are numerous cases where portage/equery already do that and
perform the equivalent of a grep throug the entire tree.

> I have to question though why you think you need to do this. If you want

Because of static linking. In this case go embeds the runtime (esp.
the gc) into executables, so the only way to get improvements into
existing binaries is to rebuild. Neither subslots nor changed-deps do
this, esp. not on demand.
 
I can think of numerous opther cases where this is necessary (mostly
related to C++ and/or static linking) but really don't have the time
or patience right now.

cheers
Holger




[gentoo-user] Re: Rebuilding all dependants of a package

2018-02-20 Thread Holger Hoffstätte
On Mon, 19 Feb 2018 15:29:52 +0100, Branko Grubic wrote:

> On Mon, 19 Feb 2018 12:55:08 + (UTC)
> Holger Hoffstätte  wrote:
> 
>> Hey,
>> 
>> I'm not exactly new to portage, but one thing that I cannot seem to
>> figure out is how to rebuild all dependants of a package. Not
>> *dependencies*, dependants: packages that require said package.
>> 
>> As a recent example: whenever go (the language) is updated to a new
>> version (say from 1.9 to 1.10, as it happended recently), I'd like to
>> rebuild docker & friends - or more specifically 'things that are
>> compiled with go'.
>> 
>> The --changed-deps option doesn't seem to do the trick, so instead I
>> manually do a -vp --depclean on go and manually --oneshot all
>> installed packages that have their hands on it. This is obviously
>> stupid and error-prone.
>> 
>> Am I missing something or is this really not easily possible?
>> Basically I'm looking for a hard --oneshot --revdep-rebuild with a
>> package argument.
>> 
>> thanks,
>> Holger
>> 
>> 
> 
> I never needed this, so I don't know how to do it directly with emerge
> (is it possible?), but you can use equery like this to get a list:
> 
> equery -q d dev-lang/go
> 
> -q/--quiet (minimal output)
> (d)epends (list all packages directly depending on ATOM)
> 
> to get a list of packages installed which depend on dev-lang/go
> you can filter versions out of it and feed that to 'emerge -av1'.
> 
> Or if you trust this ugly one-liner without filtering (probably ugliest
> thing, but seems to do the job):
> 
> emerge -av1 $(for i in $(equery -q d sys-apps/util-linux); do echo
> "=$i"; done)

That was useful and saved me the time to sed & grep my way through the
equery output. Turning this into a generic script is easy enough.

Thank you very much!

cheers
Holger