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 D5EE9158128 for ; Wed, 18 Jun 2025 01:15:26 +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 BF892340CCD for ; Wed, 18 Jun 2025 01:15:26 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id B7CA41104D9; Wed, 18 Jun 2025 01:15:25 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 ACE141104D9 for ; Wed, 18 Jun 2025 01:15:25 +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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 31AA3340CBB for ; Wed, 18 Jun 2025 01:15:25 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D2B4228EB for ; Wed, 18 Jun 2025 01:15:23 +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: <1750209304.9d92b90754e89b7afd0b506e2463cc3c9e5010a3.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: 9d92b90754e89b7afd0b506e2463cc3c9e5010a3 X-VCS-Branch: master Date: Wed, 18 Jun 2025 01:15:23 +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: 629d047a-be42-47aa-952b-6ae3719e24dd X-Archives-Hash: 190e7df9eaaa44297e35096131adf18d commit: 9d92b90754e89b7afd0b506e2463cc3c9e5010a3 Author: Kerin Millar plushkava net> AuthorDate: Wed Jun 18 00:00:58 2025 +0000 Commit: Sam James gentoo org> CommitDate: Wed Jun 18 01:15:04 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9d92b907 emerge-webrsync: refrain from invoking die() with no arguments Should a command yield an exit status value other than zero, there in no sense in calling die() unless there is something in particular to be said. Consider the following example, in which chown(1) has failed. chown: changing ownership of '/var/db/repos/gentoo': Operation not permitted emerge-webrsync: The additional (empty) diagnostic message confers no value whatsoever. Presently, there are three instances in which this can occur, all of which concern the main() function. Address the first two by instead calling the exit builtin, and the third by passing an argument to die(). I took the liberty of reducing eight rambling lines (in quintessential Gentoo fashion) to just two, as depicted below. * Invalid sync-type attribute for 'gentoo' repo: 'wrongsync' (expected 'rsync' or 'webrsync') emerge-webrsync: repos.conf validation failed Also, the value of the 'repo_name' variable is now properly incorporated into the diagnostic. Hitherto, it had been hard-coded as "gentoo". Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/emerge-webrsync | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index f0637c2258..d7ad148c20 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -47,10 +47,10 @@ main() { handle_pgp_setup if [[ ! -d ${repo_location} ]]; then - mkdir -p "${repo_location}" || die + mkdir -p "${repo_location}" || exit if contains_word usersync "${FEATURES}"; then - chown "${PORTAGE_USERNAME}":"${PORTAGE_GRPNAME}" "${repo_location}" || die + chown "${PORTAGE_USERNAME}":"${PORTAGE_GRPNAME}" "${repo_location}" || exit fi fi @@ -77,14 +77,8 @@ main() { # This is a sanity check to help prevent people like funtoo users # from accidentally wiping out their git tree. if [[ ${repo_sync_type} != @(''|rsync|webrsync) ]]; then - eerror "The current sync-type attribute of repository 'gentoo' is not set to 'rsync' or 'webrsync':" - eerror - eerror " sync-type=${repo_sync_type}" - eerror - eerror "If you intend to use emerge-webrsync then please" - eerror "adjust sync-type and sync-uri attributes to refer to rsync." - eerror "emerge-webrsync exiting due to abnormal sync-type setting." - die + eerror "Invalid sync-type attribute for ${repo_name@Q} repo: ${repo_sync_type@Q} (expected 'rsync' or 'webrsync')" + die "repos.conf validation failed" fi (( opt[debug] )) && set -x