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 E2654158128 for ; Tue, 17 Jun 2025 23:42:18 +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 CEA4F341A5B for ; Tue, 17 Jun 2025 23:42:18 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 136951104DC; Tue, 17 Jun 2025 23:42:15 +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 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 0323C1104D9 for ; Tue, 17 Jun 2025 23:42:14 +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 A03C73415FE for ; Tue, 17 Jun 2025 23:42:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0BC1D29EB for ; Tue, 17 Jun 2025 23:42:13 +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: <1750203647.69e5b3079697d03ed38422327f917f1633c64a02.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: 69e5b3079697d03ed38422327f917f1633c64a02 X-VCS-Branch: master Date: Tue, 17 Jun 2025 23:42:13 +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: fdc35dd0-e5fa-4f93-8811-52f9cca4e843 X-Archives-Hash: d439b3393e30bc289194dd70d8de27b4 commit: 69e5b3079697d03ed38422327f917f1633c64a02 Author: Kerin Millar plushkava net> AuthorDate: Tue Jun 17 22:34:27 2025 +0000 Commit: Sam James gentoo org> CommitDate: Tue Jun 17 23:40:47 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=69e5b307 emerge-webrsync: simplify the do_tar() function Simplify the do_tar() function by having the case statement assume responsibility for dispatching the decompression command, and by having it be the first stage of the pipeline. Further, replace the buggy PIPESTATUS handling (sensitive to the value of IFS) by enabling the pipefail shell option in function scope. Doing so is acceptable, given a target of bash >=4.4. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/emerge-webrsync | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index 93b1674a86..1f4830e795 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -161,19 +161,18 @@ handle_pgp_setup() { } do_tar() { - local file=$1 - local decompressor - shift - - case ${file} in - *.xz) decompressor="xzcat" ;; - *.bz2) decompressor="bzcat" ;; - *.gz) decompressor="zcat" ;; - *) decompressor="cat" ;; - esac - ${decompressor} "${file}" | tar "$@" - _pipestatus=${PIPESTATUS[*]} - [[ ${_pipestatus// /} -eq 0 ]] + local - + + shopt -o -s pipefail + case $1 in + *.xz) xzcat "$1" ;; + *.bz2) bzcat "$1" ;; + *.gz) zcat "$1" ;; + *) cat "$1" ;; + esac | { + shift + tar "$@" + } } get_utc_date_in_seconds() {