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 1R3fUE-0006VH-CE for garchives@archives.gentoo.org; Wed, 14 Sep 2011 02:46:06 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B91B221C30B; Wed, 14 Sep 2011 02:45:56 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 34CCE21C0AF for ; Wed, 14 Sep 2011 02:45:27 +0000 (UTC) Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 6F1041B4016 for ; Wed, 14 Sep 2011 02:45:26 +0000 (UTC) From: Mike Frysinger Organization: wh0rd.org To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] new `usex` helper Date: Tue, 13 Sep 2011 22:45:27 -0400 User-Agent: KMail/1.13.7 (Linux/3.0.3; KDE/4.6.3; x86_64; ; ) References: <201109131756.19714.vapier@gentoo.org> <201109131813.10435.vapier@gentoo.org> <20110913230809.GA4867@localhost.google.com> In-Reply-To: <20110913230809.GA4867@localhost.google.com> 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="nextPart24375331.g22FeXAhEC"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201109132245.27972.vapier@gentoo.org> X-Archives-Salt: X-Archives-Hash: 60d3545af3d685581fce8736a17dcc1c --nextPart24375331.g22FeXAhEC Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable On Tuesday, September 13, 2011 19:08:09 Brian Harring wrote: > Making it overridable seems wiser- >=20 > usex() { > local flag=3D"$1" > local tval=3D${2-yes} > local fval=3D${3-no} > if use $flag; then > echo "${tval}" > else > echo "${fval}" > fi > } i dont get it. mine already does exactly this, just in one line. usex() { use $1 && echo ${2:-yes} || echo ${3:-no} ; } > While a bit longer, we likely can gut most of the use_* logic to > use that, and it makes it easier to deal w/ the situations where a > configure's options always assume --enable-blah thus don't export the > option, but *do* export a --disable-blah. yeah, i thought about replacing use_{with,enable} with usex, but we'd have = to=20 extend usex() a little bit more =2Dmike --nextPart24375331.g22FeXAhEC 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) iQIcBAABAgAGBQJOcBVHAAoJEEFjO5/oN/WBEwQP/iI9MlKp9wGiGRN32x5VlpKP HrxJGPVdXezlHUAJPZoQCsp9aCueEmtU1bfOaceFksYHD3wzhrFMfDD6xRHrvg+t n6yiY6XLszNoXXt//JwLTs8X/MMnwlTjmYUyfpOqOdphcHnLkDKljQrH6fPbE3F6 anmBwMXN7CDJAyChSO3/PYGKpOB3cqLgYbK09jA+4u8OzSxwdhr32fFWeOCI/9Bz Szm2+TWeWMbSmH2mpL3Ze+RRZ4SkzScrGWHDbvdAezuyfaPt9ZlsOcBPmetj9183 aHQdWG6EoN1OryLL1sWdqseW17eZffmTjtLfspU2zjJyC6YbMg3FDBupwFT7+WHI LJjf+WxgFc+1ahz8/kuG4jzglZ43DgzWZGTNX3hzdIIg8ON9VWgmzADYxBlkC7IP mDrYoxfxSCwQLFWu4ZjQ8xyQvjjK3NUM9Axr1bpRj5fiQsrPxSW+xu2TtZfYOvpx 0BPOjugVADd7CFJ4g+fiQi7IG+SnA5Urkxe/dgKRAkrEnnZEfpBoP/hGBK8eRCVh +g2wS4ee62eUYrFrAOcZNk/2v8xWIMv891JzBN2X6U3SLERXZU7g+WrCBCdQL631 YzCZ9Sx5pSxhPXvg+yMLyPt22YYxvgzRvMwQUXXf6LnLzCIgQ1REpGdCGuJsjAoL Lr4Toe0eBOA3+JTHEca4 =P81y -----END PGP SIGNATURE----- --nextPart24375331.g22FeXAhEC--