Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] huse: new helper for low level eclass writers
Date: Wed, 19 Oct 2011 18:26:08
Message-Id: 201110191425.25675.vapier@gentoo.org
In Reply to: [gentoo-dev] huse: new helper for low level eclass writers by Mike Frysinger
1 On Wednesday 19 October 2011 14:05:50 Mike Frysinger wrote:
2 > now that we have "in_iuse" in eutils.eclass (with all the caveats), i'll be
3 > adding huse:
4 > huse() {
5 > in_iuse $1 || return 1
6 > use $1
7 > }
8
9 actually, after posting this, "iuse" is probably a better name. "huse" came
10 up because the code constructs i was using before was like:
11 has foo ${IUSE} && use foo && .....
12 which collapses into:
13 h[as foo ${IUSE} && ]use foo && ...
14 huse foo && ...
15
16 so new proposal for those who love 1 liners:
17 iuse() { in_iuse $1 && use $1 || return 1 ; }
18 -mike

Attachments

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