From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 F2C92158083 for ; 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 11AF0E29FB; Tue, 10 Sep 2024 10:29:28 +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 E7B5AE29FB for ; 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 0011E341C4B for ; Tue, 10 Sep 2024 10:29:26 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 928E11D86 for ; Tue, 10 Sep 2024 10:29:25 +0000 (UTC) From: "Ulrich Müller" 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" Message-ID: <1725964150.e1db307d107f5010057a4e3495e08b1f51820add.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: e1db307d107f5010057a4e3495e08b1f51820add X-VCS-Branch: master Date: Tue, 10 Sep 2024 10:29:25 +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: a851f20a-fe8f-46bd-94c9-f3fe386c1cc7 X-Archives-Hash: a5a021e1eb23f1841ed22c3e60c8fc0d commit: e1db307d107f5010057a4e3495e08b1f51820add Author: Ulrich Müller gentoo org> AuthorDate: Mon Sep 9 15:31:42 2024 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Tue Sep 10 10:29:10 2024 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e1db307d unpack: Match file extensions case-sensitively in old EAPIs This fixes PMS compliance and at the same time simplifies the code. Signed-off-by: Ulrich Müller gentoo.org> bin/phase-helpers.sh | 97 +++++----------------------------------------------- 1 file changed, 9 insertions(+), 88 deletions(-) diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index 164f62143d..4e23d10a8b 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -370,6 +370,12 @@ unpack() { txz) ___eapi_unpack_supports_txz && suffix_known=1 ;; esac + if ___eapi_unpack_is_case_sensitive \ + && ! has "${suffix}" "${suffix_insensitive}" \ + ZIP Z 7Z RAR LHA LHa; then + suffix_known="" + fi + if [[ -n ${suffix_known} ]]; then __vecho ">>> Unpacking ${x} to ${PWD}" else @@ -378,13 +384,9 @@ unpack() { fi __unpack_tar() { - if [[ ${y_insensitive} == tar ]] ; then - if ___eapi_unpack_is_case_sensitive && \ - [[ tar != ${y} ]] ; then - eqawarn "QA Notice: unpack called with" \ - "secondary suffix '${y}' which is unofficially" \ - "supported with EAPI '${EAPI}'. Instead use 'tar'." - fi + if [[ ${y_insensitive} == tar ]] \ + && ! ___eapi_unpack_is_case_sensitive \ + || [[ ${y} == tar ]]; then $1 -c -- "${srcdir}${x}" | tar xof - __assert_sigpipe_ok "${myfail}" else @@ -397,62 +399,25 @@ unpack() { myfail="unpack: failure unpacking ${x}" case "${suffix_insensitive}" in tar) - if ___eapi_unpack_is_case_sensitive && \ - [[ tar != ${suffix} ]] ; then - eqawarn "QA Notice: unpack called with" \ - "suffix '${suffix}' which is unofficially supported" \ - "with EAPI '${EAPI}'. Instead use 'tar'." - fi tar xof "${srcdir}${x}" || die "${myfail}" ;; tgz) - if ___eapi_unpack_is_case_sensitive && \ - [[ tgz != ${suffix} ]] ; then - eqawarn "QA Notice: unpack called with" \ - "suffix '${suffix}' which is unofficially supported" \ - "with EAPI '${EAPI}'. Instead use 'tgz'." - fi tar xozf "${srcdir}${x}" || die "${myfail}" ;; tbz|tbz2) - if ___eapi_unpack_is_case_sensitive && \ - [[ " tbz tbz2 " != *" ${suffix} "* ]] ; then - eqawarn "QA Notice: unpack called with" \ - "suffix '${suffix}' which is unofficially supported" \ - "with EAPI '${EAPI}'. Instead use 'tbz' or 'tbz2'." - fi ${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "${srcdir}${x}" | tar xof - __assert_sigpipe_ok "${myfail}" ;; zip|jar) - if ___eapi_unpack_is_case_sensitive && \ - [[ " ZIP zip jar " != *" ${suffix} "* ]] ; then - eqawarn "QA Notice: unpack called with" \ - "suffix '${suffix}' which is unofficially supported" \ - "with EAPI '${EAPI}'." \ - "Instead use 'ZIP', 'zip', or 'jar'." - fi # unzip will interactively prompt under some error conditions, # as reported in bug #336285 ( set +x ; while true ; do echo n || break ; done ) | \ unzip -qo "${srcdir}${x}" || die "${myfail}" ;; gz|z) - if ___eapi_unpack_is_case_sensitive && \ - [[ " gz z Z " != *" ${suffix} "* ]] ; then - eqawarn "QA Notice: unpack called with" \ - "suffix '${suffix}' which is unofficially supported" \ - "with EAPI '${EAPI}'. Instead use 'gz', 'z', or 'Z'." - fi __unpack_tar "gzip -d" ;; bz2|bz) - if ___eapi_unpack_is_case_sensitive && \ - [[ " bz bz2 " != *" ${suffix} "* ]] ; then - eqawarn "QA Notice: unpack called with" \ - "suffix '${suffix}' which is unofficially supported" \ - "with EAPI '${EAPI}'. Instead use 'bz' or 'bz2'." - fi __unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}" ;; 7z) @@ -464,41 +429,15 @@ unpack() { fi ;; rar) - if ___eapi_unpack_is_case_sensitive && \ - [[ " rar RAR " != *" ${suffix} "* ]] ; then - eqawarn "QA Notice: unpack called with" \ - "suffix '${suffix}' which is unofficially supported" \ - "with EAPI '${EAPI}'. Instead use 'rar' or 'RAR'." - fi unrar x -idq -o+ "${srcdir}${x}" || die "${myfail}" ;; lha|lzh) - if ___eapi_unpack_is_case_sensitive && \ - [[ " LHA LHa lha lzh " != *" ${suffix} "* ]] ; then - eqawarn "QA Notice: unpack called with" \ - "suffix '${suffix}' which is unofficially supported" \ - "with EAPI '${EAPI}'." \ - "Instead use 'LHA', 'LHa', 'lha', or 'lzh'." - fi lha xfq "${srcdir}${x}" || die "${myfail}" ;; a) - if ___eapi_unpack_is_case_sensitive && \ - [[ " a " != *" ${suffix} "* ]] ; then - eqawarn "QA Notice: unpack called with" \ - "suffix '${suffix}' which is unofficially supported" \ - "with EAPI '${EAPI}'. Instead use 'a'." - fi ar x "${srcdir}${x}" || die "${myfail}" ;; deb) - if ___eapi_unpack_is_case_sensitive && \ - [[ " deb " != *" ${suffix} "* ]] ; then - eqawarn "QA Notice: unpack called with" \ - "suffix '${suffix}' which is unofficially supported" \ - "with EAPI '${EAPI}'. Instead use 'deb'." - fi - # Unpacking .deb archives can not always be done with # `ar`. For instance on AIX this doesn't work out. # If `ar` is not the GNU binutils version and we have @@ -533,30 +472,12 @@ unpack() { fi ;; lzma) - if ___eapi_unpack_is_case_sensitive && \ - [[ " lzma " != *" ${suffix} "* ]] ; then - eqawarn "QA Notice: unpack called with" \ - "suffix '${suffix}' which is unofficially supported" \ - "with EAPI '${EAPI}'. Instead use 'lzma'." - fi __unpack_tar "lzma -d" ;; xz) - if ___eapi_unpack_is_case_sensitive && \ - [[ " xz " != *" ${suffix} "* ]] ; then - eqawarn "QA Notice: unpack called with" \ - "suffix '${suffix}' which is unofficially supported" \ - "with EAPI '${EAPI}'. Instead use 'xz'." - fi __unpack_tar "xz -T$(___makeopts_jobs) -d" ;; txz) - if ___eapi_unpack_is_case_sensitive && \ - [[ " txz " != *" ${suffix} "* ]] ; then - eqawarn "QA Notice: unpack called with" \ - "suffix '${suffix}' which is unofficially supported" \ - "with EAPI '${EAPI}'. Instead use 'txz'." - fi XZ_OPT="-T$(___makeopts_jobs)" tar xof "${srcdir}${x}" || die "${myfail}" ;; esac