Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Development (http://www.linux-archive.org/gentoo-development/)
-   -   huse: new helper for low level eclass writers (http://www.linux-archive.org/gentoo-development/589195-huse-new-helper-low-level-eclass-writers.html)

Mike Frysinger 10-19-2011 06:05 PM

huse: new helper for low level eclass writers
 
i wrote a new func for toolchain.eclass: huse. this is because the
toolchain.eclass supports multiple versions in parallel, and the IUSE value
can vary greatly between them. so doing `use foo` without checking IUSE first
doesn't work. since i got a request to use this in other eclasses (for the
same reason), i figured i'd move it to eutils.eclass so more people can benefit.

now that we have "in_iuse" in eutils.eclass (with all the caveats), i'll be
adding huse:
huse() {
in_iuse $1 || return 1
use $1
}

any comments before i publish ?
-mike

Mike Frysinger 10-19-2011 06:25 PM

huse: new helper for low level eclass writers
 
On Wednesday 19 October 2011 14:05:50 Mike Frysinger wrote:
> now that we have "in_iuse" in eutils.eclass (with all the caveats), i'll be
> adding huse:
> huse() {
> in_iuse $1 || return 1
> use $1
> }

actually, after posting this, "iuse" is probably a better name. "huse" came
up because the code constructs i was using before was like:
has foo ${IUSE} && use foo && .....
which collapses into:
h[as foo ${IUSE} && ]use foo && ...
huse foo && ...

so new proposal for those who love 1 liners:
iuse() { in_iuse $1 && use $1 || return 1 ; }
-mike


All times are GMT. The time now is 09:43 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.