summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-09-29 02:32:20 +0000
committerMike Frysinger <vapier@gentoo.org>2011-09-29 02:32:20 +0000
commita0648ff4c5653207c6787cb072c3842b498e8690 (patch)
tree3e51bc5280d1be1be0f53367002b51a537372a5a /eclass
parentAdded forgotten patch. (diff)
downloadgentoo-2-a0648ff4c5653207c6787cb072c3842b498e8690.tar.gz
gentoo-2-a0648ff4c5653207c6787cb072c3842b498e8690.tar.bz2
gentoo-2-a0648ff4c5653207c6787cb072c3842b498e8690.zip
add usex() helper #382963
Diffstat (limited to 'eclass')
-rw-r--r--eclass/eutils.eclass9
1 files changed, 8 insertions, 1 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index d202031b8f98..92490ff96729 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.364 2011/09/21 21:46:49 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.365 2011/09/29 02:32:20 vapier Exp $
# @ECLASS: eutils.eclass
# @MAINTAINER:
@@ -2045,3 +2045,10 @@ in_iuse() {
has "${flag}" "${liuse[@]#[+-]}"
}
+
+# @FUNCTION: usex
+# @USAGE: <USE flag> [true output] [false output] [true suffix] [false suffix]
+# @DESCRIPTION:
+# If USE flag is set, echo [true output][true suffix] (defaults to "yes"),
+# otherwise echo [false output][false suffix] (defaults to "no").
+usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; } #382963