@@ -, +, @@ --- ...-jitstack_if_libpcre_is_build_without_jit.patch | 25 +++++++++++++++++++ sys-apps/grep/grep-2.25.ebuild | 2 ++ 2 files changed, 27 insertions(+), 0 deletions(-) create mode 100644 sys-apps/grep/files/grep-2.25-skip_test_pcre-jitstack_if_libpcre_is_build_without_jit.patch --- a/sys-apps/grep/files/grep-2.25-skip_test_pcre-jitstack_if_libpcre_is_build_without_jit.patch +++ a/sys-apps/grep/files/grep-2.25-skip_test_pcre-jitstack_if_libpcre_is_build_without_jit.patch @@ -0,0 +1,25 @@ +If libpcre is build without jit, then grep fails the test pcre-jitstack with + + grep: internal PCRE error: -21 + +libpcre error 21 is + + #define PCRE_ERROR_RECURSIONLIMIT (-21) + +This is not grep's fault, so we skip this test. +The corresponding Gentoo bug is #569816 [0]. + +[0] https://bugs.gentoo.org/show_bug.cgi?id=569816 + +diff -ur grep-2.25/tests/pcre-jitstack grep-2.25_b/tests/pcre-jitstack +--- a/tests/pcre-jitstack ++++ b/tests/pcre-jitstack +@@ -10,6 +10,8 @@ + . "${srcdir=.}/init.sh"; path_prepend_ ../src + require_pcre_ + ++skip_ "test pcre-jitstack is known to fail if libpcre is build without jit (Gentoo bug #569816)" ++ + 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 || --- a/sys-apps/grep/grep-2.25.ebuild +++ a/sys-apps/grep/grep-2.25.ebuild @@ -28,6 +28,8 @@ DEPEND="${RDEPEND} DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO ) src_prepare() { + has_version "dev-libs/libpcre[-jit]" && \ + epatch "${FILESDIR}/${P}-skip_test_pcre-jitstack_if_libpcre_is_build_without_jit.patch" sed -i \ -e "s:@SHELL@:${EPREFIX}/bin/sh:g" \ src/egrep.sh || die #523898 --