Gentoo Archives: gentoo-portage-dev

From: Ned Ludd <solar@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: Wed, 26 Nov 2008 00:18:30
Message-Id: 1227658702.18783.86.camel@hangover
In Reply to: Re: [gentoo-portage-dev] How to extract the version/revision of an installed package? by Brian Harring
1 On Tue, 2008-11-25 at 14:03 -0800, Brian Harring wrote:
2 > On Tue, Nov 25, 2008 at 06:05:21PM +0200, 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 > > (I don't necessarily need to use qlist. Just want to get the version of an
10 > > installed package within a bash script)
11 >
12 > This *really* should be folded into portageq offhand- it's the initial
13 > step towards shifting versionator logic (yet another standalone
14 > parser/comparison implementation) into the PM.
15 >
16 > Counter arguements?
17 > ~brian
18
19 Yes. he said a bash script. portageq still takes a few seconds to load
20 and invokes far far to many instructions for very simple info.
21
22 The 3 execve's I just posted are still faster than one portageq call.
23 So.. foo.c wins again. :p
24
25
26
27
28 --
29 Ned Ludd <solar@g.o>
30 Gentoo Linux

Replies