From 0c8989a3777ddcd666cfabb8baedd8aeeddc6aba Mon Sep 17 00:00:00 2001 From: kn Date: Sun, 22 Oct 2023 16:36:30 +0000 Subject: [PATCH] fix one test (bash vs. ksh), skip another (lack of script(1) options) --- textproc/jq/Makefile | 2 ++ textproc/jq/patches/patch-main_c | 15 --------------- textproc/jq/patches/patch-tests_shtest | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 15 deletions(-) delete mode 100644 textproc/jq/patches/patch-main_c create mode 100644 textproc/jq/patches/patch-tests_shtest diff --git a/textproc/jq/Makefile b/textproc/jq/Makefile index 3a5c4a27d4a..f0a96be2e15 100644 --- a/textproc/jq/Makefile +++ b/textproc/jq/Makefile @@ -30,4 +30,6 @@ CONFIGURE_ARGS += --disable-docs # makes all tests fail with SIGILL CONFIGURE_ARGS += --disable-valgrind +TEST_DEPENDS = shells/bash + .include diff --git a/textproc/jq/patches/patch-main_c b/textproc/jq/patches/patch-main_c deleted file mode 100644 index 30631d4d530..00000000000 --- a/textproc/jq/patches/patch-main_c +++ /dev/null @@ -1,15 +0,0 @@ -Index: src/main.c ---- src/main.c.orig -+++ src/main.c -@@ -334,6 +334,11 @@ int main(int argc, char* argv[]) { - _setmode(fileno(stderr), _O_TEXT | _O_U8TEXT); - #endif - -+ if (pledge("stdio getpw rpath", NULL) == -1) { -+ fprintf(stderr, "pledge\n"); -+ die(); -+ } -+ - if (argc) progname = argv[0]; - - jq = jq_init(); diff --git a/textproc/jq/patches/patch-tests_shtest b/textproc/jq/patches/patch-tests_shtest new file mode 100644 index 00000000000..da3cdad2d1f --- /dev/null +++ b/textproc/jq/patches/patch-tests_shtest @@ -0,0 +1,20 @@ +- use bash(1) as ksh(1) `set -v' behaviour difference causes false positive +- skip one test expecting script(1) `-e' and `-q' + +Index: tests/shtest +--- tests/shtest.orig ++++ tests/shtest +@@ -1,4 +1,4 @@ +-#!/bin/sh -x ++#!/usr/local/bin/bash -x + + . "${0%/*}/setup" "$@" + +@@ -506,6 +506,7 @@ cmp $d/warning $d/expect_warning + test_no_color=true + $msys && test_no_color=false + $mingw && test_no_color=false ++[ "$(uname -s)" = OpenBSD ] && test_no_color=false + if $test_no_color && command -v script >/dev/null 2>&1; then + unset NO_COLOR + if script -qc echo /dev/null >/dev/null 2>&1; then