Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 288288 - app-portage/eix: add an option for showing output with format =<category>/<name>-<latest_version_in_tree>
Summary: app-portage/eix: add an option for showing output with format =<category>/<na...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Martin Väth
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-09 11:32 UTC by Pacho Ramos
Modified: 2009-10-13 17:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pacho Ramos gentoo-dev 2009-10-09 11:32:31 UTC
From time to time I have wanted to use latest version for gstreamer and its plugins in one of the systems I admin. 

I think that would be really useful if I was able to run eix with some option that would output with format =<category>/<name>-<latest_version_in_tree> (currently, only " --only-names" option exist)

Then, I could simply run:
eix -I gst --latest-version (for example) > /etc/portage/package.keywords/gst

It could also be useful for other cases :-)

Thanks

Reproducible: Always
Comment 1 Martin Väth 2009-10-09 21:32:48 UTC
With >=eix-0.18.0 you can specify such things in the FORMAT string, see e.g.
the discussion starting from

http://forums.gentoo.org/viewtopic-t-278819-postdays-0-postorder-asc-start450.html

(if the link gets posted broken: It should be one line without spaces).
Comment 2 Martin Väth 2009-10-09 21:34:26 UTC
Another attempt for the link (a "-" was missing):

http://forums.gentoo.org/viewtopic-t-278819-postdays-0-postorder-asc-start-450.html
Comment 3 Pacho Ramos gentoo-dev 2009-10-10 09:25:13 UTC
I am reading it just now, thanks
Comment 4 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-10-11 17:51:51 UTC
So should this report be closed?
Comment 5 Pacho Ramos gentoo-dev 2009-10-11 17:58:50 UTC
I would prefer to keep it opened as I still think that an option would be better than current way to handle this situation, because it seems to be a bit hard to find (at least for me, maybe other people more familiarized with eix will disagree but...)
Comment 6 Martin Väth 2009-10-11 22:42:51 UTC
Such an option will not be added: There are just too many variants which
different people might consider the most reasonable.
For example, "latest_version_in_the_tree" means perhaps for you the really
latest version in the tree, which however, might be a -9999 live ebuild.
So for another person it should mean the latest non-masked version;
or the latest ~arch version; or the latest stable version?
Moreover, it could mean the latest such a version for each slot of a package.
Or it could mean the latest version of each slot from which you have
installed something or installed something with a strictly smaller version;
and then how about "higher" slots?
The list of possibilities is close to infinite - that's why I think, people
should program in a (usually rather tiny) script what they really want;
eix should only provide the means to do this.
Actually, I was even thinking about removing the --only-names option,
since it is now some sort of anachronism.
Comment 7 Pacho Ramos gentoo-dev 2009-10-11 22:52:19 UTC
My initial suggestion was to do it for showing latest version in ~arch, since they are usually the candidates to go to stable "soon"
Comment 8 Martin Väth 2009-10-12 20:14:17 UTC
(In reply to comment #7)
> My initial suggestion was to do it for showing latest version in ~arch

This is really simple:

  eix --pure-packages --format '<bestversion*:NAMEVERSION>'
  eix --pure-packages --format '<bestversion*:EQNAMEVERSION>'
  eix --pure-packages --format '<bestslotversions*:NAMEVERSION>'

Adding additional switches would not make it much easier, only harder to
modify if you want some slight variations (like the three variants):
Better make an alias (or a tiny scriptfile) if you need in frequently,
but probably you will need such things only in scripts, anyway.
Comment 9 Pacho Ramos gentoo-dev 2009-10-13 13:25:21 UTC
(In reply to comment #8)
> This is really simple:
> 
>   eix --pure-packages --format '<bestversion*:NAMEVERSION>'
>   eix --pure-packages --format '<bestversion*:EQNAMEVERSION>'
>   eix --pure-packages --format '<bestslotversions*:NAMEVERSION>'
> 

Yes, you are true, thanks a lot for the info and sorry for the inconvenience

Only a few final suggestions/questions:
- Are "bestversion" and "best" the same? I say that because I am unable to find "bestversion" in eix manpage, and "best" seems to work similar for me
- NAMEVERSION and EQNAMEVERSION seems to output the same for me, also, I couldn't find any reference to them in eix manpage
- For now, I think that I will use this line:
$ eix -I gst --format '=<category>/<name>-<bestshort*:NAMEVERSION>' | sed -e s/"(~)"//  | cut -f1 -d!

is there any other way for dropping "!t" (or similar) and "(~)"? If not, no problem, I have no problem in use sed/cut for that

Thanks and best regards
Comment 10 Martin Väth 2009-10-13 16:12:19 UTC
I was talking about eix-0.18.*. It seems you had tried with an earlier
version - the examples will not work there properly.

Only in eix-0.18.* the powerful approach to the formatstring was added:
All things like <...:VAR> and the example variables VARVERSION and
EQVARVERSION have been introduced only here.

Definitely, "bestversion", VARVERSION, and EQVARVERSION are documented in
the manpage of eix-0.18.*. Moreover, VARVERSION and EQVARVERSION only
output the pure version number, no stability/mask tags or other things
(if you would want the latter you would have to call other variables).
This should answer your question how to get rid of these tags - they just
do not occur in the examples I gave (if you use them with the correct eix
version).

Moreover, with eix-0.18.* your example will do something completely else.
(Actually, neither my nor your example are valid syntax on earlier versions
of eix - it is just by pure accident and due to sloppy syntax checking
of earlier eix versions that they accept these formats without throwing
an error).

Yes, indeed, all these things have completely changed in eix-0.18.* ...
Comment 11 Pacho Ramos gentoo-dev 2009-10-13 16:50:46 UTC
OK

Indeed, I am using current stable eix, usually I used to install testing eix always, but since it started to use xz-utils, I got blockers due other apps still requiring lzma-utils. Then, I will wait a bit until install it 

Thanks :-)
Comment 12 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-10-13 17:07:47 UTC
(In reply to comment #11)
> OK
> 
> Indeed, I am using current stable eix, usually I used to install testing eix
> always, but since it started to use xz-utils, I got blockers due other apps
> still requiring lzma-utils. Then, I will wait a bit until install it 
> 
> Thanks :-)
> 

Sorry, this will be off topic. But if any package still needs solely lzma-utils, then it is a bug. wrt bug 279871 Considering that but is closed, it means that you can safely unmerge lzma-utils and emerge xz-utils. Portage will do this for you if lzma-utils is not in your world file.