Monday, December 28, 2020

update devel/pcre2 10.36

Here is an update to devel/pcre2 10.36, released on Dec. 4, 2020.

changelog:
https://vcs.pcre.org/pcre2/code/trunk/ChangeLog?revision=1287&view=markup

This diff:
- uses tr instead of gsed in RunGrepTest (from jca@)
- drops TEST_DEPENDS on textproc/gsed
- changes expected test output in testdata/grepoutputN with a sed line
instead of a patch due to CR bytes

It uses jca@'s work[1] to use tr(1) instead of gsed(1) to pass Test N7
in RunGrepTest. According to ${WRKSRC}/README, "RunGrepTest that tests
the pcre2grep command." Test N7 uses NUL characters and tr(1) portably
handles NUL unlike sed.

I proposed the tr change to upstream[2].

I successfully tested net/wget and shells/fish as consumers.

OK?

Details
=======
`make test' reports test 132 of RunGrepTest as failing. The expected
test output seems incorrect to me. It seems like a low priority test for
pcre2grep(1) that should not block an update. It tests -m1 and -A3
flags. -m1 means stop processing after finding 1 matching line and -A3
means print 3 lines of context. I reported this.[3]

Highlights from the changelog considered wrt bumping libraries:
#10 ${WRKSRC}/README says:
perltest.sh Script for running a Perl test program
perltest.sh helps the test infrastructure so delimiters being changed to
/ in test input files shouldn't affect any library bumps.

#13 New patterns that failed to match before may now match. "Incorrect
'no match'" means false negatives were possible before and are fixed
now. That should also not affect any library bumps because anything that
used to match still matches (i.e., valid calling sequences).

Footnotes
=========
[1] https://marc.info/?l=openbsd-ports&m=155675121018167&w=2
[2] https://bugs.exim.org/show_bug.cgi?id=2681
[3] https://bugs.exim.org/show_bug.cgi?id=2680

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/pcre2/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- Makefile 20 Jun 2020 06:55:46 -0000 1.13
+++ Makefile 28 Dec 2020 12:54:42 -0000
@@ -2,11 +2,11 @@

COMMENT = perl-compatible regular expression library, version 2

-DISTNAME = pcre2-10.35
+DISTNAME = pcre2-10.36

-SHARED_LIBS += pcre2-16 0.5 # 10.35
-SHARED_LIBS += pcre2-32 0.5 # 10.35
-SHARED_LIBS += pcre2-8 0.6 # 10.35
+SHARED_LIBS += pcre2-16 0.5 # 10.36
+SHARED_LIBS += pcre2-32 0.5 # 10.36
+SHARED_LIBS += pcre2-8 0.6 # 10.36
SHARED_LIBS += pcre2-posix 0.3 # 2.3

CATEGORIES = devel
@@ -25,7 +25,6 @@ PERMIT_PACKAGE = Yes
WANTLIB += bz2 c curses readline z

LIB_DEPENDS = archivers/bzip2
-TEST_DEPENDS = textproc/gsed

CONFIGURE_STYLE = gnu
CONFIGURE_ARGS = --enable-pcre2-16 \
@@ -38,5 +37,10 @@ CONFIGURE_ARGS = --enable-pcre2-16 \
CONFIGURE_ARGS += --disable-jit
CONFIGURE_ENV = CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
+
+# change expected test output to support RunGrepTest patch
+post-extract:
+ sed -i 's/1:abcZERO2:defZERO/1:abc@2:def@/' \
+ ${WRKSRC}/testdata/grepoutputN

.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/pcre2/distinfo,v
retrieving revision 1.7
diff -u -p -r1.7 distinfo
--- distinfo 20 Jun 2020 06:55:46 -0000 1.7
+++ distinfo 28 Dec 2020 12:54:42 -0000
@@ -1,2 +1,2 @@
-SHA256 (pcre2-10.35.tar.gz) = j9zvjI9M1zUWndAiX9AQSHlwwbyt1J6bkOJsclCjPck=
-SIZE (pcre2-10.35.tar.gz) = 2299082
+SHA256 (pcre2-10.36.tar.gz) = uV3blBT5GpZ6iH1pYXBZ+2crkU9W+j1hOBLB7o6KGjc=
+SIZE (pcre2-10.36.tar.gz) = 2290719
Index: patches/patch-RunGrepTest
===================================================================
RCS file: /cvs/ports/devel/pcre2/patches/patch-RunGrepTest,v
retrieving revision 1.4
diff -u -p -r1.4 patch-RunGrepTest
--- patches/patch-RunGrepTest 20 Jun 2020 06:55:46 -0000 1.4
+++ patches/patch-RunGrepTest 28 Dec 2020 12:54:42 -0000
@@ -1,19 +1,28 @@
$OpenBSD: patch-RunGrepTest,v 1.4 2020/06/20 06:55:46 kn Exp $

Our sed(1) doesn't cope with NUL bytes and \x00-style notation.
+Use tr(1) instead.
+
+see: https://bugs.exim.org/show_bug.cgi?id=2681

Index: RunGrepTest
--- RunGrepTest.orig
+++ RunGrepTest
-@@ -740,9 +740,9 @@ $valgrind $vjs $pcre2grep -n --newline=anycrlf "^(abc|
+@@ -763,14 +763,9 @@ $valgrind $vjs $pcre2grep -n --newline=anycrlf "^(abc|
+ # doesn't.
+
printf '%c--------------------------- Test N7 ------------------------------\r\n' - >>testtrygrep
- uname=`uname`
- case $uname in
-- Linux)
-+ OpenBSD)
- printf 'abc\0def' >testNinputgrep
-- $valgrind $vjs $pcre2grep -na --newline=nul "^(abc|def)" testNinputgrep | sed 's/\x00/ZERO/g' >>testtrygrep
-+ $valgrind $vjs $pcre2grep -na --newline=nul "^(abc|def)" testNinputgrep | gsed 's/\x00/ZERO/g' >>testtrygrep
- echo "" >>testtrygrep
- ;;
- *)
+-Z=`printf '\0' | sed 's/\x00/Z/g'`
+-if [ "$Z" = "Z" ]; then
+- printf 'abc\0def' >testNinputgrep
+- $valgrind $vjs $pcre2grep -na --newline=nul "^(abc|def)" testNinputgrep | sed 's/\x00/ZERO/g' >>testtrygrep
+- echo "" >>testtrygrep
+-else
+- echo '1:abcZERO2:defZERO' >>testtrygrep
+-fi
++printf 'abc\0def' >testNinputgrep
++$valgrind $vjs $pcre2grep -na --newline=nul "^(abc|def)" testNinputgrep | tr '\000' '@' >>testtrygrep
++echo "" >>testtrygrep
+
+ $cf $srcdir/testdata/grepoutputN testtrygrep
+ if [ $? != 0 ] ; then exit 1; fi

No comments:

Post a Comment