Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] new `usex` helper
Date: Wed, 14 Sep 2011 02:46:06
Message-Id: 201109132245.27972.vapier@gentoo.org
In Reply to: Re: [gentoo-dev] new `usex` helper by Brian Harring
On Tuesday, September 13, 2011 19:08:09 Brian Harring wrote:
> Making it overridable seems wiser- > > usex() { > local flag="$1" > local tval=${2-yes} > local fval=${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 extend usex() a little bit more -mike

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] new `usex` helper Ulrich Mueller <ulm@g.o>
Re: [gentoo-dev] new `usex` helper Brian Harring <ferringb@×××××.com>