vaeth / eix

eix can access Gentoo portage ebuild information and description very quickly (using a local cache). It can also be used to access information on installed packages, local settings, and local and external overlays, and informs about changes in the tree
GNU General Public License v2.0
166 stars 14 forks source link

printing of package versions available only from an overlay #124

Closed efferre79 closed 1 month ago

efferre79 commented 1 month ago

I would like to print a list of packages installed from a specific overlay. The list must include only the installed package versions coming from the specific overlay, the output should not contains all the versions installed from gentoo or other overlays.

If I use this command

eix --in-overlay REPO --format '<installedversions:NAMEVERSION>'

then all the versions are printed even if not present in the specified overlay REPO. So I thought of using the conditional formatting:

eix --in-overlay REPO --format '{overlaykey=REPO}<installedversions:NAMEVERSION>{}'

but it doesn't seem to work.

vaeth commented 1 month ago

Try something like this

N='{overlayplainname=REPO}%{NAMEVERSION}{}' eix --in-overlay REPO --format '<installedversions:N>'
efferre79 commented 1 month ago

That helps but only if I specify a pattern, with an empty pattern I get no result.

vaeth commented 1 month ago

I cannot reproduce this here. Maybe you have some nonstandard default options set for eix: Does omitting the --format (and its argument) output something if you do not specify a pattern? In any case, specifying -r (searching for an empty regular expression) should work.

efferre79 commented 1 month ago

If I omit --format I get the list of packages. But when using --format I get No matches found (even if I use -r). I am using version 0.36.7-r1, latest in portage.

vaeth commented 1 month ago

Sorry, I cannot reproduce this.

efferre79 commented 1 month ago

The only thing I get is a list of 5 overlays:

N="{overlaynum=1}%{NAMEVERSION}{}" eix  --in-overlay REPO3  --format '<installedversions:N>'
[1] "REPO1" /path/to/repo1
[2] "REPO2" /path/to/repo2
[3] "REPO3" /path/to/repo3
[4] "REPO4" /path/to/repo4
[5] "REPO5" /path/to/repo5
No matches found
vaeth commented 1 month ago

Oh, you did not see that I fixed a typo in my first reply.

efferre79 commented 1 month ago

good catch, now it works like a charm! Thanks for the help! I would suggest to add this example in the manual, I think it might be useful to other people

vaeth commented 1 month ago

There are so many examples some people find useful, and the manpage is already more than long enough.