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 1L5WEN-00072D-Vj for garchives@archives.gentoo.org; Thu, 27 Nov 2008 02:03:49 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E2CA9E04C0; Thu, 27 Nov 2008 02:03:46 +0000 (UTC) Received: from rv-out-0708.google.com (rv-out-0708.google.com [209.85.198.245]) by pigeon.gentoo.org (Postfix) with ESMTP id A49D0E04C0 for ; Thu, 27 Nov 2008 02:03:46 +0000 (UTC) Received: by rv-out-0708.google.com with SMTP id b17so773831rvf.46 for ; Wed, 26 Nov 2008 18:03:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:date:from:to:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=rCxDjAVYF0kuTyVs5KAQRgwbSeXt/CXflR2UC1/ZP94=; b=UBtB9TAxwryHXDuRQSOJThVjsDxYnCwJwqpKX7n8v8LPX866ABpSSJVpXwhjqRdd5A x67ejLQLX6gVw8K993AekA0UX0FucLDmDr612i+MRT05X/rs6hF0fzSKnldUAvPopVdu pCN6T82XsyBARNr1LThAf3QBHkSdAVg/QTXi8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=EQWyr65PpqS4Mxq3+15waD/Wl6YfONYQN0ajVvfuB6g1Zk5FbL1hq+0DY3mOjjRKBI tKgBC6zvTEHvzO9ozQ8tktcwmQJtpgP0uXFThy/yMHtCCojuJLcvkR0AiijEIy9o8bZs IwM1uPdNMJTeWD1ZLvL0sraahxf2bP2mmHqgM= Received: by 10.143.8.10 with SMTP id l10mr2805041wfi.175.1227751426250; Wed, 26 Nov 2008 18:03:46 -0800 (PST) Received: from smtp.gmail.com (c-98-210-196-21.hsd1.ca.comcast.net [98.210.196.21]) by mx.google.com with ESMTPS id 22sm744231wfi.38.2008.11.26.18.03.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 26 Nov 2008 18:03:45 -0800 (PST) Received: by smtp.gmail.com (sSMTP sendmail emulation); Wed, 26 Nov 2008 18:03:42 -0800 Date: Wed, 26 Nov 2008 18:03:42 -0800 From: Brian Harring To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] How to extract the version/revision of an installed package? Message-ID: <20081127020342.GA3795@hrair.metaweb.com> References: <492C2241.8090306@oversi.com> <20081125220345.GA5426@hrair.corp.631h.metaweb.com> <1227658702.18783.86.camel@hangover> <492CD685.2020905@gentoo.org> 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 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="envbJBWh7q8WU6mo" Content-Disposition: inline In-Reply-To: <492CD685.2020905@gentoo.org> User-Agent: Mutt/1.5.16 (2007-06-09) X-Archives-Salt: e883e17e-099c-4133-a755-86a4809a4f73 X-Archives-Hash: fa8506381a476c99cf3979ba0f18d7d4 --envbJBWh7q8WU6mo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 25, 2008 at 08:54:29PM -0800, Zac Medico wrote: > Ned Ludd wrote: > > 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=20 > >>> installed package within a bash script) > >> This *really* should be folded into portageq offhand- it's the initial= =20 > >> step towards shifting versionator logic (yet another standalone=20 > >> parser/comparison implementation) into the PM. > >> > >> Counter arguements? > >> ~brian > >=20 > > 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. > >=20 > > The 3 execve's I just posted are still faster than one portageq call. > > So.. foo.c wins again. :p >=20 > Well, I think portageq will be fine if it's limited to a small > number of calls. Here's a simple test, with portage-2.2_rc16: >=20 > # time python -c "import portage.versions" >=20 > real 0m0.141s > user 0m0.124s > sys 0m0.016s >=20 > It's not so bad if it only has to be called a few times. For cases > where a large number need to be split, they could be processed in a > batch by a single portageq call, by either passing all the inputs in > as arguments or writing them to stdin. So.. eapi3 meanwhile? ~brian --envbJBWh7q8WU6mo Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkkt//4ACgkQsiLx3HvNzgfxgACg2Y8noCN/ZjUvQQR+tjhFxx4e CfEAnR1F8Ct4rHALRkStxoeTTB5rd5Fv =rf2D -----END PGP SIGNATURE----- --envbJBWh7q8WU6mo--