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 A0D9C158021 for ; Wed, 30 Nov 2022 07:07:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5624DE084A; Wed, 30 Nov 2022 07:07:26 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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 pigeon.gentoo.org (Postfix) with ESMTPS id 404B3E084A for ; Wed, 30 Nov 2022 07:07:26 +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 E86BA341021 for ; Wed, 30 Nov 2022 07:07:24 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4334376C for ; Wed, 30 Nov 2022 07:07:23 +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: <1669791938.abc758f4cb662024ad88c17fefb68767785f271e.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/portage/, sys-apps/portage/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-apps/portage/files/portage-3.0.39-bash-5.2-patsub_replacement.patch sys-apps/portage/portage-3.0.39-r2.ebuild sys-apps/portage/portage-3.0.39-r3.ebuild X-VCS-Directories: sys-apps/portage/files/ sys-apps/portage/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: abc758f4cb662024ad88c17fefb68767785f271e X-VCS-Branch: master Date: Wed, 30 Nov 2022 07:07:23 +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: eda46d68-cbe4-41e1-97c0-26371bccbab9 X-Archives-Hash: c9c0d90b998b9b54d4ffcf0f163cd15f commit: abc758f4cb662024ad88c17fefb68767785f271e Author: Sam James gentoo org> AuthorDate: Wed Nov 30 07:05:38 2022 +0000 Commit: Sam James gentoo org> CommitDate: Wed Nov 30 07:05:38 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=abc758f4 sys-apps/portage: backport patsub_replacement disablement for Bash 5.2 Quoting Portage's NEWS: """ * ebuild: Handle Bash 5.2's change in behavior which enables the shopt 'patsub_replacement' by default. This is needed to avoid breaking existing working ebuilds. Future EAPIs will need to adjust the logic added by this change. See bug #881383. """ Bug: https://bugs.gentoo.org/881383 Signed-off-by: Sam James gentoo.org> ...ortage-3.0.39-bash-5.2-patsub_replacement.patch | 49 ++++++++++++++++++++++ ...e-3.0.39-r2.ebuild => portage-3.0.39-r3.ebuild} | 1 + 2 files changed, 50 insertions(+) diff --git a/sys-apps/portage/files/portage-3.0.39-bash-5.2-patsub_replacement.patch b/sys-apps/portage/files/portage-3.0.39-bash-5.2-patsub_replacement.patch new file mode 100644 index 000000000000..90c678998a05 --- /dev/null +++ b/sys-apps/portage/files/portage-3.0.39-bash-5.2-patsub_replacement.patch @@ -0,0 +1,49 @@ +https://github.com/gentoo/portage/commit/69cac73ba0a7bcf2e2cff88c60d389895a550623 + +From 69cac73ba0a7bcf2e2cff88c60d389895a550623 Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Wed, 30 Nov 2022 01:09:12 +0000 +Subject: [PATCH] ebuild.sh: disable patsub_replacement in Bash 5.2 + +patsub_replacement is a new option in bash-5.2 that is also default-on +in that release. The default value is not gated by BASH_COMPAT (see bug #881383), +hence we need to disable it for older Bashes to avoid behaviour changes in ebuilds +and eclasses. + +Thanks to Kerin for both raising this & being persistent with trying +to get Bash 5.2 to be suitable for use in Gentoo. + +Bug: https://bugs.gentoo.org/881383 +Thanks-to: Kerin Millar +Signed-off-by: Sam James +--- a/bin/ebuild.sh ++++ b/bin/ebuild.sh +@@ -18,6 +18,7 @@ source "${PORTAGE_BIN_PATH}/isolated-functions.sh" || exit 1 + # used instead. + __check_bash_version() { + # Figure out which min version of bash we require. ++ # Adjust patsub_replacement logic below on new EAPI! + local maj min + if ___eapi_bash_3_2 ; then + maj=3 min=2 +@@ -50,6 +51,19 @@ __check_bash_version() { + if ___eapi_bash_3_2 && [[ ${BASH_VERSINFO[0]} -gt 3 ]] ; then + shopt -s compat32 + fi ++ ++ # patsub_replacement is a new option in bash-5.2 that is also default-on ++ # in that release. The default value is not gated by BASH_COMPAT (see bug #881383), ++ # hence we need to disable it for older Bashes to avoid behaviour changes in ebuilds ++ # and eclasses. ++ # ++ # New EAPI note: a newer EAPI (after 8) may well adopt Bash 5.2 as its minimum version. ++ # If it does, this logic will need to be adjusted to only disable patsub_replacement ++ # for < ${new_api}! ++ if (( BASH_VERSINFO[0] >= 6 || ( BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >= 2 ) )) ; then ++ shopt -u patsub_replacement ++ fi ++ + } + __check_bash_version + + diff --git a/sys-apps/portage/portage-3.0.39-r2.ebuild b/sys-apps/portage/portage-3.0.39-r3.ebuild similarity index 99% rename from sys-apps/portage/portage-3.0.39-r2.ebuild rename to sys-apps/portage/portage-3.0.39-r3.ebuild index 430e100baf73..a98bde44683f 100644 --- a/sys-apps/portage/portage-3.0.39-r2.ebuild +++ b/sys-apps/portage/portage-3.0.39-r3.ebuild @@ -86,6 +86,7 @@ pkg_pretend() { python_prepare_all() { local PATCHES=( "${FILESDIR}"/${P}-implicit-func-decls-no-fatal.patch + "${FILESDIR}"/${P}-bash-5.2-patsub_replacement.patch ) distutils-r1_python_prepare_all