commit:     054302328a516648e674101c1b6028306cbd6e97
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 16 22:19:57 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar 16 22:40:12 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=05430232

dev-util/bats: backport test fix for upcoming bash-5.3

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/bats/bats-1.11.1.ebuild               |  4 ++++
 dev-util/bats/files/bats-1.11.1-bash-5.3.patch | 25 +++++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/dev-util/bats/bats-1.11.1.ebuild b/dev-util/bats/bats-1.11.1.ebuild
index 4b9368319943..6943992f8610 100644
--- a/dev-util/bats/bats-1.11.1.ebuild
+++ b/dev-util/bats/bats-1.11.1.ebuild
@@ -19,6 +19,10 @@ KEYWORDS="amd64 arm arm64 hppa ~ppc ppc64 ~riscv ~sparc x86"
 DEPEND="app-shells/bash:*"
 RDEPEND="${DEPEND}"
 
+PATCHES=(
+       "${FILESDIR}"/${P}-bash-5.3.patch
+)
+
 src_test() {
        local my_jobs=$(get_nproc)
        if ! command -v parallel >/dev/null; then

diff --git a/dev-util/bats/files/bats-1.11.1-bash-5.3.patch 
b/dev-util/bats/files/bats-1.11.1-bash-5.3.patch
new file mode 100644
index 000000000000..13c52cbe8f0f
--- /dev/null
+++ b/dev-util/bats/files/bats-1.11.1-bash-5.3.patch
@@ -0,0 +1,25 @@
+https://github.com/bats-core/bats-core/commit/3c65504bb51a9f5d589de70e885fa42b5a994588
+
+From 3c65504bb51a9f5d589de70e885fa42b5a994588 Mon Sep 17 00:00:00 2001
+From: Martin Schulze <[email protected]>
+Date: Fri, 20 Dec 2024 23:20:31 +0100
+Subject: [PATCH] fix test expecation for bash RC (5.3)
+
+---
+ test/suite_setup_teardown.bats | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/suite_setup_teardown.bats b/test/suite_setup_teardown.bats
+index 9bd5d0e768..3bf728ea6c 100644
+--- a/test/suite_setup_teardown.bats
++++ b/test/suite_setup_teardown.bats
+@@ -66,7 +66,7 @@ setup() {
+ 
+ @test "syntax errors in setup_suite.bash are reported and lead to non zero 
exit code" {
+   LANG=C reentrant_run ! bats --setup-suite-file 
"$FIXTURE_ROOT/syntax_error/setup_suite_no_shellcheck" 
"$FIXTURE_ROOT/syntax_error/"
+-  [ "${lines[1]}" == "$FIXTURE_ROOT/syntax_error/setup_suite_no_shellcheck: 
line 2: syntax error: unexpected end of file" ]
++  [[ "${lines[1]}" == "$FIXTURE_ROOT/syntax_error/setup_suite_no_shellcheck: 
line 2: syntax error: unexpected end of file"* ]]
+ }
+ 
+ @test "errors in setup_suite.bash's free code reported correctly" {
+

Reply via email to