From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1669278-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id B92FC158083
	for <garchives@archives.gentoo.org>; Tue, 10 Sep 2024 10:29:28 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id EFD75E2A03;
	Tue, 10 Sep 2024 10:29:27 +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))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id CC8FFE29FB
	for <gentoo-commits@lists.gentoo.org>; Tue, 10 Sep 2024 10:29:27 +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))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id E1ED4341B52
	for <gentoo-commits@lists.gentoo.org>; Tue, 10 Sep 2024 10:29:26 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 7B12914D0
	for <gentoo-commits@lists.gentoo.org>; Tue, 10 Sep 2024 10:29:25 +0000 (UTC)
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" <ulm@gentoo.org>
Message-ID: <1725964150.6e454ea3b8e5e1aa0f4d9efcb42759dc5ec0ec99.ulm@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: bin/
X-VCS-Repository: proj/portage
X-VCS-Files: bin/phase-helpers.sh
X-VCS-Directories: bin/
X-VCS-Committer: ulm
X-VCS-Committer-Name: Ulrich Müller
X-VCS-Revision: 6e454ea3b8e5e1aa0f4d9efcb42759dc5ec0ec99
X-VCS-Branch: master
Date: Tue, 10 Sep 2024 10:29:25 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 0d89653c-b4da-4e14-9ed2-09a4ebdbba9b
X-Archives-Hash: 8c7e70cb4afaad6d83c6a4963b1c1fc8

commit:     6e454ea3b8e5e1aa0f4d9efcb42759dc5ec0ec99
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  9 15:30:25 2024 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Sep 10 10:29:10 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6e454ea3

unpack: Don't display "Unpacking ..." for skipped files

PMS says that "Any unrecognised file format shall be skipped silently."
This wording was added with the draft of what later became EAPI 4:
https://gitweb.gentoo.org/proj/pms.git/commit/?id=634c32f231e1bc94d64588e2b2edf0ad1ca60f1f

The commit message doesn't give any rationale for "silently".
It may well be that the wording is a remnant of the rejected
"unpack --if-compressed" item.

See the discussion in the 2009-04-23 council meeting:
https://projects.gentoo.org/council/meeting-logs/20090423.txt
(starting at 21:35).

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/phase-helpers.sh | 49 ++++++++++++++++++++++++++++---------------------
 1 file changed, 28 insertions(+), 21 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 77132eb066..164f62143d 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 if ___eapi_has_DESTTREE_INSDESTTREE; then
@@ -321,13 +321,13 @@ unpack() {
 	local x
 	local y y_insensitive
 	local suffix suffix_insensitive
+	local suffix_known
 	local myfail
 	local eapi=${EAPI:-0}
 
 	[[ -z "$*" ]] && die "Nothing passed to the 'unpack' command"
 
 	for x in "$@"; do
-		__vecho ">>> Unpacking ${x} to ${PWD}"
 		suffix=${x##*.}
 		suffix_insensitive=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${suffix}")
 		y=${x%.*}
@@ -360,6 +360,23 @@ unpack() {
 		fi
 		[[ ! -s ${srcdir}${x} ]] && die "unpack: ${x} does not exist"
 
+		suffix_known=""
+		case ${suffix_insensitive} in
+			tar|tgz|tbz2|tbz|zip|jar|gz|z|bz2|bz|a|deb|lzma) suffix_known=1 ;;
+			7z)      ___eapi_unpack_supports_7z  && suffix_known=1 ;;
+			rar)     ___eapi_unpack_supports_rar && suffix_known=1 ;;
+			lha|lzh) ___eapi_unpack_supports_lha && suffix_known=1 ;;
+			xz)      ___eapi_unpack_supports_xz  && suffix_known=1 ;;
+			txz)     ___eapi_unpack_supports_txz && suffix_known=1 ;;
+		esac
+
+		if [[ -n ${suffix_known} ]]; then
+			__vecho ">>> Unpacking ${x} to ${PWD}"
+		else
+			__vecho "=== Skipping unpack of ${x}"
+			continue
+		fi
+
 		__unpack_tar() {
 			if [[ ${y_insensitive} == tar ]] ; then
 				if ___eapi_unpack_is_case_sensitive && \
@@ -439,13 +456,11 @@ unpack() {
 				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
 				;;
 			7z)
-				if ___eapi_unpack_supports_7z; then
-					local my_output
-					my_output="$(7z x -y "${srcdir}${x}")"
-					if [[ $? -ne 0 ]]; then
-						echo "${my_output}" >&2
-						die "${myfail}"
-					fi
+				local my_output
+				my_output="$(7z x -y "${srcdir}${x}")"
+				if [[ $? -ne 0 ]]; then
+					echo "${my_output}" >&2
+					die "${myfail}"
 				fi
 				;;
 			rar)
@@ -455,9 +470,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'rar' or 'RAR'."
 				fi
-				if ___eapi_unpack_supports_rar; then
-					unrar x -idq -o+ "${srcdir}${x}" || die "${myfail}"
-				fi
+				unrar x -idq -o+ "${srcdir}${x}" || die "${myfail}"
 				;;
 			lha|lzh)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -467,9 +480,7 @@ unpack() {
 						"with EAPI '${EAPI}'." \
 						"Instead use 'LHA', 'LHa', 'lha', or 'lzh'."
 				fi
-				if ___eapi_unpack_supports_lha; then
-					lha xfq "${srcdir}${x}" || die "${myfail}"
-				fi
+				lha xfq "${srcdir}${x}" || die "${myfail}"
 				;;
 			a)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -537,9 +548,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'xz'."
 				fi
-				if ___eapi_unpack_supports_xz; then
-					__unpack_tar "xz -T$(___makeopts_jobs) -d"
-				fi
+				__unpack_tar "xz -T$(___makeopts_jobs) -d"
 				;;
 			txz)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -548,9 +557,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'txz'."
 				fi
-				if ___eapi_unpack_supports_txz; then
-					XZ_OPT="-T$(___makeopts_jobs)" tar xof "${srcdir}${x}" || die "${myfail}"
-				fi
+				XZ_OPT="-T$(___makeopts_jobs)" tar xof "${srcdir}${x}" || die "${myfail}"
 				;;
 		esac
 	done