-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Marijn Schouten (hkBst) wrote: > In gambit I used: > > econf $(if use static; then echo --disable-shared; else echo --enable-shared; > fi) \ > > could become: > > econf $(_use static --disable-shared --enable-shared) \
as zlin rightly pointed out on irc. That should really be $(use_enable !static shared) so scrap this ``example``. Unfortunately my rewrite has a bug such that it doesn't handle !blah correctly. Fixed version: _use() { local flag=$1 local string_success=$2 local string_failure=$3 local success=0 # invert the return value for "!blah" and strip the '!' [[ ${flag} = !* ]] && { success=1 ; flag=${flag:1} } # Make sure we have this USE flag in IUSE if ! hasq "${flag}" ${IUSE} ${E_IUSE} && ! hasq "${flag}" ${PORTAGE_ARCHLIST} selinux; then eqawarn "QA Notice: USE Flag '${flag}' not in IUSE for ${CATEGORY}/${PF}" fi hasq ${flag} ${USE} || ((success=1-success)) echo $(_if success "${string_success}" "${string_failure}") return success } Marijn - -- Marijn Schouten (hkBst), Gentoo Lisp project <http://www.gentoo.org/proj/en/lisp/>, #gentoo-lisp on FreeNode -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHKgT2p/VmCx0OL2wRAl5eAKCRpLUiH4k3l6bxmCIP7611FG4bIQCgpkeo j+nSg9Dl4rAHX39rg08bWoY= =isO1 -----END PGP SIGNATURE----- -- [EMAIL PROTECTED] mailing list