Gentoo Archives: gentoo-portage-dev

From: Andrew Gaffney <agaffney@g.o>
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:18:52
Message-Id: 492C25AD.60309@gentoo.org
In Reply to: Re: [gentoo-portage-dev] How to extract the version/revision of an installed package? by Andrew Gaffney
1 Andrew Gaffney wrote:
2 > Amit Dor-Shifer wrote:
3 >> Given the following:
4 >> # qlist -Iv sys-apps/portage
5 >> sys-apps/portage-2.1.4.5
6 >>
7 >> How do I safely extract the "2.1.4.5"?
8 >
9 > That's probably offtopic for this list, since it really has nothing to
10 > do with portage itself. However, you probably want something like:
11 >
12 > qlist -Iv sys-apps/portage | sed -e 's:^.*-\([0-9][^-_]*\).*$:\1:'
13
14 And if you want the full version (with RC position and revision):
15
16 qlist -Iv sys-apps/portage | sed -e 's:^.*-\([0-9].*\)$:\1:'
17
18 --
19 Andrew Gaffney http://dev.gentoo.org/~agaffney/
20 Gentoo Linux Developer Catalyst/Genkernel + Release Engineering Lead