From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1L5IKt-0000xY-RX for garchives@archives.gentoo.org; Wed, 26 Nov 2008 11:13:36 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 89647E066F; Wed, 26 Nov 2008 11:13:32 +0000 (UTC) Received: from mail.oversi.com (oversrv1.oversi.com [209.88.189.2]) by pigeon.gentoo.org (Postfix) with ESMTP id 57AC6E066F for ; Wed, 26 Nov 2008 11:13:32 +0000 (UTC) Received: from [10.2.2.28] (unknown [10.2.2.28]) by mail.oversi.com (Postfix) with ESMTP id 57FD04C5927 for ; Wed, 26 Nov 2008 13:11:13 +0200 (IST) Message-ID: <492D2F5B.9060601@oversi.com> Date: Wed, 26 Nov 2008 13:13:31 +0200 From: Amit Dor-Shifer User-Agent: Thunderbird 2.0.0.14 (X11/20080519) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] How to extract the version/revision of an installed package? References: <492C2241.8090306@oversi.com> <492C240E.9020403@gentoo.org> <492C2B46.8070207@oversi.com> <492C2FFB.4040002@necoro.eu> In-Reply-To: <492C2FFB.4040002@necoro.eu> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 47236379-ce11-4063-adfa-54181b98ab39 X-Archives-Hash: 025555217b0aac595eb533e97a8f1349 Is there syntax in eix for querying: "is package X installed with a=20 version X.Y or higher?" Amit Ren=C3=A9 'Necoro' Neumann wrote: > Amit Dor-Shifer schrieb: > > Thanks :) > > > Reason I thought this is relevant is: I'm basically looking for an AP= I > > to get an installed package's version/rev. I prefer that over making > > syntactical assumptions on the way portage names packages. > > > Taking RPM for example, there's such an API: something like rpm -q > > --queryformat '%{VERSION}|' PKG_NAME if I remember correctly.| > > > Amit > > You could also use eix ... though I needed quite a time to figure it=20 > out ;) > > # PRINT_SLOTS=3D"false" eix -e -I sys-devel/automake --pure-packages > --format "" > 1.9.6-r2 1.10.1-r1 > > Note however, that if you a package has multiple installed versions, > they are seperated by space. One could use > > > # PRINT_SLOTS=3D"false" eix -e -I sys-devel/automake --pure-packages > --format "" > > But this prints an additional empty line at the beginning. > > > Andrew Gaffney wrote: > >> Amit Dor-Shifer wrote: > >>> Given the following: > >>> # qlist -Iv sys-apps/portage > >>> sys-apps/portage-2.1.4.5 > >>> > >>> How do I safely extract the "2.1.4.5"? > >> That's probably offtopic for this list, since it really has nothing = to > >> do with portage itself. However, you probably want something like: > >> > >> qlist -Iv sys-apps/portage | sed -e 's:^.*-\([0-9][^-_]*\).*$:\1:' > >> >