1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # This eclass contains various utilities used in the Gentoo Lisp overlay
9 # glo_usev flagname [<if_yes> [<if_no>]]
10 # If $(use FLAGNAME) return true, echo IF_YES to standard output,
11 # otherwise echo IF_NO. IF_YES defaults to FLAGNAME if not specified
14 # Echo to stdout the first active USE flag among those supplied as parameters.
15 # If none are active, echo the first one
19 if [[ $# < 1 ||
$# > 3 ]]; then
20 echo "Usage: ${0} flag [if_yes [if_no]]"
21 die
"${0}: wrong number of arguments: $#"
23 local if_yes
="${2:-${1}}" if_no="${3}"
25 printf "%s" "${if_yes}"
28 printf "%s" "${if_no}"
35 echo "Usage: ${0} flag+"
36 die
"${0}: wrong number of arguments: $#"