From 0d866407719e35fefdf7bce3286af8a1c982e26f92ab0fe14a826197248ff284 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 11 Oct 2022 12:39:37 +0000 Subject: [PATCH] Accepting request 1009751 from home:favogt:branches:devel:libraries:c_c++ - Add patch to fix testsuite with bash >= 5.2: * 0001-Remove-broken-agrep-test-entry.patch OBS-URL: https://build.opensuse.org/request/show/1009751 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/tre?expand=0&rev=23 --- 0001-Remove-broken-agrep-test-entry.patch | 112 ++++++++++++++++++++++ tre.changes | 6 ++ tre.spec | 7 +- 3 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 0001-Remove-broken-agrep-test-entry.patch diff --git a/0001-Remove-broken-agrep-test-entry.patch b/0001-Remove-broken-agrep-test-entry.patch new file mode 100644 index 0000000..bc62d3a --- /dev/null +++ b/0001-Remove-broken-agrep-test-entry.patch @@ -0,0 +1,112 @@ +From 35f61f40d6b68928ca5d409fa9fc204ea77e2199 Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Tue, 11 Oct 2022 11:35:53 +0200 +Subject: [PATCH] Remove broken agrep test entry + +It's meant to cause agrep to return with exit code 2, but asserts that it's +exit code 1 instead. + +It's meant to ensure that using ".*" as pattern results in exit code 2 because +it matches also an empty string. However, glob expansion results in ".*" +picking up files such as "." and ".." from the CWD, which get interpreted as +valid pattern. This results in exit status 1 (no match found) which is what +the .ok file expects, but that's invalid. + +With bash 5.2, glob expansion no longer matches "." and ".." by default, so +the test works as intended by accident, causing a mismatch with the expected +wrong exit code. + +It's unfortunately not easily possible to avoid glob expansion in this case. + +Just remove the test for now. +--- + tests/agrep/exitstatus.args | 1 - + tests/agrep/exitstatus.ok | 61 ------------------------------------- + 2 files changed, 62 deletions(-) + +diff --git a/tests/agrep/exitstatus.args b/tests/agrep/exitstatus.args +index 808ae77..2f53e97 100644 +--- a/tests/agrep/exitstatus.args ++++ b/tests/agrep/exitstatus.args +@@ -5,6 +5,5 @@ this-wont-be-found + . + -v . + # Some errors which should give exit status 2. +--d .* dummy + -d {1 dummy + \ +diff --git a/tests/agrep/exitstatus.ok b/tests/agrep/exitstatus.ok +index 28427bb..bd23b4c 100644 +--- a/tests/agrep/exitstatus.ok ++++ b/tests/agrep/exitstatus.ok +@@ -521,67 +521,6 @@ Exit status 1. + Exit status 1. + #### TEST: agrep -H -n -s --color --show-position -v . < exitstatus.in + +-Exit status 1. +-#### TEST: agrep -d .* dummy exitstatus.in +- +-Exit status 1. +-#### TEST: agrep -d .* dummy < exitstatus.in +- +-Exit status 1. +-#### TEST: agrep -c -d .* dummy exitstatus.in +-exitstatus.in:0 +- +-Exit status 1. +-#### TEST: agrep -c -d .* dummy < exitstatus.in +- +-Exit status 1. +-#### TEST: agrep -H -d .* dummy exitstatus.in +- +-Exit status 1. +-#### TEST: agrep -H -d .* dummy < exitstatus.in +- +-Exit status 1. +-#### TEST: agrep -l -d .* dummy exitstatus.in +- +-Exit status 1. +-#### TEST: agrep -l -d .* dummy < exitstatus.in +- +-Exit status 1. +-#### TEST: agrep -n -d .* dummy exitstatus.in +- +-Exit status 1. +-#### TEST: agrep -n -d .* dummy < exitstatus.in +- +-Exit status 1. +-#### TEST: agrep -s -d .* dummy exitstatus.in +- +-Exit status 1. +-#### TEST: agrep -s -d .* dummy < exitstatus.in +- +-Exit status 1. +-#### TEST: agrep -M -d .* dummy exitstatus.in +- +-Exit status 1. +-#### TEST: agrep -M -d .* dummy < exitstatus.in +- +-Exit status 1. +-#### TEST: agrep --show-position -d .* dummy exitstatus.in +- +-Exit status 1. +-#### TEST: agrep --show-position -d .* dummy < exitstatus.in +- +-Exit status 1. +-#### TEST: agrep --color -d .* dummy exitstatus.in +- +-Exit status 1. +-#### TEST: agrep --color -d .* dummy < exitstatus.in +- +-Exit status 1. +-#### TEST: agrep -H -n -s --color --show-position -d .* dummy exitstatus.in +- +-Exit status 1. +-#### TEST: agrep -H -n -s --color --show-position -d .* dummy < exitstatus.in +- + Exit status 1. + #### TEST: agrep -d {1 dummy exitstatus.in + +-- +2.36.1 + diff --git a/tre.changes b/tre.changes index 8464e2c..43a6c34 100644 --- a/tre.changes +++ b/tre.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Oct 11 09:44:20 UTC 2022 - Fabian Vogt + +- Add patch to fix testsuite with bash >= 5.2: + * 0001-Remove-broken-agrep-test-entry.patch + ------------------------------------------------------------------- Thu Jan 27 20:23:27 UTC 2022 - Dirk Müller diff --git a/tre.spec b/tre.spec index d32515f..e5202d9 100644 --- a/tre.spec +++ b/tre.spec @@ -33,6 +33,8 @@ Patch0: %{name}.diff # See https://github.com/laurikari/tre/pull/19. Patch1: %{name}-chicken.patch Patch2: CVE-2016-8859.patch +# https://github.com/laurikari/tre/pull/87 +Patch3: 0001-Remove-broken-agrep-test-entry.patch BuildRequires: gettext-devel BuildRequires: glibc-locale BuildRequires: libtool @@ -81,10 +83,7 @@ approximate patterns as well as block oriented search. %lang_package %prep -%setup -q -%patch0 -p1 -%patch1 -p1 -b .chicken -%patch2 -p1 +%autosetup -p1 ./utils/autogen.sh %build