From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7FA141382C5 for ; Fri, 27 Apr 2018 14:01:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AE38DE0877; Fri, 27 Apr 2018 14:01:35 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 730AFE0877 for ; Fri, 27 Apr 2018 14:01:35 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BDD01335C72 for ; Fri, 27 Apr 2018 14:01:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 081C0272 for ; Fri, 27 Apr 2018 14:01:32 +0000 (UTC) From: "Lars Wendler" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Lars Wendler" Message-ID: <1524837682.097e96d6ec6140d386e28905ebbd004809ead87c.polynomial-c@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/apache-2.eclass X-VCS-Directories: eclass/ X-VCS-Committer: polynomial-c X-VCS-Committer-Name: Lars Wendler X-VCS-Revision: 097e96d6ec6140d386e28905ebbd004809ead87c X-VCS-Branch: master Date: Fri, 27 Apr 2018 14:01:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: d6fe6c52-7644-428f-b151-9736468b6f10 X-Archives-Hash: f78c810c3409d832d83f4be0fab8d447 commit: 097e96d6ec6140d386e28905ebbd004809ead87c Author: Rolf Eike Beer sf-mail de> AuthorDate: Tue Mar 27 15:58:27 2018 +0000 Commit: Lars Wendler gentoo org> CommitDate: Fri Apr 27 14:01:22 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=097e96d6 apache-2.eclass: reflect module dependencies to REQUIRED_USE Portage can do all the checks automatically, with the added bonus that they can get tested with the portage API, which helps e.g. tatt finding out valid combinations of use flags. Closes: https://github.com/gentoo/gentoo/pull/7650 eclass/apache-2.eclass | 47 +++++++++++++++++------------------------------ 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/eclass/apache-2.eclass b/eclass/apache-2.eclass index 91ff966c8f1..8eae93fb1d6 100644 --- a/eclass/apache-2.eclass +++ b/eclass/apache-2.eclass @@ -119,6 +119,23 @@ PDEPEND="~app-admin/apache-tools-${PV}" S="${WORKDIR}/httpd-${PV}" +# @VARIABLE: MODULE_DEPENDS +# @DESCRIPTION: +# This variable needs to be set in the ebuild and contains a space-separated +# list of dependency tokens each with a module and the module it depends on +# separated by a colon + +# now extend REQUIRED_USE to reflect the module dependencies to portage +_apache2_set_module_depends() { + local dep + + for dep in ${MODULE_DEPENDS} ; do + REQUIRED_USE="${REQUIRED_USE} apache2_modules_${dep%:*}? ( apache2_modules_${dep#*:} )" + done +} +_apache2_set_module_depends +unset -f _apache2_set_module_depends + # ============================================================================== # INTERNAL FUNCTIONS # ============================================================================== @@ -207,35 +224,6 @@ check_module_critical() { fi } -# @VARIABLE: MODULE_DEPENDS -# @DESCRIPTION: -# This variable needs to be set in the ebuild and contains a space-separated -# list of dependency tokens each with a module and the module it depends on -# separated by a colon - -# @FUNCTION: check_module_depends -# @DESCRIPTION: -# This internal function makes sure that all inter-module dependencies are -# satisfied with the current module selection -check_module_depends() { - local err=0 - - for m in ${MY_MODS[@]} ; do - for dep in ${MODULE_DEPENDS} ; do - if [[ "${m}" == "${dep%:*}" ]] ; then - if ! use apache2_modules_${dep#*:} ; then - eerror "Module '${m}' depends on '${dep#*:}'" - err=1 - fi - fi - done - done - - if [[ ${err} -ne 0 ]] ; then - die "invalid use flag combination" - fi -} - # @ECLASS-VARIABLE: MY_CONF # @DESCRIPTION: # This internal variable contains the econf options for the current module @@ -316,7 +304,6 @@ setup_modules() { # sort and uniquify MY_MODS MY_MODS=( $(echo ${MY_MODS[@]} | tr ' ' '\n' | sort -u) ) - check_module_depends check_module_critical }