summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2018-03-27 18:19:57 +0200
committerLars Wendler <polynomial-c@gentoo.org>2018-04-27 16:01:24 +0200
commit5bb71fa789537a44f6c76a2397cd39198df17496 (patch)
tree63f4be386dcf81af6f83725b73a26ae6c19b153a /eclass/apache-2.eclass
parentapache-2.eclass: reflect module dependencies to REQUIRED_USE (diff)
downloadgentoo-5bb71fa789537a44f6c76a2397cd39198df17496.tar.gz
gentoo-5bb71fa789537a44f6c76a2397cd39198df17496.tar.bz2
gentoo-5bb71fa789537a44f6c76a2397cd39198df17496.zip
apache-2.eclass: avoid multiple selected MPMs by REQUIRED_USE
Still allow that none was given so automatic selection depending on threads useflag still works as before.
Diffstat (limited to 'eclass/apache-2.eclass')
-rw-r--r--eclass/apache-2.eclass37
1 files changed, 24 insertions, 13 deletions
diff --git a/eclass/apache-2.eclass b/eclass/apache-2.eclass
index 8eae93fb1d6b..ee70b2f222f5 100644
--- a/eclass/apache-2.eclass
+++ b/eclass/apache-2.eclass
@@ -97,9 +97,24 @@ for module in ${IUSE_MODULES} ; do
IUSE="${IUSE} apache2_modules_${module}"
done
-for mpm in ${IUSE_MPMS} ; do
- IUSE="${IUSE} apache2_mpms_${mpm}"
-done
+_apache2_set_mpms() {
+ local mpm
+ local ompm
+
+ for mpm in ${IUSE_MPMS} ; do
+ IUSE="${IUSE} apache2_mpms_${mpm}"
+
+ REQUIRED_USE="${REQUIRED_USE} apache2_mpms_${mpm}? ("
+ for ompm in ${IUSE_MPMS} ; do
+ if [[ "${mpm}" != "${ompm}" ]] ; then
+ REQUIRED_USE="${REQUIRED_USE} !apache2_mpms_${ompm}"
+ fi
+ done
+ REQUIRED_USE="${REQUIRED_USE} )"
+ done
+}
+_apache2_set_mpms
+unset -f _apache2_set_mpms
DEPEND="${CDEPEND}
dev-lang/perl
@@ -152,16 +167,12 @@ setup_mpm() {
MY_MPM=""
for x in ${IUSE_MPMS} ; do
if use apache2_mpms_${x} ; then
- if [[ -z "${MY_MPM}" ]] ; then
- MY_MPM=${x}
- elog
- elog "Selected MPM: ${MY_MPM}"
- elog
- else
- eerror "You have selected more then one mpm USE-flag."
- eerror "Only one MPM is supported."
- die "more then one mpm was specified"
- fi
+ # there can at most be one MPM selected because of REQUIRED_USE constraints
+ MY_MPM=${x}
+ elog
+ elog "Selected MPM: ${MY_MPM}"
+ elog
+ break
fi
done