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 5EEA115806E for ; Sat, 13 May 2023 20:29:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 68D62E07EF; Sat, 13 May 2023 20:29:49 +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 389E6E07EF for ; Sat, 13 May 2023 20:29:49 +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 E4A16335D91 for ; Sat, 13 May 2023 20:29:47 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5E1257F5 for ; Sat, 13 May 2023 20:29:46 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1684008805.4bc369c549c34a757c799e3f6df1214cd1da12ef.ulm@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ebuild-helpers/, /, bin/ X-VCS-Repository: proj/portage X-VCS-Files: NEWS bin/ebuild-helpers/portageq bin/phase-helpers.sh bin/portageq-wrapper X-VCS-Directories: / bin/ebuild-helpers/ bin/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 4bc369c549c34a757c799e3f6df1214cd1da12ef X-VCS-Branch: master Date: Sat, 13 May 2023 20:29:46 +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: 8925b5c9-0cbe-4565-b872-287458101297 X-Archives-Hash: 4198d7fe204130bc36a98b98e190ecb8 commit: 4bc369c549c34a757c799e3f6df1214cd1da12ef Author: Ulrich Müller gentoo org> AuthorDate: Sat May 13 10:35:50 2023 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Sat May 13 20:13:25 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4bc369c5 portageq-wrapper: New wrapper script Move the internal portageq wrapper script out of the ebuild-helpers directory. Call the new script from best_version and has_version in the case when IPC is disabled. The goal is to ban portageq from the ebuild environment after some transition time. Bug: https://bugs.gentoo.org/906129 Fixes: ab538e7750fb85d57a3eb9d9b440848c1f2c074a Signed-off-by: Ulrich Müller gentoo.org> NEWS | 4 ++++ bin/ebuild-helpers/portageq | 24 +---------------------- bin/phase-helpers.sh | 2 +- bin/{ebuild-helpers/portageq => portageq-wrapper} | 19 ++++-------------- 4 files changed, 10 insertions(+), 39 deletions(-) diff --git a/NEWS b/NEWS index 6d039c84f..e282d3f3c 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,10 @@ Breaking changes: * Output deprecation warnings for portageq, prepstrip and prepallstrip when they are called from an ebuild (bug #906129, bug #906156). +Cleanups: +* Move the internal portageq wrapper script out of the ebuild-helpers + directory. + portage-3.0.48 (UNRELEASED) -------------- Bug fixes: diff --git a/bin/ebuild-helpers/portageq b/bin/ebuild-helpers/portageq index 0df0cd273..e3926e11a 100755 --- a/bin/ebuild-helpers/portageq +++ b/bin/ebuild-helpers/portageq @@ -2,29 +2,7 @@ # Copyright 2009-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -scriptpath=${BASH_SOURCE[0]} -scriptname=${scriptpath##*/} - source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 eqawarn "QA Notice: '${0##*/}' is not allowed in ebuild scope" - -# Use safe cwd, avoiding unsafe import for bug #469338. -cd "${PORTAGE_PYM_PATH}" || exit 1 - -IFS=':' -set -f # in case ${PATH} contains any shell glob characters - -for path in ${PATH}; do - [[ -x ${path}/${scriptname} ]] || continue - [[ ${path} == */portage/*/ebuild-helpers* ]] && continue - [[ ${path}/${scriptname} -ef ${scriptpath} ]] && continue - - PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \ - exec "${PORTAGE_PYTHON:-/usr/bin/python}" \ - "${path}/${scriptname}" "$@" -done - -unset IFS -echo "${scriptname}: command not found" 1>&2 -exit 127 +exec "${PORTAGE_BIN_PATH}"/portageq-wrapper "$@" diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index af96b73e4..f1b762b0a 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -963,7 +963,7 @@ ___best_version_and_has_version_common() { if [[ -n ${PORTAGE_IPC_DAEMON} ]] ; then cmd+=("${PORTAGE_BIN_PATH}"/ebuild-ipc "${FUNCNAME[1]}" "${root}" "${atom}") else - cmd+=("${PORTAGE_BIN_PATH}"/ebuild-helpers/portageq "${FUNCNAME[1]}" "${root}" "${atom}") + cmd+=("${PORTAGE_BIN_PATH}"/portageq-wrapper "${FUNCNAME[1]}" "${root}" "${atom}") fi "${cmd[@]}" diff --git a/bin/ebuild-helpers/portageq b/bin/portageq-wrapper similarity index 50% copy from bin/ebuild-helpers/portageq copy to bin/portageq-wrapper index 0df0cd273..2ca4052c4 100755 --- a/bin/ebuild-helpers/portageq +++ b/bin/portageq-wrapper @@ -2,29 +2,18 @@ # Copyright 2009-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -scriptpath=${BASH_SOURCE[0]} -scriptname=${scriptpath##*/} - -source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 - -eqawarn "QA Notice: '${0##*/}' is not allowed in ebuild scope" - # Use safe cwd, avoiding unsafe import for bug #469338. cd "${PORTAGE_PYM_PATH}" || exit 1 -IFS=':' +IFS=":" set -f # in case ${PATH} contains any shell glob characters for path in ${PATH}; do - [[ -x ${path}/${scriptname} ]] || continue [[ ${path} == */portage/*/ebuild-helpers* ]] && continue - [[ ${path}/${scriptname} -ef ${scriptpath} ]] && continue - + [[ -x ${path}/portageq ]] || continue PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \ - exec "${PORTAGE_PYTHON:-/usr/bin/python}" \ - "${path}/${scriptname}" "$@" + exec "${PORTAGE_PYTHON:-/usr/bin/python}" "${path}/portageq" "$@" done -unset IFS -echo "${scriptname}: command not found" 1>&2 +echo "portageq: command not found" >&2 exit 127