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: Brian Harring <ferringb@...>
Subject: Re: new `usex` helper
Date: Tue, 13 Sep 2011 20:56:57 -0700
On Tue, Sep 13, 2011 at 11:43:48PM -0400, Mike Frysinger wrote:
> 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.
> > > 
> > > yeah, i thought about replacing use_{with,enable} with usex, but we'd
> > > have to extend usex() a little bit more
> > 
> > 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:+=}$3 --disable-${2:-$1} ; }
> use_with() { usex $1 --with-${2:-$1}${3:+=}$3 --without-${2:-$1} ; }
> 
> although adding it to usex is cheap, simplifies the other helpers a little, 
> 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:+=}$3" ; }
> use_with() { usex $1 --with{,out}-${2:-$1} "${3:+=}$3"; }
> 
> so unless there's any other feedback, i'll open an EAPI bug on the topic and 
> merge it to eutils.eclass

Might want to get EAPI sorted before it lands in eutils...

Either way, have at it, preferably less dense implementations however 
;)
~harring



References:
new `usex` helper
-- Mike Frysinger
Re: new `usex` helper
-- Mike Frysinger
Re: new `usex` helper
-- Brian Harring
Re: new `usex` helper
-- Mike Frysinger
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: Re: Re: [gentoo-commits] gentoo-x86 commit in net-analyzer/wireshark: wireshark-1.6.2.ebuild ChangeLog wireshark-1.4.9.ebuild wireshark-1.4.7.ebuild wireshark-1.6.0_rc1.ebuild wireshark-1.4.4.ebuild wireshark-1.4.6-r1.ebuild


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.