summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorDavide Pesavento <pesa@gentoo.org>2011-12-27 16:04:27 +0000
committerDavide Pesavento <pesa@gentoo.org>2011-12-27 16:04:27 +0000
commit82aa7310c004a4a4de368db14e21e37a6bf416f1 (patch)
treef591180c871d795152c891c944247e4e2a6bece5 /eclass
parentAlso require rspec:2 with USE=doc since it is required for the Rakefile, fixe... (diff)
downloadgentoo-2-82aa7310c004a4a4de368db14e21e37a6bf416f1.tar.gz
gentoo-2-82aa7310c004a4a4de368db14e21e37a6bf416f1.tar.bz2
gentoo-2-82aa7310c004a4a4de368db14e21e37a6bf416f1.zip
Reimplement qt_use() more concisely, fix/clarify doc.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/qt4-build.eclass21
1 files changed, 5 insertions, 16 deletions
diff --git a/eclass/qt4-build.eclass b/eclass/qt4-build.eclass
index 8ac1358e7da8..7db4959475e4 100644
--- a/eclass/qt4-build.eclass
+++ b/eclass/qt4-build.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/qt4-build.eclass,v 1.110 2011/12/26 11:59:19 pesa Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.111 2011/12/27 16:04:27 pesa Exp $
# @ECLASS: qt4-build.eclass
# @MAINTAINER:
@@ -726,23 +726,12 @@ fix_library_files() {
# @FUNCTION: qt_use
# @USAGE: < flag > [ feature ] [ enableval ]
# @DESCRIPTION:
-# This will echo "${enableval}-${feature}" if <flag> is enabled, or
-# "-no-${feature} if the flag is disabled. If [feature] is not specified <flag>
+# This will echo "-${enableval}-${feature}" if <flag> is enabled, or
+# "-no-${feature}" if it's disabled. If [feature] is not specified, <flag>
# will be used for that. If [enableval] is not specified, it omits the
-# assignment part.
+# "-${enableval}" part.
qt_use() {
- local flag=$1
- local feature=$1
- local enableval=
-
- [[ -n $2 ]] && feature=$2
- [[ -n $3 ]] && enableval=-$3
-
- if use ${flag}; then
- echo "${enableval}-${feature}"
- else
- echo "-no-${feature}"
- fi
+ use "$1" && echo "${3:+-$3}-${2:-$1}" || echo "-no-${2:-$1}"
}
# @FUNCTION: qt_mkspecs_dir