/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.363 Revision 1.365
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.363 2011/09/12 20:44:01 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.365 2011/09/29 02:32:20 vapier Exp $
4 4
5# @ECLASS: eutils.eclass 5# @ECLASS: eutils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @BLURB: many extra (but common) functions that are used in ebuilds 8# @BLURB: many extra (but common) functions that are used in ebuilds
2026 case ${opt} in 2026 case ${opt} in
2027 -a) return $(( r != 0 )) ;; 2027 -a) return $(( r != 0 )) ;;
2028 -o) return $(( r == $# )) ;; 2028 -o) return $(( r == $# )) ;;
2029 esac 2029 esac
2030} 2030}
2031
2032# @FUNCTION: in_iuse
2033# @USAGE: <flag>
2034# @DESCRIPTION:
2035# Determines whether the given flag is in IUSE. Strips IUSE default prefixes
2036# as necessary.
2037#
2038# Note that this function should not be used in the global scope.
2039in_iuse() {
2040 debug-print-function ${FUNCNAME} "${@}"
2041 [[ ${#} -eq 1 ]] || die "Invalid args to ${FUNCNAME}()"
2042
2043 local flag=${1}
2044 local liuse=( ${IUSE} )
2045
2046 has "${flag}" "${liuse[@]#[+-]}"
2047}
2048
2049# @FUNCTION: usex
2050# @USAGE: <USE flag> [true output] [false output] [true suffix] [false suffix]
2051# @DESCRIPTION:
2052# If USE flag is set, echo [true output][true suffix] (defaults to "yes"),
2053# otherwise echo [false output][false suffix] (defaults to "no").
2054usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; } #382963

Legend:
Removed from v.1.363  
changed lines
  Added in v.1.365

  ViewVC Help
Powered by ViewVC 1.1.20