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 <gentoo-dev+bounces-47560-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1R3gOp-0006n3-PA
	for garchives@archives.gentoo.org; Wed, 14 Sep 2011 03:44:36 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 8EF8921C0E7;
	Wed, 14 Sep 2011 03:44:23 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id 7305621C0A5
	for <gentoo-dev@lists.gentoo.org>; Wed, 14 Sep 2011 03:43:48 +0000 (UTC)
Received: from vapier.localnet (localhost [127.0.0.1])
	by smtp.gentoo.org (Postfix) with ESMTP id A60D21B4018
	for <gentoo-dev@lists.gentoo.org>; Wed, 14 Sep 2011 03:43:47 +0000 (UTC)
From: Mike Frysinger <vapier@gentoo.org>
Organization: wh0rd.org
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] new `usex` helper
Date: Tue, 13 Sep 2011 23:43:48 -0400
User-Agent: KMail/1.13.7 (Linux/3.0.3; KDE/4.6.3; x86_64; ; )
References: <201109131756.19714.vapier@gentoo.org> <201109132245.27972.vapier@gentoo.org> <20110914030406.GB5106@localhost.hobnob.com>
In-Reply-To: <20110914030406.GB5106@localhost.hobnob.com>
Precedence: bulk
List-Post: <mailto:gentoo-dev@lists.gentoo.org>
List-Help: <mailto:gentoo-dev+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-dev+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-dev+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-dev.gentoo.org>
X-BeenThere: gentoo-dev@lists.gentoo.org
Reply-to: gentoo-dev@lists.gentoo.org
MIME-Version: 1.0
Content-Type: multipart/signed;
  boundary="nextPart30609544.QiGzHgtLnS";
  protocol="application/pgp-signature";
  micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
Message-Id: <201109132343.49314.vapier@gentoo.org>
X-Archives-Salt: 
X-Archives-Hash: b54fe0a5282f506786414a8ca5c065e2

--nextPart30609544.QiGzHgtLnS
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

On Tuesday, September 13, 2011 23:04:06 Brian Harring wrote:
> On Tue, Sep 13, 2011 at 10:45:27PM -0400, Mike Frysinger wrote:
> > On Tuesday, September 13, 2011 19:08:09 Brian Harring wrote:
> > > 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.
> >=20
> > yeah, i thought about replacing use_{with,enable} with usex, but we'd
> > have to extend usex() a little bit more
>=20
> Only extension I can think of is adding a prefix/postfix... which
> frankly seems a bit too much.  Anything else you were looking for?

i dont think the postfix is needed for use_{enable,with}:
usex() { use $1 && echo ${2:-yes} || echo ${3:-no} ; }
use_enable() { usex $1 --enable-${2:-$1}${3:+=3D}$3 --disable-${2:-$1} ; }
use_with() { usex $1 --with-${2:-$1}${3:+=3D}$3 --without-${2:-$1} ; }

although adding it to usex is cheap, simplifies the other helpers a little,=
=20
and might get used in more creative ways i cant imagine right now:
usex() { use $1 && echo ${2:-yes}$4 || echo ${3:-no}$5 ; }
use_enable() { usex $1 --{en,dis}able-${2:-$1} "${3:+=3D}$3" ; }
use_with() { usex $1 --with{,out}-${2:-$1} "${3:+=3D}$3"; }

so unless there's any other feedback, i'll open an EAPI bug on the topic an=
d=20
merge it to eutils.eclass
=2Dmike

--nextPart30609544.QiGzHgtLnS
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)

iQIcBAABAgAGBQJOcCL1AAoJEEFjO5/oN/WBh8UP/1B7rqGUz+dQ1Ymr9Hb5C9ja
TIiOKjeyF0yY8TY5ZnNxPD2BCcskJObm7j7voOW56CsaVa3m57K4K1bKIpfyKag0
0EiD63LL2GwoRUMRFoSm30ZyMTMxyT/TXpusdqeTh+adj9hFzj5w5b9HtwFfgNGZ
tlor+PVac85ak5FjeAODrSbtMBC3QW1pgzvKoP7VRanYJ7zk6eT9+t2PMFBxxAO0
H2CytO5WeRz/IonFkToi0qh11gv40cR7ai7av9RpN5IkJ1jGokgY3eLg8el/l9A/
A74fvYmFptm9ENgR0VOtoZL4Xk67oyzDhxVJKesQ59oP4sWdf0HDmB7Qe3YfuaS6
XqtcQ4eqJe43R7pHjABYS8CTjC0XspMedTLgqINrxUd2coLAZn0MNegqudyAAfoJ
2D5inBJ12iuwUBPu3X18aHqju6KF72rVlvzE7OwR2Rn34yKn7ZCmJbV42qpeHQ9+
gR7Q6Ot6GW+UBt/PvFVr2BV2e24doIoM8aLisO7CZ2SffjvfMeDT+R+aekZqsCy8
8IClJMGS4somHXtXdLYi3GmJjDDdrbxNJ8+9z7kZzuuwNYX4bVHj+sp6Zt85wbOy
hO1kjWGLBZ+eOdVD+0iOgaCMItg9poMwrpb3RZlpEnB3JqaQ+uALQQM+icg4Tb9k
vvxDPX5U8Up8gyEAut4h
=nFE4
-----END PGP SIGNATURE-----

--nextPart30609544.QiGzHgtLnS--