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 1L58JH-0007CR-SS for garchives@archives.gentoo.org; Wed, 26 Nov 2008 00:31:16 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 13286E07B6; Wed, 26 Nov 2008 00:31:14 +0000 (UTC) Received: from yx-out-1718.google.com (yx-out-1718.google.com [74.125.44.155]) by pigeon.gentoo.org (Postfix) with ESMTP id D7E36E07B6 for ; Wed, 26 Nov 2008 00:31:13 +0000 (UTC) Received: by yx-out-1718.google.com with SMTP id 4so141759yxp.46 for ; Tue, 25 Nov 2008 16:31:13 -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=WjgE8hRMiDHXkanHKtU8hIjblDgX3krsfkt152fUDfE=; b=CTd5Eb3OkMGi4uizEwxzRGoqSNqp8XhJdRQBaWBFjh8rKyATzO29whrzf7p8FNb45K YPQbuiquQPAlLAMzOFsju3qsFoG/lfxG9bPfrb3DIslU9I7DKLhil7QDMtqsVn/PZTfn amf7LZ3jzIyidQFnhzcCfmrNJD+2iQkyGz6vU= 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=qEWCSQlQ+1+0VmyUgANzlLJzNPYtoNidEBzjJveM+QMtWIwxvRGr68ENPmwAh204Rz TfTYQYVWbfrwyMv0I5MT6UMSHM1XRMnE5o7/BzArnemWoYjG7tsB0yaZki0lGeKZnZxx /mWt8V7w/8UFp08yKPrL8LwQe5wz3fA4WuJEw= Received: by 10.143.155.7 with SMTP id h7mr2344709wfo.153.1227659473038; Tue, 25 Nov 2008 16:31:13 -0800 (PST) Received: from smtp.gmail.com (nat08.sjc1.metaweb.com [208.68.111.103]) by mx.google.com with ESMTPS id 30sm8548871wff.32.2008.11.25.16.31.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 25 Nov 2008 16:31:12 -0800 (PST) Received: by smtp.gmail.com (sSMTP sendmail emulation); Tue, 25 Nov 2008 16:31:09 -0800 Date: Tue, 25 Nov 2008 16:31:09 -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: <20081126003109.GB5426@hrair.corp.631h.metaweb.com> References: <492C2241.8090306@oversi.com> <20081125220345.GA5426@hrair.corp.631h.metaweb.com> <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 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+pHx0qQiF2pBVqBT" Content-Disposition: inline In-Reply-To: <1227658702.18783.86.camel@hangover> User-Agent: Mutt/1.5.16 (2007-06-09) X-Archives-Salt: fd1bba01-7bf4-4cfe-a8f8-b806613086c5 X-Archives-Hash: 6b37aa54d63372c4588b6c595fa15e98 --+pHx0qQiF2pBVqBT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 25, 2008 at 04:18:22PM -0800, Ned Ludd wrote: >=20 > 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) > >=20 > > 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. > >=20 > > 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 Curious, does qatom handle use deps? Slot deps? Plans to add=20 repository deps (admittedly they've not landed)? The point of shifting it into portageq isn't speed based; it's to=20 transfer responsibility for atom parsing from multiple authorities=20 into a single one. Besides, just because portageq is slow for heavy data ops doesn't mean=20 it's going to be slow for doing simple atom splitting. Quick test=20 locally, cold cache pegs it at 3s- with minor use of snakeoil=20 demandload that's likely halvable. ~brian --+pHx0qQiF2pBVqBT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkksmM0ACgkQsiLx3HvNzgfyhACgpw5RXz8HM1ix77CDs7/yl8bH XgQAoIPchx4NqmCP6xPjk+GRad9NqrSv =cS21 -----END PGP SIGNATURE----- --+pHx0qQiF2pBVqBT--