From: "Alec Warner" <antarus@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Subject: Re: [gentoo-portage-dev] How to extract the version/revision of an installed package?
Date: Wed, 26 Nov 2008 23:08:04 -0800 [thread overview]
Message-ID: <b41005390811262308l5eb29ff9hf2eb45c73ed208ae@mail.gmail.com> (raw)
In-Reply-To: <492D2F5B.9060601@oversi.com>
On Wed, Nov 26, 2008 at 3:13 AM, Amit Dor-Shifer <amitds@oversi.com> wrote:
> Is there syntax in eix for querying: "is package X installed with a version
> X.Y or higher?"
> Amit
portageq has_version / <ATOM>
>
> René 'Necoro' Neumann wrote:
>>
>> Amit Dor-Shifer schrieb:
>> > Thanks :)
>>
>> > Reason I thought this is relevant is: I'm basically looking for an API
>> > to get an installed package's version/rev. I prefer that over making
>> > syntactical assumptions on the way portage names packages.
>>
>> > Taking RPM for example, there's such an API: something like rpm -q
>> > --queryformat '%{VERSION}|' PKG_NAME if I remember correctly.|
>>
>> > Amit
>>
>> You could also use eix ... though I needed quite a time to figure it out
>> ;)
>>
>> # PRINT_SLOTS="false" eix -e -I sys-devel/automake --pure-packages
>> --format "<installedversionsshort>"
>> 1.9.6-r2 1.10.1-r1
>>
>> Note however, that if you a package has multiple installed versions,
>> they are seperated by space. One could use
>>
>>
>> # PRINT_SLOTS="false" eix -e -I sys-devel/automake --pure-packages
>> --format "<installedversionsshort:\n>"
>>
>> But this prints an additional empty line at the beginning.
>>
>> > Andrew Gaffney wrote:
>> >> Amit Dor-Shifer wrote:
>> >>> Given the following:
>> >>> # qlist -Iv sys-apps/portage
>> >>> sys-apps/portage-2.1.4.5
>> >>>
>> >>> How do I safely extract the "2.1.4.5"?
>> >> That's probably offtopic for this list, since it really has nothing to
>> >> do with portage itself. However, you probably want something like:
>> >>
>> >> qlist -Iv sys-apps/portage | sed -e 's:^.*-\([0-9][^-_]*\).*$:\1:'
>> >>
>>
>
>
>
next prev parent reply other threads:[~2008-11-27 7:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-25 16:05 [gentoo-portage-dev] How to extract the version/revision of an installed package? Amit Dor-Shifer
2008-11-25 16:13 ` Andrew Gaffney
2008-11-25 16:19 ` Andrew Gaffney
2008-11-25 16:43 ` Amit Dor-Shifer
2008-11-25 17:03 ` René 'Necoro' Neumann
2008-11-26 11:13 ` Amit Dor-Shifer
2008-11-27 7:08 ` Alec Warner [this message]
2008-11-25 22:03 ` Brian Harring
2008-11-26 0:18 ` Ned Ludd
2008-11-26 0:31 ` Brian Harring
2008-11-26 1:24 ` Ned Ludd
2008-11-26 4:54 ` Zac Medico
2008-11-27 2:03 ` Brian Harring
2008-11-26 0:15 ` Ned Ludd
2008-11-26 8:29 ` Fabian Groffen
2008-11-26 9:29 ` Amit Dor-Shifer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b41005390811262308l5eb29ff9hf2eb45c73ed208ae@mail.gmail.com \
--to=antarus@gentoo.org \
--cc=gentoo-portage-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox