Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Fri, 27 Apr 2018 14:01:37
Message-Id: 1524837684.5bb71fa789537a44f6c76a2397cd39198df17496.polynomial-c@gentoo
1 commit: 5bb71fa789537a44f6c76a2397cd39198df17496
2 Author: Rolf Eike Beer <eike <AT> sf-mail <DOT> de>
3 AuthorDate: Tue Mar 27 16:19:57 2018 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 27 14:01:24 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5bb71fa7
7
8 apache-2.eclass: avoid multiple selected MPMs by REQUIRED_USE
9
10 Still allow that none was given so automatic selection depending on threads
11 useflag still works as before.
12
13 eclass/apache-2.eclass | 37 ++++++++++++++++++++++++-------------
14 1 file changed, 24 insertions(+), 13 deletions(-)
15
16 diff --git a/eclass/apache-2.eclass b/eclass/apache-2.eclass
17 index 8eae93fb1d6..ee70b2f222f 100644
18 --- a/eclass/apache-2.eclass
19 +++ b/eclass/apache-2.eclass
20 @@ -97,9 +97,24 @@ for module in ${IUSE_MODULES} ; do
21 IUSE="${IUSE} apache2_modules_${module}"
22 done
23
24 -for mpm in ${IUSE_MPMS} ; do
25 - IUSE="${IUSE} apache2_mpms_${mpm}"
26 -done
27 +_apache2_set_mpms() {
28 + local mpm
29 + local ompm
30 +
31 + for mpm in ${IUSE_MPMS} ; do
32 + IUSE="${IUSE} apache2_mpms_${mpm}"
33 +
34 + REQUIRED_USE="${REQUIRED_USE} apache2_mpms_${mpm}? ("
35 + for ompm in ${IUSE_MPMS} ; do
36 + if [[ "${mpm}" != "${ompm}" ]] ; then
37 + REQUIRED_USE="${REQUIRED_USE} !apache2_mpms_${ompm}"
38 + fi
39 + done
40 + REQUIRED_USE="${REQUIRED_USE} )"
41 + done
42 +}
43 +_apache2_set_mpms
44 +unset -f _apache2_set_mpms
45
46 DEPEND="${CDEPEND}
47 dev-lang/perl
48 @@ -152,16 +167,12 @@ setup_mpm() {
49 MY_MPM=""
50 for x in ${IUSE_MPMS} ; do
51 if use apache2_mpms_${x} ; then
52 - if [[ -z "${MY_MPM}" ]] ; then
53 - MY_MPM=${x}
54 - elog
55 - elog "Selected MPM: ${MY_MPM}"
56 - elog
57 - else
58 - eerror "You have selected more then one mpm USE-flag."
59 - eerror "Only one MPM is supported."
60 - die "more then one mpm was specified"
61 - fi
62 + # there can at most be one MPM selected because of REQUIRED_USE constraints
63 + MY_MPM=${x}
64 + elog
65 + elog "Selected MPM: ${MY_MPM}"
66 + elog
67 + break
68 fi
69 done