GNU bug report logs - #47382
runtest doesn't work with Solaris 10 /bin/sh

Previous Next

Package: dejagnu;

Reported by: Rainer Orth <ro <at> CeBiTec.Uni-Bielefeld.DE>

Date: Thu, 25 Mar 2021 10:34:01 UTC

Owned by: jcb62281 <at> gmail.com

Severity: normal

Done: Jacob Bachmeyer <jcb62281 <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jacob Bachmeyer <jcb62281 <at> gmail.com>
To: Rainer Orth <ro <at> CeBiTec.Uni-Bielefeld.DE>
Cc: 47382 <at> debbugs.gnu.org
Subject: bug#47382: runtest doesn't work with Solaris 10 /bin/sh
Date: Wed, 14 Apr 2021 23:00:17 -0500
Rainer Orth wrote:
> [...] here's an excerpt from running
>
> env EXPECT=true TCLSH=true /bin/ksh -x /vol/gcc/obj/dejagnu/dejagnu-1.6.3-rc3/10-fresh/testsuite/launcher.all/command/bin/dejagnu foo -v -v
>
> + test -f /vol/gcc/obj/dejagnu/dejagnu-1.6.3-rc3/10-fresh/testsuite/launcher.all
> /command/share/dejagnu/commands/dejagnu.sh
> + expr foo : -
> + 1> /dev/null
> expr: syntax error
>   

Thank you!  That identifies the problem.  As of commit 
c95e2e9b567a1c3ca22b2de4fdcdfe4b99ba2a03, the dejagnu launcher script 
now uses the shell "case" builtin for that pattern match instead of 
using expr:

8<----
diff --git a/dejagnu b/dejagnu
index 44c8962..9f6ae4b 100755
--- a/dejagnu
+++ b/dejagnu
@@ -152,9 +152,7 @@ command=`basename "$0" | sed -e 's/^.*-\?dejagnu-\?//'`
while expr $# \> 0 > /dev/null
do
    if test -z "${command}" ; then
-       if expr "$1" : - > /dev/null ; then
-           break
-       fi
+       case $1 in -*) break;; esac
       command="$1"
       shift
    fi
@@ -167,9 +165,7 @@ do
           break 2
       fi
    done
-    if expr "$1" : - > /dev/null ; then
-       break
-    fi
+    case $1 in -*) break;; esac
    if test -n "$1" ; then
       command="${command}-$1"
       shift
8<----


> It seems this is no wonder:
>
> expr foo : -
>
> is not in XPG7/POSIX.1 and the autoconf manual explicitly states that
> this is an unportable non-POSIX extension.

Can you cite exactly where in the Autoconf manual that is mentioned?  
The closest that I can find is a recommendation to use `expr X"word" : 
'Xregex'` to handle cases where "word" starts with a dash; here Solaris 
10 is rejecting a case where "word" is "foo".



-- Jacob




This bug report was last modified 3 years and 352 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.