Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
USE flag dependencies and reverse dependencies
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
lordoftheworld
n00b
n00b


Joined: 16 Jun 2004
Posts: 10

PostPosted: Wed Apr 11, 2018 8:13 pm    Post subject: USE flag dependencies and reverse dependencies Reply with quote

I'm looking for a way to determine USE flag dependencies and reverse dependencies on other packages and their USE flags. Portage lets you know one at a time, if there is a conflict. I'd like to know any effects on installed packages anytime I change a global or package USE flag.

Is there an open issue/feature request for this?
Back to top
View user's profile Send private message
arnvidr
Guru
Guru


Joined: 19 Aug 2004
Posts: 589
Location: Oslo, Norway

PostPosted: Fri Apr 13, 2018 7:51 am    Post subject: Reply with quote

You can check which of your installed packages has or has not a particular USE flag set, for instance to check your packages for the 'perl' flag:
Code:
USE="perl"; for PKG in $(equery -q hasuse $USE); do echo $PKG: $(equery -q uses $PKG |grep $USE); done


I am not aware of any 'easy solution' to what I think you're asking for, except running emerge -Up @world or similar.
_________________
Noone wrote:
anything
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6965

PostPosted: Fri Apr 13, 2018 10:17 am    Post subject: Reply with quote

isn't that just easier to not guess and analyse what will happen but instead just ask portage what will happen?
if you want see what impact a useflag will have on your system, you can run portage with the useflag set on/off and see what portage is saying about it no?
i'm not sure i'm clear, so here's an example to see how a use flag change would affect the system
Code:
USE="-ssl" emerge -uDN world -pv
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Fri Apr 13, 2018 10:59 am    Post subject: Reply with quote

arnvidr wrote:
Code:
USE="perl"; for PKG in $(equery -q hasuse $USE); do echo $PKG: $(equery -q uses $PKG |grep $USE); done

arnvidr ... if you're doing that then you should probably think about using the following:

Code:
% eix --only-names --exact --installed-with-use perl

@lordoftheworld ... in addition to what krinn pointed out you might also add '--tree,-t'.

best ... khay
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Fri Apr 13, 2018 11:12 am    Post subject: Reply with quote

A USE flag allows to enable an internal feature or add a dependency of a software. Some utilities provide USE flags descriptions and dependencies.

I'm not sure if you wonder whether a software/package has a USE flag enabled (mandatory) because it is a dependency of an installed software/package.

Code:
user $ emerge -Upv -t --unordered-display @world
user $ #emerge -Upq -t --unordered-display @world


Edit: I do not understand implied mechanisms but I lack of knowledge. I looked at this old article: https://www.linux.com/news/best-practices-autotools
The developer manual tells about "intrinsic USE dependencies" or "Built with USE dependencies" in relation to "conflicting USE flag".

Edit: revision.
Back to top
View user's profile Send private message
lordoftheworld
n00b
n00b


Joined: 16 Jun 2004
Posts: 10

PostPosted: Sun Apr 15, 2018 1:46 am    Post subject: Reply with quote

Thanks for all the replies. I usually do what @krinn said, just let portage tell me, and this works in most cases (for global and package specific USE flag changes), but when there are conflicts, or when I'm trying to decide whether I should turn a USE flag on or off, I wish portage would give me more fine grained information as much as the fine grained control it's giving me.

Two things I would like are:
1) When a dependency is being pulled in because of a USE flag. Even with -t, this information isn't there I think.
2) When I change required USE flags, portage lets you know one at a time why it's required. For the subset of my installed packages, I'd like to know any dependencies on the USE flag.

For example, if I try to globally remove the fortran USE flag, I'd like to know that I'll also have to turn off the filter USE flag on the gnuradio package (just checking for installed packages with same USE flags doesn't work for this). To some extent, I'm really asking for a wrapper around changing USE flags that could tell you about these changes. ie. 'equery use -d/a <package name> <use flag>'. Out of equery uses, quse and eix, I haven't played around with eix much, but it might be possible to do what I want with eix if I looked at it more.
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Sun Apr 15, 2018 8:12 am    Post subject: Reply with quote

The default configuration must be functional. An administrator may use global USE flags for an automatic (systematic) configuration.
The @world set only include explicitly required softwares (without the dependencies). A random package may have USE flags.

Consistency is enough to know how to proceed with USE flags (see: USE flags).
Back to top
View user's profile Send private message
arnvidr
Guru
Guru


Joined: 19 Aug 2004
Posts: 589
Location: Oslo, Norway

PostPosted: Sun Apr 15, 2018 11:40 am    Post subject: Reply with quote

khayyam wrote:
arnvidr wrote:
Code:
USE="perl"; for PKG in $(equery -q hasuse $USE); do echo $PKG: $(equery -q uses $PKG |grep $USE); done

arnvidr ... if you're doing that then you should probably think about using the following:

Code:
% eix --only-names --exact --installed-with-use perl
Yeah, could probably make a faster version with the installed-with/without parameters to eix, but my example was just copied straight from the equery man page :)
_________________
Noone wrote:
anything
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Sun Apr 15, 2018 12:45 pm    Post subject: Reply with quote

Nobody noticed anything but I said something stupid.

Code:
user $ emerge -Upv -t --unordered-display @world
user $ #emerge -Upq -t --unordered-display @world


The above command is wrong.
Back to top
View user's profile Send private message
lordoftheworld
n00b
n00b


Joined: 16 Jun 2004
Posts: 10

PostPosted: Mon Apr 16, 2018 2:02 am    Post subject: Reply with quote

So I didn't know about euse. euse -p and -E/D/R lets you change package/global USE flags and enable/disable/remove them. euse -i spits out some information, though I don't know if it's USE flag dependency information. gentoolkit, q, eix and portage caches might or might not have USE flag dependency information, it's not obvious that they do.

@Mr. T... so how would an admin do the two things I'm asking?
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Mon Apr 16, 2018 6:52 am    Post subject: Reply with quote

@lordoftheworld: an administrator enables the features wisely before installing software and USE flags changes are done by the package manager.
You try to solve the problem in reverse order: remove dependencies disabling USE flags rather than enable USE flags to "add" (support) features.

Note: I think there is a confusion about USE flags: a global (a.k.a general) USE flag may be enabled per package too :arrow: /etc/portage/package.use.
Back to top
View user's profile Send private message
lordoftheworld
n00b
n00b


Joined: 16 Jun 2004
Posts: 10

PostPosted: Mon Apr 16, 2018 7:47 am    Post subject: Reply with quote

@Mr. T you'll excuse me while I try to find a tool that solves the problem I've pretty clearly laid out.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13498

PostPosted: Wed Apr 18, 2018 1:56 am    Post subject: Reply with quote

Various posts from Mr. T. and responses to those posts have been moved to Gentoo Chat as action-adventure/A-Team[USE dependencies].
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum