On Tue, Aug 16, 2016 at 8:14 AM, Jack Howarth <howarth.mailing.li...@gmail.com> wrote: > The pcre-jitstack test case fails on Mac OS X due to the system base64 > expecting either '-D or --decode' rather than '-d or --decode'. The > trivial fix is to use the common '--decode' option rather than '-d'... > > diff -uNr grep-2.25/tests/pcre-jitstack grep-2.25-patched/tests/pcre-jitstack > --- grep-2.25/tests/pcre-jitstack 2016-01-01 17:45:41.000000000 -0500 > +++ grep-2.25-patched/tests/pcre-jitstack 2016-08-16 > 10:53:58.000000000 -0400 > @@ -17,7 +17,7 @@ > > fail=0 > > -base64 -d >pcrejit.txt.gz <<'EOF' > +base64 --decode >pcrejit.txt.gz <<'EOF'
Thank you for the report and the patch. However, there are plenty of systems for which base64 --decode would not work either, so I've done this, which should work on a superset: tests: avoid unnecessary "skip" without base64 -d support * tests/pcre-jitstack: Try harder to find a base64 decoder: Try 'base64 -d', 'base64 -D', 'openssl base64 -d' and perl's MIME::Base64 decode_base64. The old code would skip at least on OS X, for which base64 expects -D or --decode. Reported by Jack Howarth in http://bugs.gnu.org/24243.
From 5756ff97aa9e0048fcaef093329b27bc64a93e89 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@fb.com> Date: Tue, 16 Aug 2016 21:35:03 -0700 Subject: [PATCH] tests: avoid unnecessary "skip" without base64 -d support * tests/pcre-jitstack: Try harder to find a base64 decoder: Try 'base64 -d', 'base64 -D', 'openssl base64 -d' and perl's MIME::Base64 decode_base64. The old code would skip at least on OS X, for which base64 expects -D or --decode. Reported by Jack Howarth in http://bugs.gnu.org/24243. --- tests/pcre-jitstack | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/pcre-jitstack b/tests/pcre-jitstack index bdae37b..0000902 100755 --- a/tests/pcre-jitstack +++ b/tests/pcre-jitstack @@ -10,14 +10,22 @@ . "${srcdir=.}/init.sh"; path_prepend_ ../src require_pcre_ -nl_base64=$(echo | (base64) 2>/dev/null) && test "X$nl_base64" = XCg== || - skip_ "your system lacks the base64 program" -foo=$( (echo foo | gzip | gzip -d) 2>/dev/null) && test "X$foo" = Xfoo || - skip_ "your system lacks the gzip program" +for p in 'base64 -d' 'base64 -D' 'openssl base64 -d' \ + "perl -MMIME::Base64 -0777ne 'print decode_base64(\$_)'" FAIL; do + test "$p" = FAIL && skip_ "your system lacks a base64 decoder" + x=$(echo eA==| ( set -x; eval "$p" ) 2>/dev/null) && test "X$x" = Xx && + { + eval "b64_decode() { $p; }" + break + } +done + +foo=$( (echo foo | gzip | gzip -d) 2>/dev/null) && test "X$foo" = Xfoo \ + || skip_ "your system lacks the gzip program" fail=0 -base64 -d >pcrejit.txt.gz <<'EOF' +b64_decode >pcrejit.txt.gz <<'EOF' H4sIAAAAAAACA+2bUU4DMQxE/7mMz5T7XwKE+IBKVLue58yk0B9EtX6xJxN7t4VaH69a6+tHrW+/ r4e3n75KARWShSOFTtiumE3FPVyo79ATIJ0Ry0No/yXe99UIUqTGKKUzYHFJHJoaCONQDCnDSCDS IPAvGCVeXNsZ7lpbWFfdaZtgPos5LeK2C1TBKzD09V3HFlCOsbFT/hNbz4HzJaRjnjdam9FXw/o6 @@ -36,7 +44,7 @@ gzip -d pcrejit.txt || framework_failure_ LC_ALL=C grep -P -n '^([/](?!/)|[^/])*~/.*' pcrejit.txt if test $? != 1; then # The above often makes grep attempt to use an inordinate amount - # of stack space. If grep fails with $? != 1, try gain, but this + # of stack space. If grep fails with $? != 1, try again, but this # time with no soft limit: # Use ulimit to remove that limit, if possible. -- 2.8.0-rc2