Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Mike Frysinger <vapier@g.o>
Subject: Re: new `usex` helper
Date: Tue, 13 Sep 2011 22:45:27 -0400
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
Attachment:
signature.asc (This is a digitally signed message part.)
Replies:
Re: new `usex` helper
-- Ulrich Mueller
Re: new `usex` helper
-- Brian Harring
References:
new `usex` helper
-- Mike Frysinger
Re: new `usex` helper
-- Mike Frysinger
Re: new `usex` helper
-- Brian Harring
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: new `usex` helper
Next by thread:
Re: new `usex` helper
Previous by date:
Re: new `usex` helper
Next by date:
Re: new `usex` helper


Updated Jun 29, 2012

Summary: Archive of the gentoo-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.