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 BA3FB158128 for ; Tue, 17 Jun 2025 17:58:48 +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) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 9B4023419A3 for ; Tue, 17 Jun 2025 17:58:48 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 9899A1104DC; Tue, 17 Jun 2025 17:58: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) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 930BD1104DC for ; Tue, 17 Jun 2025 17:58: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 0BA69340D19 for ; Tue, 17 Jun 2025 17:58:45 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7906A29EA for ; Tue, 17 Jun 2025 17:58: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: <1750183119.a9b74b15ebdb402b36959c74b53be8110d09e458.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/emerge-webrsync X-VCS-Directories: bin/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: a9b74b15ebdb402b36959c74b53be8110d09e458 X-VCS-Branch: master Date: Tue, 17 Jun 2025 17:58: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: 99e4b354-dc95-4b92-8241-81ff2d1bad08 X-Archives-Hash: 43138b66da586d9a1590dd34dc94b916 commit: a9b74b15ebdb402b36959c74b53be8110d09e458 Author: Kerin Millar plushkava net> AuthorDate: Tue Jun 17 02:48:23 2025 +0000 Commit: Sam James gentoo org> CommitDate: Tue Jun 17 17:58:39 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a9b74b15 emerge-webrsync: override the die() function of isolated-functions.sh Presently, emerge-webrsync declares a simple die() function, only for it be overridden by the implementation from "isolated-functions.sh". The latter implementation is over-engineered and unsuitable for standalone scripts. Address this issue by ensuring that the function is declared after having sourced "isolated-functions.sh". Also, make it act as the implementation from "gentoo-functions.sh" does. It should be noted that this change prevents emerge-webrsync from displaying ridiculous diagnostic messages such as the one below. BEFORE: * ERROR: /:: failed: * signature verification failed * * If you need support, post the output of `emerge --info '=/::'`, * the complete build log and the output of `emerge -pqv '=/::'`. * Working directory: '/var/tmp/portage/webrsync.4UwA9A' AFTER: emerge-webrsync: signature verification failed Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/emerge-webrsync | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index 76d98a9c20..0187f61fa2 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -626,12 +626,6 @@ vvecho() { (( opt[quiet] )) || echo "$@"; } # Only echo if in quiet mode nvecho() { (( ! opt[quiet] )) || echo "$@"; } -# Unfortunately, gentoo-functions doesn't yet have a die() (bug #878505) -die() { - eerror "$@" - exit 1 -} - # Use emerge and portageq from the same directory/prefix as the current script, # so that we don't have to rely on PATH including the current EPREFIX. emerge=$(PATH="${BASH_SOURCE[0]%/*}:${PATH}" type -P emerge) @@ -650,6 +644,20 @@ export http_proxy https_proxy ftp_proxy source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 +# The implementation of die() from isolated-functions.sh is over-engineered and +# unsuitable for standalone scripts. This one mimics gentoo-functions. +die() { + case $? in + 0) + local exitval=1 + ;; + *) + local exitval=$? + esac + printf '%s: %s\n' "${0##*/}" "$*" >&2 + exit "${exitval}" +} + # Opportunistically use gentoo-functions for its implementations of einfo(), # ewarn() and eerror(). As of late, these are better maintained. functions_script="${EPREFIX}/lib/gentoo/functions.sh"