FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 10-19-2011, 06:05 PM
Mike Frysinger
 
Default 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
 
Old 10-19-2011, 06:25 PM
Mike Frysinger
 
Default 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
 

Thread Tools




All times are GMT. The time now is 09:44 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org