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

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
khayyam
Watchman
Watchman


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

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
Watchman
Watchman


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

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
Watchman
Watchman


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

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
Watchman
Watchman


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

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
Watchman
Watchman


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

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
Watchman
Watchman


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

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: 1330
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
Watchman
Watchman


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

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
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

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
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2280
Location: Adendorf, 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.
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

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
Watchman
Watchman


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

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: 6747

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
Watchman
Watchman


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

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: 6747

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
ShadowCat8
Apprentice
Apprentice


Joined: 07 Oct 2008
Posts: 173
Location: San Bernardino, CA, USA

PostPosted: Tue Oct 10, 2017 1:23 am    Post subject: Reply with quote

Greetings khayyam,

And, thanks again for this thread... VERY helpful!
But, now I have a question regarding eix and slotted installs (e.g. python):
When I run the following command:
Code:
NAMEVERSION="<category>/<name>,<version>" eix '-I*' --format '<installedversions:NAMEVERSION>,<licenses>\n'

it looks good until I get to the following:
Code:
...
dev-lang/perl,5.24.1-r2,|| ( Artistic GPL-1+ )
dev-lang/python,2.7.12dev-lang/python,3.4.5dev-lang/python,3.5.3,PSF-2
dev-lang/python-exec,2.4.4,BSD-2
dev-libs/boost,1.62.0-r1,Boost-1.0
...

Is there any way to break out the slotteds each to their own line?

TIA for your assistance.
_________________
________________________

"As far as the laws of mathematics refer to reality, they are not
certain, and as far as they are certain, they do not refer to reality."

-- Albert Einstein
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Tue Oct 10, 2017 6:01 am    Post subject: Reply with quote

ShadowCat8 wrote:
Is there any way to break out the slotteds each to their own line?

Not sure what you mean. Perhaps
Code:
NAMEVERSION='<category>/<name>,<version>,<licenses>\n' eix '-I*' --format '<installedversions:NAMEVERSION>'

Be aware, however, that eix stores only one license per package (that of the latest available version), so the information will not be correct if different slots have different licenses.
Simliar problem happens with other metadata too, e.g. descriptions.
Back to top
View user's profile Send private message
ShadowCat8
Apprentice
Apprentice


Joined: 07 Oct 2008
Posts: 173
Location: San Bernardino, CA, USA

PostPosted: Tue Oct 10, 2017 5:04 pm    Post subject: Reply with quote

@mv: Thanks for the reply.

What I mean is the one line above with dev-lang/python writing all 3 slotted versions to one line... e.g.:
Code:
dev-lang/python,2.7.12dev-lang/python,3.4.5dev-lang/python,3.5.3,PSF-2


And, I already tried your suggestion and it comes out like this:
Code:
dev-lang/python,2.7.12,PSF-2dev-lang/python,3.4.5,PSF-2dev-lang/python,3.5.3,PSF-2

which is better, but it still puts all slotted versions on one line.

So, is there a way to put the slotted installs each on their own line?

TIA.
_________________
________________________

"As far as the laws of mathematics refer to reality, they are not
certain, and as far as they are certain, they do not refer to reality."

-- Albert Einstein
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20048

PostPosted: Tue Oct 10, 2017 6:00 pm    Post subject: Reply with quote

:?:
Code:
NAMEVERSION="<category>/<name>,<version>\n"

_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Thu Oct 12, 2017 6:14 am    Post subject: Reply with quote

pjp wrote:
:?:
Code:
NAMEVERSION="<category>/<name>,<version>\n"
Use single-quotes, or the shell will interpret backslashes (eg to avoid \$expansion), resulting in a plain 'n'.
Bash allows eg: $'\t' or $'\n' escapes as well (should the underlying tool not interpret standard C escape sequences.)
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Thu Oct 12, 2017 10:12 am    Post subject: Reply with quote

ShadowCat8 wrote:
And, I already tried your suggestion and it comes out like this:
Code:
dev-lang/python,2.7.12,PSF-2dev-lang/python,3.4.5,PSF-2dev-lang/python,3.5.3,PSF-2

It shouldn't. As SteveL already pointed out, perhaps you have used the wrong quotation marks when copying my suggestion.
Back to top
View user's profile Send private message
proteusx
Guru
Guru


Joined: 21 Jan 2008
Posts: 338

PostPosted: Thu Oct 12, 2017 12:50 pm    Post subject: Reply with quote

With 0.33.0 I get this:
Code:
# eix-installed-after -de0
/usr/bin/eix-installed-after: line 19: ReadFunctions: command not found
/usr/bin/eix-installed-after: line 23: ReadVar: command not found
/usr/bin/eix-installed-after: line 24: EIX_INSTALLED_AFTER: unbound variable
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20048

PostPosted: Thu Oct 12, 2017 2:26 pm    Post subject: Reply with quote

steveL wrote:
pjp wrote:
:?:
Code:
NAMEVERSION="<category>/<name>,<version>\n"
Use single-quotes, or the shell will interpret backslashes (eg to avoid \$expansion), resulting in a plain 'n'.
Bash allows eg: $'\t' or $'\n' escapes as well (should the underlying tool not interpret standard C escape sequences.)
Thanks, I just referenced the earlier example.

There must be some handling for that issue as it seems to work with either " or ':
Code:
$ NAMEVERSION="<category>/<name>,<version>\n" eix -s python '-I*' --format '<installedversions:NAMEVERSION>,<licenses>\n'
app-eselect/eselect-python,20160516
,GPL-2
dev-lang/python,2.7.12
dev-lang/python,3.4.5
,PSF-2
dev-lang/python-exec,2.4.4
,BSD-2
virtual/python-ipaddress,1.0-r1
,
Code:
$ NAMEVERSION='<category>/<name>,<version>\n' eix -s python '-I*' --format '<installedversions:NAMEVERSION>,<licenses>\n'
app-eselect/eselect-python,20160516
,GPL-2
dev-lang/python,2.7.12
dev-lang/python,3.4.5
,PSF-2
dev-lang/python-exec,2.4.4
,BSD-2
virtual/python-ipaddress,1.0-r1
,

_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sat Oct 14, 2017 9:06 pm    Post subject: Reply with quote

proteusx wrote:
With 0.33.0 I get this:
Code:
# eix-installed-after -de0
/usr/bin/eix-installed-after: line 19: ReadFunctions: command not found
/usr/bin/eix-installed-after: line 23: ReadVar: command not found
/usr/bin/eix-installed-after: line 24: EIX_INSTALLED_AFTER: unbound variable

Some Gentoo developers keep breaking the eix package because they have a grudge against its author. Of course, it's us users getting the shaft every time they pull an infantile stunt like this. The solution is to use the un-"enhanced" eix ebuild from the mv overlay.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Thu Oct 19, 2017 3:52 am    Post subject: Reply with quote

Ant P. wrote:
Some Gentoo developers keep breaking the eix package because they have a grudge against its author. Of course, it's us users getting the shaft every time they pull an infantile stunt like this. The solution is to use the un-"enhanced" eix ebuild from the mv overlay.
Ouch; that bug and the meson one are just embarrassing.
As for mgorny pulling a QA power-play.. his scripting has always been utterly shite (in my professional opinion.)
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
Goto page 1, 2  Next
Page 1 of 2

 
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