Skip to content

Commit

Permalink
Issue #741: Change configure.ac to use only dash compatible code
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed Dec 24, 2024
1 parent 17d2589 commit 46c7622
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 28 deletions.
24 changes: 12 additions & 12 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -4435,7 +4435,7 @@ fi
if test ${with_lua+y}
then :
withval=$with_lua; PATH_TO_LUA="$withval"
if test ${PATH_TO_LUA:0:1} != '/' ; then
if test $(printf %.1s" "$PATH_TO_LUA) != '/' ; then
echo
echo "ERROR: Path to lua must be absolute!"
exit 1
Expand All @@ -4459,7 +4459,7 @@ fi
if test ${with_luac+y}
then :
withval=$with_luac; PATH_TO_LUAC="$withval"
if test ${PATH_TO_LUAC:0:1} != '/' ; then
if test $(printf %.1s" "$PATH_TO_LUAC) != '/' ; then
echo
echo "ERROR: Path to luac must be absolute"
exit 1
Expand Down Expand Up @@ -4735,7 +4735,7 @@ PATH_TO_SRC=$SRCDIR
if test $MODE == "user_default" ; then
if test $MODE = "user_default" ; then
mode=0755
EXEC_BITS=$(( 0111 & $mode ));
if test $EXEC_BITS = 0; then
Expand Down Expand Up @@ -5403,14 +5403,14 @@ test -n "$PATH_TO_LS" || PATH_TO_LS=""""
##### LUA configuration -- start
if ! command -v $PATH_TO_LUA &>/dev/null ; then
if ! (command -v $PATH_TO_LUA &>/dev/null) ; then
echo 'The program "'$PATH_TO_LUA'" must be in your path'
rm -f makefile
exit 1
fi
if test "${LUA_SUFFIX}" != no ; then
if test "${PATH_TO_LUA:0:1}" = '/' -o "${PATH_TO_LUAC:0:1}" = '/'; then
if test $(printf %.1s "$PATH_TO_LUA") = '/' -o $(printf %.1s "$PATH_TO_LUA") = '/'; then
echo "Neither --with-lua= nor --with-luac= can be used with --with-luaSuffix="
rm -f makefile
exit 1
Expand All @@ -5420,10 +5420,10 @@ if test "${LUA_SUFFIX}" != no ; then
echo "1) PATH_TO_LUA: $PATH_TO_LUA"
else
mismatch=
if test "${PATH_TO_LUA:0:1}" = '/' -a "${PATH_TO_LUAC:0:1}" != '/'; then
if test $(printf %.1s "$PATH_TO_LUA") = '/' -a $(printf %.1s "$PATH_TO_LUA") != '/'; then
mismatch="true"
fi
if test "${PATH_TO_LUA:0:1}" != '/' -a "${PATH_TO_LUAC:0:1}" = '/'; then
if test $(printf %.1s "$PATH_TO_LUA") != '/' -a $(printf %.1s "$PATH_TO_LUA") = '/'; then
mismatch="true"
fi
if test "$mismatch" = true ; then
Expand All @@ -5433,13 +5433,13 @@ else
fi
fi
if ! command -v $PATH_TO_LUA &>/dev/null ; then
if ! (command -v $PATH_TO_LUA &>/dev/null) ; then
echo 'The program "'$PATH_TO_LUA'" must be in your path'
rm -f makefile
exit 1
fi
if test ${PATH_TO_LUA:0:1} != '/' ; then
if test $(printf %.1s "$PATH_TO_LUA") != '/' ; then
# Extract the first word of "$PATH_TO_LUA", so it can be a program name with args.
set dummy $PATH_TO_LUA; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
Expand Down Expand Up @@ -5488,13 +5488,13 @@ fi
PATH_TO_LUA=$(FOLLOW_READLINK $FIND_PATH_TO_LUA)
fi
if ! command -v $PATH_TO_LUAC &>/dev/null ; then
if ! (command -v $PATH_TO_LUAC &>/dev/null) ; then
echo 'The program "'$PATH_TO_LUAC'" must be in your path'
rm -f makefile
exit 1
fi
if test "${PATH_TO_LUAC:0:1}" != '/' ; then
if test $(printf %.1s "$PATH_TO_LUA") != '/' ; then
# Extract the first word of "$PATH_TO_LUAC", so it can be a program name with args.
set dummy $PATH_TO_LUAC; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
Expand Down Expand Up @@ -5589,7 +5589,7 @@ printf "checking for lua modules: posix"
missingModules=""
for i in posix; do
if ! $PATH_TO_LUA $ac_confdir/proj_mgmt/luaModuleAvailable $i 2> /dev/null ; then
if ! ($PATH_TO_LUA $ac_confdir/proj_mgmt/luaModuleAvailable $i 2> /dev/null) ; then
missingModules="$missingModules $i"
fi
done
Expand Down
24 changes: 12 additions & 12 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ AC_SUBST(PATH_TO_LUA)
AC_ARG_WITH(lua,
AS_HELP_STRING([--with-lua=ans],[absolute path to the lua interpreter to use [[lua]]]),
PATH_TO_LUA="$withval"
if test ${PATH_TO_LUA:0:1} != '/' ; then
if test $(printf %.1s" "$PATH_TO_LUA) != '/' ; then
echo
echo "ERROR: Path to lua must be absolute!"
exit 1
Expand All @@ -695,7 +695,7 @@ AC_SUBST(PATH_TO_LUAC)
AC_ARG_WITH(luac,
AS_HELP_STRING([--with-luac=ans],[absolute path to the luac interpreter to use [[luac]]]),
PATH_TO_LUAC="$withval"
if test ${PATH_TO_LUAC:0:1} != '/' ; then
if test $(printf %.1s" "$PATH_TO_LUAC) != '/' ; then
echo
echo "ERROR: Path to luac must be absolute"
exit 1
Expand Down Expand Up @@ -816,7 +816,7 @@ AC_SUBST(PATH_TO_HASHSUM)
AC_SUBST(PATH_TO_PAGER)
AC_SUBST(PATH_TO_TCLSH)

if test $MODE == "user_default" ; then
if test $MODE = "user_default" ; then
mode=0755
EXEC_BITS=$(( 0111 & $mode ));
if test $EXEC_BITS = 0; then
Expand Down Expand Up @@ -909,14 +909,14 @@ AC_PATH_PROGS(PATH_TO_LS, [gls] [ls], "")

##### LUA configuration -- start

if ! command -v $PATH_TO_LUA &>/dev/null ; then
if ! (command -v $PATH_TO_LUA &>/dev/null) ; then
echo 'The program "'$PATH_TO_LUA'" must be in your path'
rm -f makefile
exit 1
fi

if test "${LUA_SUFFIX}" != no ; then
if test "${PATH_TO_LUA:0:1}" = '/' -o "${PATH_TO_LUAC:0:1}" = '/'; then
if test $(printf %.1s "$PATH_TO_LUA") = '/' -o $(printf %.1s "$PATH_TO_LUA") = '/'; then
echo "Neither --with-lua= nor --with-luac= can be used with --with-luaSuffix="
rm -f makefile
exit 1
Expand All @@ -926,10 +926,10 @@ if test "${LUA_SUFFIX}" != no ; then
echo "1) PATH_TO_LUA: $PATH_TO_LUA"
else
mismatch=
if test "${PATH_TO_LUA:0:1}" = '/' -a "${PATH_TO_LUAC:0:1}" != '/'; then
if test $(printf %.1s "$PATH_TO_LUA") = '/' -a $(printf %.1s "$PATH_TO_LUA") != '/'; then
mismatch="true"
fi
if test "${PATH_TO_LUA:0:1}" != '/' -a "${PATH_TO_LUAC:0:1}" = '/'; then
if test $(printf %.1s "$PATH_TO_LUA") != '/' -a $(printf %.1s "$PATH_TO_LUA") = '/'; then
mismatch="true"
fi
if test "$mismatch" = true ; then
Expand All @@ -939,24 +939,24 @@ else
fi
fi

if ! command -v $PATH_TO_LUA &>/dev/null ; then
if ! (command -v $PATH_TO_LUA &>/dev/null) ; then
echo 'The program "'$PATH_TO_LUA'" must be in your path'
rm -f makefile
exit 1
fi

if test ${PATH_TO_LUA:0:1} != '/' ; then
if test $(printf %.1s "$PATH_TO_LUA") != '/' ; then
AC_PATH_PROG(FIND_PATH_TO_LUA, $PATH_TO_LUA)
PATH_TO_LUA=$(FOLLOW_READLINK $FIND_PATH_TO_LUA)
fi

if ! command -v $PATH_TO_LUAC &>/dev/null ; then
if ! (command -v $PATH_TO_LUAC &>/dev/null) ; then
echo 'The program "'$PATH_TO_LUAC'" must be in your path'
rm -f makefile
exit 1
fi

if test "${PATH_TO_LUAC:0:1}" != '/' ; then
if test $(printf %.1s "$PATH_TO_LUA") != '/' ; then
AC_PATH_PROG(FIND_PATH_TO_LUAC, $PATH_TO_LUAC)
PATH_TO_LUAC=$(FOLLOW_READLINK $FIND_PATH_TO_LUAC)
fi
Expand Down Expand Up @@ -1007,7 +1007,7 @@ printf "checking for lua modules: posix"

missingModules=""
for i in posix; do
if ! $PATH_TO_LUA $ac_confdir/proj_mgmt/luaModuleAvailable $i 2> /dev/null ; then
if ! ($PATH_TO_LUA $ac_confdir/proj_mgmt/luaModuleAvailable $i 2> /dev/null) ; then
missingModules="$missingModules $i"
fi
done
Expand Down
2 changes: 1 addition & 1 deletion proj_mgmt/DATE_cmd.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# -*- shell-script -*-

arg="$1"
Expand Down
2 changes: 1 addition & 1 deletion proj_mgmt/convert_mode.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# -*- shell-script -*-

KIND=$1
Expand Down
3 changes: 1 addition & 2 deletions rt/end2end/end2end.tdesc
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ testdescript = {
DIR=Lmod
dir=lmod
remove_generated_lmod_files build b0 lmod results.csv
GIT_BRANCH=`git status | head -n 1 | sed -e 's/^[# ]*On branch //g' -e 's/^[# ]*HEAD detached at//g'`
runLmod --version # 1
LmodV=`$LUA_EXEC $projectDir/src/$CMD bash --dumpversion 2>&1`
echo LmodV=$LmodV
mkdir b0
(cd b0; $(projectDir)/configure --prefix=$(outputDir)/b0 --with-useBuiltinPkgs=yes)
(cd b0; sh $(projectDir)/configure --prefix=$(outputDir)/b0 --with-useBuiltinPkgs=yes)
(cd $(projectDir); make -f $(outputDir)/b0/makefile dist GIT_BRANCH=$GIT_BRANCH)
tar xf $projectDir/${DIR}-$LmodV.tar.bz2
rm -rf $projectDir/${DIR}-$LmodV.tar.bz2
Expand Down

0 comments on commit 46c7622

Please sign in to comment.