Subject: [PATCH] correct parameter parsing in test-driver script
From: Christoph Grüninger <[email-masked]>
To: [email-masked]
Date: Tue, 3 Jun 2025 15:27:02 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

While updating the openSuse package to Automake 1.18, I stumbled across 
the attached patch. I got permission from the author to upstream it.
Are you interested?

Bye
Christoph

-- 
Most customers will not accept source code with compile errors in it.
                  Dan Saks, CppCon 2016 (https://youtu.be/D7Sd8A6_fYU)
From ba1172154da6739f9bf9e11c93f2abbb90a226ac Mon Sep 17 00:00:00 2001
From: Thomas Blume <[email-masked]>
Date: Tue, 14 Jun 2016 14:45:42 +0200
Subject: [PATCH] correct parameter parsing in test-driver script

The help text suggest using an equal sign for assigning parameter values
but the code only supports spaces.
The patch adds support for both.
---
 lib/test-driver | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

Index: automake-1.16.3/lib/test-driver
===================================================================
--- automake-1.16.3.orig/lib/test-driver
+++ automake-1.16.3/lib/test-driver
@@ -64,22 +64,27 @@ expect_failure=no
 color_tests=no
 collect_skipped_logs=yes
 enable_hard_errors=yes
-while test $# -gt 0; do
-  case $1 in
+while test $# -gt 1; do
+ arg=${1%=*}
+ val=${1#*=}
+ if [ $arg = $val ]; then
+   val=$2
+   shift
+ fi
+ case $arg in
   --help) print_usage; exit $?;;
   --version) echo "test-driver (GNU Automake) $scriptversion"; exit $?;;
-  --test-name) test_name=$2; shift;;
-  --log-file) log_file=$2; shift;;
-  --trs-file) trs_file=$2; shift;;
-  --color-tests) color_tests=$2; shift;;
-  --collect-skipped-logs) collect_skipped_logs=$2; shift;;
-  --expect-failure) expect_failure=$2; shift;;
-  --enable-hard-errors) enable_hard_errors=$2; shift;;
-  --) shift; break;;
+  --test-name) test_name=$val;;
+  --log-file) log_file=$val;;
+  --trs-file) trs_file=$val;;
+  --color-tests) color_tests=$val;;
+  --collect-skipped-logs) collect_skipped_logs=$val;;
+  --expect-failure) expect_failure=$val;;
+  --enable-hard-errors) enable_hard_errors=$val;;
+  --) break;;
   -*) usage_error "invalid option: '$1'";;
-   *) break;;
   esac
-  shift
+  [ $arg != $val ] && shift
 done
 
 missing_opts=