Gentoo Archives: gentoo-dev

From: Donnie Berkholz <dberkholz@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] New eclass: scons.eclass
Date: Wed, 06 Oct 2010 17:53:13
Message-Id: 20101006175232.GA28978@comet.mayo.edu
In Reply to: Re: [gentoo-dev] New eclass: scons.eclass by "Michał Górny"
1 On 20:57 Tue 05 Oct , Michał Górny wrote:
2 > # @FUNCTION: use_scons
3 > # @USAGE: <use-flag> [var-name] [var-opt-true] [var-opt-false]
4 > # @DESCRIPTION:
5 > # Output an SCons parameter with value depending on the USE flag state.
6 > # If the USE flag is set, output <var-name>=<var-opt-true>; otherwise
7 > # <var-name>=<var-opt-false>.
8 > #
9 > # If <var-name> is not set, <use-flag> will be used instead.
10 > # If <var-opt-true> or <var-opt-false> is unset, USE_SCONS_TRUE
11 > # or USE_SCONS_FALSE will be used instead.
12 > use_scons() {
13 > local flag=${1}
14 > local varname=${2:-${flag#!}}
15
16 Could you explain how this works to me, please? It seems like you're
17 reversing the logic when people use the !flag syntax.
18
19 > local vartrue=${3:-${USE_SCONS_TRUE}}
20 > local varfalse=${4:-${USE_SCONS_FALSE}}
21
22 --
23 Thanks,
24 Donnie
25
26 Donnie Berkholz
27 Sr. Developer, Gentoo Linux
28 Blog: http://dberkholz.wordpress.com

Replies

Subject Author
Re: [gentoo-dev] New eclass: scons.eclass "Michał Górny" <mgorny@g.o>