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

Diff of /eclass/eutils.eclass

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

Revision 1.366 Revision 1.367
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.366 2011/09/30 16:51:01 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.367 2011/10/26 23:27:16 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
2045 local liuse=( ${IUSE} ) 2045 local liuse=( ${IUSE} )
2046 2046
2047 has "${flag}" "${liuse[@]#[+-]}" 2047 has "${flag}" "${liuse[@]#[+-]}"
2048} 2048}
2049 2049
2050# @FUNCTION: use_if_iuse
2051# @USAGE: <flag>
2052# @DESCRIPTION:
2053# Return true if the given flag is in USE and IUSE.
2054#
2055# Note that this function should not be used in the global scope.
2056use_if_iuse() {
2057 in_iuse $1 || return 1
2058 use $1
2059}
2060
2050# @FUNCTION: usex 2061# @FUNCTION: usex
2051# @USAGE: <USE flag> [true output] [false output] [true suffix] [false suffix] 2062# @USAGE: <USE flag> [true output] [false output] [true suffix] [false suffix]
2052# @DESCRIPTION: 2063# @DESCRIPTION:
2053# If USE flag is set, echo [true output][true suffix] (defaults to "yes"), 2064# If USE flag is set, echo [true output][true suffix] (defaults to "yes"),
2054# otherwise echo [false output][false suffix] (defaults to "no"). 2065# otherwise echo [false output][false suffix] (defaults to "no").

Legend:
Removed from v.1.366  
changed lines
  Added in v.1.367

  ViewVC Help
Powered by ViewVC 1.1.20