From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1R3ayy-0005tn-Fo for garchives@archives.gentoo.org; Tue, 13 Sep 2011 21:57:32 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A784C21C287; Tue, 13 Sep 2011 21:57:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0F21421C185 for ; Tue, 13 Sep 2011 21:56:19 +0000 (UTC) Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 900E61B4019 for ; Tue, 13 Sep 2011 21:56:19 +0000 (UTC) From: Mike Frysinger Organization: wh0rd.org To: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] new `usex` helper Date: Tue, 13 Sep 2011 17:56:19 -0400 User-Agent: KMail/1.13.7 (Linux/3.0.3; KDE/4.6.3; x86_64; ; ) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1446896.p6rdLexkLs"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201109131756.19714.vapier@gentoo.org> X-Archives-Salt: X-Archives-Hash: 92a6a00e3c418cc2f7440c6954fcebfa --nextPart1446896.p6rdLexkLs Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable i keep writing little helpers like this in ebuilds: usex() { use $1 && echo ${2:-yes} || echo ${3:-no} ; } this is so i can do: export some_var=3D$(usex some_flag) and get it set to "yes" or "no" or if i want something a little different, i can do: export some_var=3D$(usex some_flag true false) export some_var=3D$(usex some_flag y n) useful enough for EAPI ? or should i just stick it into eutils.eclass ? O= R=20 BOTH !? =2Dmike --nextPart1446896.p6rdLexkLs Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAABAgAGBQJOb9GDAAoJEEFjO5/oN/WBejYQAN93tJ2PHztdH/WUdU62I7c0 Hu/1MiqXP6bLMBzBOl6VD5Hb3RiL6WNzBBhNROFUU9A0dDM6ran50JSmZRyRCIck 3l88R24HkVVyqcxsaNhzMegySw3KBNxRFoZgUrpB8qe0KuFugyUQxA0D6R8oxHb6 4nQcsrEJc+2TyqSED1g8XKN3WlQYNejvLaLUoNcMOGUJCpz3bPgnCa8iIgeFS/nw b2MR+nuFabFJLh5NtW/sAVHkSDmTA2TNOzpZY7vtXcqaZ6N0BvN2BZgJNleyHdCc ZtEZcV8cntrZ4Qpix8tOhZMJjqesF1zu+k4uSu1J+iVxyUS7+ORTuMNWae0wH3Fb jqmVqofx6BYazF4ZPwgZO6vl0oRwV8LDirPA35N0dDVH0iW+s4X52gQE2TaQJ2Hx 4SzJuc4D2EGng9YEWLnva9u+BsH3qW+SRYc3KS5/56IutyQqoQIgfIOuxE71YmMD MLFFdBiHCVxvU6yfFzNCVsovv7v1vSzt8e1BweHT5ceiT9ebCTlWpbsSmqAe/39h WD5Aah9bWdRFk7hOMyWE+lJXdhchIEXlkrDxC22RVzJ7q4L6A6E9exyIyDuA6FJX UDKV3Hoivg4XzU1EeA/mGtfEAhsMnHlwfPF9K0F0QNLJT6emz934kZQNBPPVz9xa Be4Az1vjcyLZCqPpRVKF =E2x3 -----END PGP SIGNATURE----- --nextPart1446896.p6rdLexkLs--