From: Assaf Gordon Date: Tue, 26 Jun 2018 11:04:45 +0000 (-0600) Subject: tests: accept getopt errors without single-quotes X-Git-Tag: v8.30~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b7595d751872442d043f6116a453d3b43b3253d;p=thirdparty%2Fcoreutils.git tests: accept getopt errors without single-quotes On OpenBSD 6.2, invalid single options produce error messages without single quotes: $ ./src/chroot -/ chroot: unknown option -- / As opposed to other systems: ./src/chroot: invalid option -- '/' Modify the grep search to accept this. * tests/misc/usage_vs_getopt.sh (checkprg): Change the grep pattern to accomodate no-single-quotes cases. --- diff --git a/tests/misc/usage_vs_getopt.sh b/tests/misc/usage_vs_getopt.sh index aec1c6da22..2ca16ffb36 100755 --- a/tests/misc/usage_vs_getopt.sh +++ b/tests/misc/usage_vs_getopt.sh @@ -36,7 +36,9 @@ checkprg () { # Append the pattern for a short unknown option. returns_ $rcexp $prg -/ >/dev/null 2> err || fail=1 - grep -F "'/'" err || framework_failure_ + grep " '*/'*" err || framework_failure_ + # The following only handles the common case that has single quotes, + # as it simplifies to identify missing options only on common systems. sed -n "1s/'\/'/'OPT'/p" < err >> pat || framework_failure_ # Get output for --help.