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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1DCBF1581FB for ; Mon, 26 Aug 2024 06:31:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 55D9EE2A80; Mon, 26 Aug 2024 06:31:07 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3407CE2A7D for ; Mon, 26 Aug 2024 06:31:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 33A22340C53 for ; Mon, 26 Aug 2024 06:31:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 919A01F0E for ; Mon, 26 Aug 2024 06:31:04 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1724625366.15ae9d83694e073d09e68967a4940fe0ef16f063.asturm@gentoo> Subject: [gentoo-commits] proj/kde:master commit in: eclass/ X-VCS-Repository: proj/kde X-VCS-Files: eclass/ecm-common.eclass X-VCS-Directories: eclass/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 15ae9d83694e073d09e68967a4940fe0ef16f063 X-VCS-Branch: master Date: Mon, 26 Aug 2024 06:31:04 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0e7ee9eb-d8d7-459b-909b-caeff6602644 X-Archives-Hash: 1649a7019b5f2d4d93fdcb32acee2c58 commit: 15ae9d83694e073d09e68967a4940fe0ef16f063 Author: Andreas Sturmlechner gentoo org> AuthorDate: Sun Aug 25 22:29:07 2024 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Sun Aug 25 22:36:06 2024 +0000 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=15ae9d83 ecm-common.eclass: Add _ecm-common-check_deps to simplify pkg_setup() Bug: https://bugs.gentoo.org/938507 Signed-off-by: Andreas Sturmlechner gentoo.org> eclass/ecm-common.eclass | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/eclass/ecm-common.eclass b/eclass/ecm-common.eclass index 63a23878c6..c0c2b4f7e6 100644 --- a/eclass/ecm-common.eclass +++ b/eclass/ecm-common.eclass @@ -309,6 +309,38 @@ _ecm-common_summary() { _EOF_ } +# @FUNCTION: _ecm-common-check_deps +# @INTERNAL +# @DESCRIPTION: +# Check existence of requested KF6 dependencies. +_ecm-common-check_deps() { + local chk=0 + case ${1} in + i18n) + if [[ ${ECM_I18N} ]]; then + chk=$(has_version -b "kde-frameworks/ki18n:6") + fi + ;; + doctools) + if [[ ${ECM_HANDBOOK} ]] && in_iuse handbook; then + if use handbook; then + chk=$(has_version -b "kde-frameworks/kdoctools:6") + fi + fi + ;; + kcmutils) + if [[ ${ECM_KCM_TARGETS} ]]; then + chk=$(has_version -b "kde-frameworks/kcmutils:6") + fi + ;; + *) + eerror "Unknown value for _ecm-common-check_deps()" + die "Value ${1} is not supported" + ;; + esac + return ${chk} +} + # @FUNCTION: ecm-common-check_deps # @DESCRIPTION: # Override this to add more KF6 has_version checks to pkg_setup(), @@ -327,15 +359,8 @@ ecm-common-check_deps() { ecm-common_pkg_setup() { $(ver_test ${KFMIN} -ge 5.240) && return - if has_version -b "kde-frameworks/ki18n:6" && { - ! in_iuse handbook || { - in_iuse handbook && use handbook && - has_version -b "kde-frameworks/kdoctools:6" - } - } && { - ! [[ ${ECM_KCM_TARGETS} ]] || - has_version -b "kde-frameworks/kcmutils:6" - } && ecm-common-check_deps + if _ecm-common-check_deps i18n && _ecm-common-check_deps doctools && + _ecm-common-check_deps kcmutils && ecm-common-check_deps then _KFSLOT=6 else