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 4E0FB158128 for ; Wed, 18 Jun 2025 09:52:09 +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 381C7341EB6 for ; Wed, 18 Jun 2025 09:52:09 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 5C8CD1104DE; Wed, 18 Jun 2025 09:52:04 +0000 (UTC) Received: from smtp.gentoo.org (mail.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 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 539F21104DE for ; Wed, 18 Jun 2025 09:52:04 +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 12440341CC6 for ; Wed, 18 Jun 2025 09:52:04 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A9E9329F6 for ; Wed, 18 Jun 2025 09:52:02 +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: <1750240318.40559d6068501c937cdac88abc502d4f65ffe737.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: 40559d6068501c937cdac88abc502d4f65ffe737 X-VCS-Branch: master Date: Wed, 18 Jun 2025 09:52:02 +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: 9c8a706b-51e8-4644-837b-0f7f09a27f5c X-Archives-Hash: cd1d2f9c02c875bd6870e71c885667d2 commit: 40559d6068501c937cdac88abc502d4f65ffe737 Author: Kerin Millar plushkava net> AuthorDate: Wed Jun 18 03:14:25 2025 +0000 Commit: Sam James gentoo org> CommitDate: Wed Jun 18 09:51:58 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=40559d60 emerge-webrsync: simplify ownership variable logic in sync_local() As concerns the sync_local() function, have one single if command determine which value is assigned to the 'ownership' variable. Further, check whether stat(1) succeeds and exit if it does not. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/emerge-webrsync | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index 64bc92fb2c..174df11aad 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -389,17 +389,13 @@ sync_local() { einfo "Syncing local repository ..." - ownership="${PORTAGE_USERNAME}:${PORTAGE_GRPNAME}" - if contains_word usersync "${FEATURES}"; then - case "${USERLAND}" in - BSD) - ownership=$(stat -f '%Su:%Sg' "${repo_location}") - ;; - *) - ownership=$(stat -c '%U:%G' "${repo_location}") - ;; - esac - fi + if ! contains_word usersync "${FEATURES}"; then + ownership="${PORTAGE_USERNAME}:${PORTAGE_GRPNAME}" + elif [[ ${USERLAND} == BSD ]]; then + ownership=$(stat -f '%Su:%Sg' "${repo_location}") + else + ownership=$(stat -c '%U:%G' "${repo_location}") + fi || exit if type -P tarsync > /dev/null ; then tarsync_opts=( -s 1 -e /distfiles -e /packages -e /local )