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

Replies