From 52ff1cf3138485b0083af5ff4369848f0e32e7da Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 22 May 2014 20:54:57 +0200 Subject: old-configure: we accidentally used bash features In at least 2 places, we want to "shift" positional parameters by a certain amount, or remove all parameters if there are fewer parameters. bash handled this just fine, but dash vomits upon it. POSIX shell allows both behaviors, so we have to fix it. Fix a comparison done with "==" instead of "=". --- old-configure | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/old-configure b/old-configure index 03ee0a5eb8..1cf7075141 100755 --- a/old-configure +++ b/old-configure @@ -425,7 +425,11 @@ check_compile() { echocheck "$1" if test $_res = auto ; then _res=no - shift 4 + if test $# -gt 4 ; then + shift 4 + else + shift $# + fi while true ; do compile_check "$_code" "$1" && libs_mplayer="$libs_mplayer $1" && _res=yes && break test -z "$1" && break @@ -448,7 +452,11 @@ check_statement_libs() { echocheck "$1" if test $_res = auto ; then _res=no - shift 5 + if test $# -gt 5 ; then + shift 5 + else + shift $# + fi while true ; do statement_check "$_inc" "$_st" "$1" && libs_mplayer="$libs_mplayer $1" && _res=yes && break test -z "$1" && break @@ -462,7 +470,7 @@ check_statement_libs() { # Print "yes" if previous command succeeded, else "no" defretval() { # shell is retarded? - if test $? == 0 ; then + if test $? = 0 ; then echo "yes" else echo "no" -- cgit v1.2.3