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: Wed, 26 Nov 2008 09:29:52
Message-Id: 492D1705.4050008@oversi.com
In Reply to: Re: [gentoo-portage-dev] How to extract the version/revision of an installed package? by Ned Ludd
1 Great! the usage of -C escaped me, and I was wondering why I was
2 getting bad output...
3 Thanks,
4 Amit
5
6 Ned Ludd wrote:
7 > On Tue, 2008-11-25 at 18:05 +0200, Amit Dor-Shifer wrote:
8 >
9 >> Given the following:
10 >> # qlist -Iv sys-apps/portage
11 >> sys-apps/portage-2.1.4.5
12 >>
13 >> How do I safely extract the "2.1.4.5"?
14 >>
15 >> (I don't necessarily need to use qlist. Just want to get the version of
16 >> an installed package within a bash script)
17 >>
18 >>
19 >
20 >
21 > qatom $(qlist -ICv sys-apps/portage) | awk '{print $3}'
22 >
23 >
24 >
25 >