public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/portage/, sys-apps/portage/files/
Date: Wed, 30 Nov 2022 07:07:23 +0000 (UTC)	[thread overview]
Message-ID: <1669791938.abc758f4cb662024ad88c17fefb68767785f271e.sam@gentoo> (raw)

commit:     abc758f4cb662024ad88c17fefb68767785f271e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 30 07:05:38 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> 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 <sam <AT> 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 <sam@gentoo.org>
+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 <kfm@plushkava.net>
+Signed-off-by: Sam James <sam@gentoo.org>
+--- 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


             reply	other threads:[~2022-11-30  7:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30  7:07 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-05-17 13:05 [gentoo-commits] repo/gentoo:master commit in: sys-apps/portage/, sys-apps/portage/files/ Sam James
2024-05-10 18:26 Sam James
2023-12-03  8:02 Sam James
2023-10-26 15:53 Mike Gilbert
2023-07-30 13:10 Sam James
2023-07-15  3:45 Sam James
2023-02-28  3:14 Sam James
2023-01-13  3:50 Sam James
2022-11-20 23:37 Sam James
2022-11-20  2:46 Sam James
2022-10-26  0:23 Mike Gilbert
2022-10-20 15:49 Mike Gilbert
2022-04-24 16:45 WANG Xuerui
2022-04-15  8:37 Sam James
2018-01-02  2:49 Mike Gilbert
2016-09-19 14:00 Mike Gilbert
2016-05-16 16:20 Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1669791938.abc758f4cb662024ad88c17fefb68767785f271e.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox