From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E384F1580EB for ; Fri, 30 May 2025 07:30:55 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id CE32F3430C9 for ; Fri, 30 May 2025 07:30:55 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id A92AB11049F; Fri, 30 May 2025 07:30:45 +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)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 9E71111049F for ; Fri, 30 May 2025 07:30:45 +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 5017D34308D for ; Fri, 30 May 2025 07:30:45 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 48234E9B for ; Fri, 30 May 2025 07:30:43 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1748590234.c73fd9d8a31c396b8669bd9d63fdf4edf63d562d.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/ebuild.sh X-VCS-Directories: bin/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: c73fd9d8a31c396b8669bd9d63fdf4edf63d562d X-VCS-Branch: master Date: Fri, 30 May 2025 07:30:43 +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: 1d5710d3-e1c6-4f5d-8cb8-e395f54b55de X-Archives-Hash: 495b75847c005ee7c58c101d10bc46d6 commit: c73fd9d8a31c396b8669bd9d63fdf4edf63d562d Author: Kerin Millar plushkava net> AuthorDate: Wed May 28 01:39:26 2025 +0000 Commit: Sam James gentoo org> CommitDate: Fri May 30 07:30:34 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=c73fd9d8 ebuild.sh: avoid arbitrarily disabling extglob There are several instances in which a dynamic function declaration could theoretically be interpreted as an extglob, depending on the exact name of the function. Presently, the defence against this is to forcibly disable extglob - an option that is best left untouched except where being wilfully enabled as soon as bash starts. Instead, place a space between the name of the function and the following pair of parentheses. I must add that bash never enables the extglob option unless it is directly instructed to do so. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/ebuild.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 63fd0117d8..63ca68c8c4 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -88,7 +88,7 @@ else # are considered to be severe QA violations. funcs+=" best_version has_version portageq" for x in ${funcs} ; do - eval "${x}() { die \"\${FUNCNAME}() calls are not allowed in global scope\"; }" + eval "${x} () { die \"\${FUNCNAME}() calls are not allowed in global scope\"; }" done unset funcs x @@ -489,9 +489,6 @@ __try_source() { export SANDBOX_ON="1" export S=${WORKDIR}/${P} -# Turn off extended glob matching so that g++ doesn't get incorrectly matched. -shopt -u extglob - if [[ ${EBUILD_PHASE} == depend ]] ; then QA_INTERCEPTORS="awk bash cc egrep equery fgrep g++ gawk gcc grep javac java-config nawk perl @@ -512,7 +509,7 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then BODY="${BIN_PATH} \"\$@\"; return \$?" fi if [[ ${EBUILD_PHASE} == depend ]] ; then - FUNC_SRC="${BIN}() { + FUNC_SRC="${BIN} () { if [[ \${ECLASS_DEPTH} -gt 0 ]]; then eqawarn \"QA Notice: '${BIN}' called in global scope: eclass \${ECLASS}\" else @@ -521,7 +518,7 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then ${BODY} }" elif [[ ${BIN} == @(autoconf|automake|aclocal|libtoolize) ]]; then - FUNC_SRC="${BIN}() { + FUNC_SRC="${BIN} () { case \${FUNCNAME[1]} in eautoreconf |\\ eaclocal |\\ @@ -541,7 +538,7 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then ${BODY} }" else - FUNC_SRC="${BIN}() { + FUNC_SRC="${BIN} () { eqawarn \"QA Notice: '${BIN}' called by \${FUNCNAME[1]}: \${CATEGORY}/\${PF}\" ${BODY} }"