Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
app-portage/eix ... usage, examples, etc
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 4324

PostPosted: Fri Mar 04, 2016 4:28 pm    Post subject: app-portage/eix ... usage, examples, etc Reply with quote

This thread is intended as a dumping ground for app-portage/eix usage, examples, tips ... as per the request in Help!! Good blog/guide to Gentoo tools? eix, qlist, etc.??

List all installed packages that are ~arch keyworded
Code:
# eix --only-names --installed-unstable

List all packages installed from the 'foo' overlay
Code:
# eix --only-names --installed-from-overlay foo

List all packages installed with USE="ssl"
Code:
# eix --only-names --installed-with-use ssl

List the currently installed version of 'firefox'
Code:
# eix --format '<installedversions:NAMEVERSION>' firefox

Show a 'compact' listing for the package 'zsh' (-e, 'exact' is used so that the pattern doesn't match other packages, like 'app-shells/zsh-completions', that includes the string 'zsh')
Code:
# eix -ec zsh

Show all installed packages
Code:
# EIX_LIMIT_COMPACT=0 eix -Ic --only-names

Show all installed packages, ordered by, and including, install date
Code:
# eix-installed-after -de0

best ... khay
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 4324

PostPosted: Fri Mar 04, 2016 5:07 pm    Post subject: Reply with quote

Have 'eix-sync' also 'sync' the overlays defined in repos-conf/* (so, layman installed overlays, etc) and so all repos are updated. This means you need only call 'eix-sync' rather than 'emerge --sync && layman -s', etc.

/etc/eix-sync.conf:
*

You can also have it run 'egencache' and update 'metadata' for these overlays ...

/etc/eix-sync.conf:
@StatusInfo 'Updating metadata for foo overlay'
@egencache --repo=foo-overlay --update --update-use-local-desc

Note that 'eix-sync' will run 'eix-update' and 'eix-diff' along with sync'ing the repos ... so the eix database is updated, and a 'diff' is provided of the tree.

best ... khay
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 4324

PostPosted: Fri Mar 04, 2016 10:13 pm    Post subject: Reply with quote

Find 'obsolete' (or, rather, redundant) package.{use,{un,}mask,accept_keywords} entries:

Code:
# eix-test-obsolete

best ... khay
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 4324

PostPosted: Sat Mar 05, 2016 1:32 pm    Post subject: Reply with quote

Find all 'bin' packages (this was initially posted in Finding binary packages?)

Code:
# EIX_LIMIT=0 eix */*-bin

You could similarly use a wildcard to match other partial strings, ie app-vim/*-syntax, or to list all packages in a category, ie 'www-client/*', or 'app-vim/*'.

best ... khay
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 4324

PostPosted: Sat Mar 05, 2016 1:40 pm    Post subject: Reply with quote

Similar to the above 'installed-with-use' example there is also 'installed-without-use'. This can be used to find all packages with a useflag disabled, eg:

Code:
# eix --only-names --installed-without-use gnutls

best ... khay
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 4324

PostPosted: Sat Mar 05, 2016 1:56 pm    Post subject: Reply with quote

Query portage variables, like PORTDIR, PORTDIR_OVERLAY, DISTDIR, ACCEPT_KEYWORDS, etc. Somewhat easier to remember than 'portageq get_repo_path $(portageq envvar EROOT) gentoo', or running 'emerge --info' for, say, getting USE.

Show PORTDIR
Code:
# eix --print PORTDIR

Show useflags
Code:
# eix --print USE

List all locations/paths for repo's
Code:
# for i in PORTDIR{,_OVERLAY} ; do eix --print $i ; done

best ... khay
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1300
Location: Netherlands

PostPosted: Tue Mar 08, 2016 12:03 pm    Post subject: Reply with quote

WOW this is very useful indeed!!!
Thanks a lot khayyam :)
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 4324

PostPosted: Tue Mar 08, 2016 12:20 pm    Post subject: Reply with quote

swimmer wrote:
WOW this is very useful indeed!!! Thanks a lot khayyam :)

swimmer ... finally, someone commented ;) You're welcome, more to follow.

best ... khay
Back to top
View user's profile Send private message
Tony0945
Veteran
Veteran


Joined: 25 Jul 2006
Posts: 1077

PostPosted: Tue Mar 08, 2016 1:37 pm    Post subject: Reply with quote

khayyam wrote:
Have 'eix-sync' also 'sync' the overlays defined in repos-conf/* (so, layman installed overlays, etc) and so all repos are updated. This means you need only call 'eix-sync' rather than 'emerge --sync && layman -s', etc.

/etc/eix-sync.conf:
*

You can also have it run 'egencache' and update 'metadata' for these overlays ...

/etc/eix-sync.conf:
@StatusInfo 'Updating metadata for foo overlay'
@egencache --repo=foo-overlay --update --update-use-local-desc

Note that 'eix-sync' will run 'eix-update' and 'eix-diff' along with sync'ing the repos ... so the eix database is updated, and a 'diff' is provided of the tree.

best ... khay


I was going to post a question about how to do this! Many thanks, khay! And many thanks for your tireless work here.
Back to top
View user's profile Send private message
Yamakuzure
Veteran
Veteran


Joined: 21 Jun 2006
Posts: 1884
Location: Bardowick, Germany

PostPosted: Tue Mar 08, 2016 2:03 pm    Post subject: Reply with quote

Good list!

The eix-installed-after script might be helpful, too, like doing
Code:
eix-installed-after -b sys-devel/gcc-5.3.0
which actually shows everything that was installed *before* gcc-5.3.0.
_________________
systemd - The biggest fallacies
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 5262

PostPosted: Tue Mar 08, 2016 6:23 pm    Post subject: Reply with quote

Yamakuzure wrote:
The eix-installed-after script might be helpful, too

I already posted this on another place, but the main purpose of the eix-installed-after script is to serve as an example: It is relatively exhaustively commented so that hopefully it is useful for many who want to use eix for a non-trivial task.
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 4324

PostPosted: Tue Mar 08, 2016 9:08 pm    Post subject: Reply with quote

Yamakuzure wrote:
The eix-installed-after script might be helpful, too, like doing

Code:
eix-installed-after -b sys-devel/gcc-5.3.0

which actually shows everything that was installed *before* gcc-5.3.0.

Yamakuzure ... hmmm, I must be living in some alternate time dimension ;)

Code:
# eix-installed-after -b sys-devel/gcc-4.9.0 | tail -n 1
media-libs/harfbuzz
# qlop -lC | tail -n 1
Mon Mar  7 14:05:30 2016 >>> media-libs/harfbuzz-1.1.3

... so, that is not "before", however, stranger still, if I provide category/package (sans 'version') then, I get something altogether different ... but still not "before".

Code:
# eix-installed-after -b sys-devel/gcc | tail -n 1
x11-wm/i3
# eix-installed-after -b sys-devel/gcc | head -n 1
sys-apps/findutils
# qlop -lC | grep -B1 sys-devel/gcc
Tue Feb 19 11:15:49 2013 >>> dev-libs/mpc-1.0.1
Tue Feb 19 12:25:28 2013 >>> sys-devel/gcc-4.6.3
--
Sat Sep 14 14:43:10 2013 >>> net-libs/libssh-0.5.5
Sat Sep 14 21:31:28 2013 >>> sys-devel/gcc-4.6.3
--
Sun Oct  6 14:54:25 2013 >>> sys-apps/groff-1.22.2
Mon Oct  7 22:44:29 2013 >>> sys-devel/gcc-4.7.3-r1
--
Sun Jan 26 14:38:32 2014 >>> media-video/mpv-9999
Tue Jan 28 04:09:27 2014 >>> sys-devel/gcc-4.7.3-r1
--
Fri Oct 31 12:48:27 2014 >>> sys-devel/crossdev-20140917
Mon Nov  3 16:27:10 2014 >>> sys-devel/gcc-4.8.3
--
Sat Apr 18 12:05:19 2015 >>> sys-apps/pv-1.6.0
Sat Apr 18 14:11:05 2015 >>> sys-devel/gcc-4.8.4
--
Sun Sep 20 16:35:01 2015 >>> sys-devel/binutils-2.25.1-r1
Sun Sep 20 21:25:20 2015 >>> sys-devel/gcc-4.8.5
--
Tue Oct  6 10:56:40 2015 >>> net-wireless/wpa_supplicant-2.5
Tue Oct  6 20:47:43 2015 >>> sys-devel/gcc-4.9.3

Unless I misunderstand the terms 'before', and 'after', then I'm not sure what 'eix-installed-after' is doing. Also, if the script can output both 'before' and 'after' it should be called 'eix-installed-order', or in my case 'eix-installed-timewarp' ;) That is one of the frustrating things about eix, its a really useful tool but the way it works, or is expected to work, often leaves me with more questions than answers.

best ... khay
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 5262

PostPosted: Wed Mar 09, 2016 8:43 am    Post subject: Reply with quote

khayyam wrote:
Yamakuzure wrote:
The eix-installed-after script might be helpful, too, like doing

Code:
eix-installed-after -b sys-devel/gcc-5.3.0

which actually shows everything that was installed *before* gcc-5.3.0.

Yamakuzure ... hmmm, I must be living in some alternate time dimension ;)

Yes, I didn't realize: Either you must specify option -v in addition or use the syntax
Code:
eix-installed-after -b sys-devel/gcc:5.3

Quote:
Also, if the script can output both 'before' and 'after' it should be called 'eix-installed-order

Maybe, but this would hide the "default" mode of output (which I considered the most useful one, because it sometimes happens that you installed a "bad" package causing possible breakage for subsequently installed packages - so you can easily list them).

You get your "eix-installed-ordered" behaviour with option -f.

What the script actually does is simply to output all packages ordered according to install date, but to start (or with option -b: stop) this list only when the output matches the argument.
With other options (like -l -e or -F) you can check for the timestamp instead of the output text (hence avoiding the "problem" that the argument must match the output format).

Quote:
That is one of the frustrating things about eix

You are welcome to submit patches (or if you cannot do it suggestions for improvement).
(And in contrast to some systemd developers, I really mean this - there is really not much feedback to eix.)
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 4324

PostPosted: Wed Mar 09, 2016 7:58 pm    Post subject: Reply with quote

mv wrote:
[...] Either you must specify option -v in addition or use the syntax
Code:
eix-installed-after -b sys-devel/gcc:5.3

mv ... what I didn't say above is that I'd tried various designators, including the slot, and these also don't provide 'before':

Code:
# eix-installed-after -b sys-devel/gcc:4.9 | awk 'NR==1; END{print}'
sys-apps/findutils
x11-wm/i3
# qlop -Cl | grep -B1 sys-devel/gcc-4.9
Tue Oct  6 10:56:40 2015 >>> net-wireless/wpa_supplicant-2.5
Tue Oct  6 20:47:43 2015 >>> sys-devel/gcc-4.9.3

... and as you can see in the above 'qlop -Cl' output wpa_supplicant was installed 'before' gcc:4.9.

mv wrote:
khayyam wrote:
Also, if the script can output both 'before' and 'after' it should be called 'eix-installed-order

Maybe, but this would hide the "default" mode of output [...]

I don't see why 'installed-order' hides anything, in fact, its more explanatory. Also, you could still default to 'after'.

mv wrote:
khayyam wrote:
That is one of the frustrating things about eix

You are welcome to submit patches (or if you cannot do it suggestions for improvement). (And in contrast to some systemd developers, I really mean this - there is really not much feedback to eix.)

I don't doubt your sincerity ITR, the problem is I wouldn't know where to start, I find a lot of the man page completely opaque, and difficult to get to grips with, and I'm generally fairly good with such things. So, I've never really got a sufficient grasp so as to be in the position of looking and specific things which might be improved ... a veritable chicken & egg problem. That is in no way a discredit to the work you put in, its just as I see it, eix just seems over-engineered, and over-burdened in terms of syntax. That's partly the result of the complexity, or over-complexity, of portage, but it does make it less of a go-to tool. I'd imagine the great majority of people who use it are simply using as a replacement for 'emerge --search'. Anyhow, here is probably not the best place for such a discussion, this is a tips and examples thread, so probably enough said.

best ... khay
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 5262

PostPosted: Fri Mar 11, 2016 5:11 pm    Post subject: Reply with quote

khayyam wrote:
mv wrote:
[...] Either you must specify option -v in addition or use the syntax
Code:
eix-installed-after -b sys-devel/gcc:5.3

mv ... what I didn't say above is that I'd tried various designators, including the slot

I had previously posted only from my memory - I had no gentoo machine accessible. Now I checked, and it seems what I posted was correct with 2 inaccuracies:
1. The slot sys-devel/gcc:5.3 does not exist. It should be e.g. sys-devel/gcc:5
2. The output format plays no role (the script is more clever than I remembered); when you want to specify the format sys-devel/gcc-5.3.0 you can use the option -V
Quote:
# qlop -Cl | grep -B1 sys-devel/gcc-4.9
Tue Oct 6 10:56:40 2015 >>> net-wireless/wpa_supplicant-2.5
Tue Oct 6 20:47:43 2015 >>> sys-devel/gcc-4.9.3

Maybe there is a misunderstanding what is meant by the "emerge time" of a package: It means the (latest) build time of the installed package (stored in BUILD_TIME in /var/db/pkg).
(If you should have set the eix variables USE_BUILD_TIME to false, it is the mtime-timestamp of the corresponding /var/db/pkg directory - which is usually roughly the same).
In your case, you have perhaps emerged wpa_supplicant later on again, so that the above time stored in emerge.log has become irrelevant.
(There might also be other reasons, e.g. if you installed from a prebuilt binary package.)
Quote:
I'd imagine the great majority of people who use it are simply using as a replacement for 'emerge --search'.

Or to check which versions are available/masked/installed. I also use it for this mainly. Only in very rare cases, some script can really profit from the other features. But these cases happen occasionally.

About renaming eix-installed-after: Maybe you are right that the name was chosen unfortunate. However, I am hesitating to rename it now when perhaps some users have scripts referring to that name. And using symlinks (two names) would only increase confusion.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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