From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 7B9F3138262 for ; Fri, 20 May 2016 21:14:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 18EC5142B7; Fri, 20 May 2016 21:14:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8FD99142B7 for ; Fri, 20 May 2016 21:14:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 712D0340B53 for ; Fri, 20 May 2016 21:14:11 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 71AE7334 for ; Fri, 20 May 2016 21:14:09 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1463778808.7e2f80c57ff5dc18b0737e72693e68eea4bc625e.mgorny@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/eapi.sh bin/ebuild.sh X-VCS-Directories: bin/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 7e2f80c57ff5dc18b0737e72693e68eea4bc625e X-VCS-Branch: master Date: Fri, 20 May 2016 21:14:09 +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: b8115435-85c8-44e5-91c1-8bc249a33d04 X-Archives-Hash: bf0ea398d94797883703c1d9f3299be3 commit: 7e2f80c57ff5dc18b0737e72693e68eea4bc625e Author: Michał Górny gentoo org> AuthorDate: Thu May 5 20:49:21 2016 +0000 Commit: Michał Górny gentoo org> CommitDate: Fri May 20 21:13:28 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=7e2f80c5 ebuild: Extend helper-in-global-scope ban to all EAPIs Make helper calls in global scope fatal in all supported EAPIs since this is the behavior required by PMS and all major offenders are fixed already. Acked-by: Alexander Berntsen gentoo.org> Acked-by: Zac Medico gentoo.org> bin/eapi.sh | 4 ---- bin/ebuild.sh | 30 ++++++------------------------ 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/bin/eapi.sh b/bin/eapi.sh index cd3e1a4..a9c56b8 100644 --- a/bin/eapi.sh +++ b/bin/eapi.sh @@ -166,10 +166,6 @@ ___eapi_helpers_can_die() { [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]] } -___eapi_disallows_helpers_in_global_scope() { - [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|5-hdepend)$ ]] -} - ___eapi_unpack_is_case_sensitive() { [[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]] } diff --git a/bin/ebuild.sh b/bin/ebuild.sh index f1586b2..5b3146d 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -59,34 +59,16 @@ else # These dummy functions are for things that are likely to be called # in global scope, even though they are completely useless during # the "depend" phase. - for x in diropts docompress exeopts get_KV insopts \ - KV_major KV_micro KV_minor KV_to_int \ - libopts register_die_hook register_success_hook \ - __strip_duplicate_slashes \ - use_with use_enable ; do - eval "${x}() { - if ___eapi_disallows_helpers_in_global_scope; then - die \"\${FUNCNAME}() calls are not allowed in global scope\" - fi - }" - done - # These dummy functions return false in non-strict EAPIs, in order to ensure that - # `use multislot` is false for the "depend" phase. - funcs="use useq usev" + funcs="diropts docompress exeopts get_KV insopts + KV_major KV_micro KV_minor KV_to_int + libopts register_die_hook register_success_hook + __strip_duplicate_slashes + use useq usev use_with use_enable" ___eapi_has_usex && funcs+=" usex" ___eapi_has_in_iuse && funcs+=" in_iuse" - for x in ${funcs} ; do - eval "${x}() { - if ___eapi_disallows_helpers_in_global_scope; then - die \"\${FUNCNAME}() calls are not allowed in global scope\" - else - return 1 - fi - }" - done # These functions die because calls to them during the "depend" phase # are considered to be severe QA violations. - funcs="best_version has_version portageq" + funcs+=" best_version has_version portageq" ___eapi_has_master_repositories && funcs+=" master_repositories" ___eapi_has_repository_path && funcs+=" repository_path" ___eapi_has_available_eclasses && funcs+=" available_eclasses"