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 45ACF158074 for ; Fri, 20 Jun 2025 05:45:45 +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 2B607341214 for ; Fri, 20 Jun 2025 05:45:45 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 1DFE91104D9; Fri, 20 Jun 2025 05:45:44 +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 bobolink.gentoo.org (Postfix) with ESMTPS id 175191104D9 for ; Fri, 20 Jun 2025 05:45:44 +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 C1041341051 for ; Fri, 20 Jun 2025 05:45:43 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 63BC62746 for ; Fri, 20 Jun 2025 05:45:42 +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: <1750398335.a243e326cfe29ddd42097a49bf37fe2e9d97cf84.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: a243e326cfe29ddd42097a49bf37fe2e9d97cf84 X-VCS-Branch: master Date: Fri, 20 Jun 2025 05:45:42 +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: 5a3fbc8b-b630-4e4f-aca9-5fa02b847447 X-Archives-Hash: d9f6b448366c93f8d8a98b731de72939 commit: a243e326cfe29ddd42097a49bf37fe2e9d97cf84 Author: Kerin Millar plushkava net> AuthorDate: Thu Jun 19 22:36:34 2025 +0000 Commit: Sam James gentoo org> CommitDate: Fri Jun 20 05:45:35 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a243e326 emerge-webrsync: simplify the tests for emerge and portageq Presently, emerge-webrsync tries to locate the emerge and portageq binaries by capturing the output of type -P then testing whether the output was empty. Simplify these tests by acting upon the exit status of the type builtin itself. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/emerge-webrsync | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index 17e46767ca..ffe8096906 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -606,10 +606,12 @@ do_latest_snapshot() { # 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) -[[ -n ${emerge} ]] || die "could not find 'emerge'; aborting" -portageq=$(PATH="${BASH_SOURCE[0]%/*}:${PATH}" type -P portageq) -[[ -n ${portageq} ]] || die "could not find 'portageq'; aborting" +if ! emerge=$(PATH=${BASH_SOURCE%/*}:${PATH} type -P emerge); then + die "could not find 'emerge'; aborting" +fi +if ! portageq=$(PATH=${BASH_SOURCE%/*}:${PATH} type -P portageq); then + die "could not find 'portageq'; aborting" +fi eval "$("${portageq}" envvar -v DISTDIR EPREFIX FEATURES \ FETCHCOMMAND GENTOO_MIRRORS \