Gentoo Archives: gentoo-portage-dev

From: Amit Dor-Shifer <amitds@××××××.com>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] How to extract the version/revision of an installed package?
Date: Tue, 25 Nov 2008 16:43:52
Message-Id: 492C2B46.8070207@oversi.com
In Reply to: Re: [gentoo-portage-dev] How to extract the version/revision of an installed package? by Andrew Gaffney
1 Thanks :)
2
3 Reason I thought this is relevant is: I'm basically looking for an API
4 to get an installed package's version/rev. I prefer that over making
5 syntactical assumptions on the way portage names packages.
6
7 Taking RPM for example, there's such an API: something like rpm -q
8 --queryformat '%{VERSION}|' PKG_NAME if I remember correctly.|
9
10 Amit
11
12 Andrew Gaffney wrote:
13 > Amit Dor-Shifer wrote:
14 >> Given the following:
15 >> # qlist -Iv sys-apps/portage
16 >> sys-apps/portage-2.1.4.5
17 >>
18 >> How do I safely extract the "2.1.4.5"?
19 >
20 > That's probably offtopic for this list, since it really has nothing to
21 > do with portage itself. However, you probably want something like:
22 >
23 > qlist -Iv sys-apps/portage | sed -e 's:^.*-\([0-9][^-_]*\).*$:\1:'
24 >

Replies

Subject Author
Re: [gentoo-portage-dev] How to extract the version/revision of an installed package? "René 'Necoro' Neumann" <lists@××××××.eu>