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 1L586r-0005Pk-JI for garchives@archives.gentoo.org; Wed, 26 Nov 2008 00:18:30 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9E77CE07B2; Wed, 26 Nov 2008 00:18:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 74F40E07B2 for ; Wed, 26 Nov 2008 00:18:23 +0000 (UTC) Received: from [192.168.19.59] (hangover.linbsd.net [69.80.193.15]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 0D96664447 for ; Wed, 26 Nov 2008 00:18:23 +0000 (UTC) Subject: Re: [gentoo-portage-dev] How to extract the version/revision of an installed package? From: Ned Ludd To: gentoo-portage-dev@lists.gentoo.org In-Reply-To: <20081125220345.GA5426@hrair.corp.631h.metaweb.com> References: <492C2241.8090306@oversi.com> <20081125220345.GA5426@hrair.corp.631h.metaweb.com> Content-Type: text/plain Organization: Gentoo Linux Date: Tue, 25 Nov 2008 16:18:22 -0800 Message-Id: <1227658702.18783.86.camel@hangover> 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 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Archives-Salt: fd4cfb6b-a379-4039-83a6-7f0687550444 X-Archives-Hash: 69c3b2a2e01364365fe0761e015d406e On Tue, 2008-11-25 at 14:03 -0800, Brian Harring wrote: > On Tue, Nov 25, 2008 at 06:05:21PM +0200, 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"? > > > > (I don't necessarily need to use qlist. Just want to get the version of an > > installed package within a bash script) > > This *really* should be folded into portageq offhand- it's the initial > step towards shifting versionator logic (yet another standalone > parser/comparison implementation) into the PM. > > Counter arguements? > ~brian Yes. he said a bash script. portageq still takes a few seconds to load and invokes far far to many instructions for very simple info. The 3 execve's I just posted are still faster than one portageq call. So.. foo.c wins again. :p -- Ned Ludd Gentoo Linux