[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-portage-dev
Subject:    Re: [gentoo-portage-dev] How to extract the version/revision of an installed package?
From:       "Alec Warner" <antarus () gentoo ! org>
Date:       2008-11-27 7:08:04
Message-ID: b41005390811262308l5eb29ff9hf2eb45c73ed208ae () mail ! gmail ! com
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic