Update shell files to use /bin/bash and POSIX .

bash's earlier problems with subshells running scripts starting #!/bin/bash
seem to be solved, so explicitly mark all scripts as requiring bash.
Furthermore, change all source built-ins to prefix the path with "./" as
required by POSIX. Together these changes should stop further problems
with changes of source built-in semantics in future.
This commit is contained in:
Laurence Withers 2009-04-06 14:13:06 +00:00
parent 13efab326f
commit dcee211388
9 changed files with 25 additions and 25 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# (c)2009, Laurence Withers. Released under the GNU GPL. See file
# COPYING for details.
@ -52,7 +52,7 @@ then
echo "Edit this file, and then re-run the build process."
exit 1
fi
do_cmd source ${LWBUILDRC} || exit 1
do_cmd source "${LWBUILDRC}" || exit 1

View File

@ -45,7 +45,7 @@ case "$#" in
;;
esac
source ${SCRIPT_ROOT}/skel/scripts/functions.sh || exit 1
source "${SCRIPT_ROOT}/skel/scripts/functions.sh" || exit 1
cd ${PROJECT_ROOT}
if [ -L scripts/module-create.sh ]

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# lw-build-system/scripts/config-printflags.sh
#
# (c)2009, Laurence Withers <l@lwithers.me.uk>.

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# lw-build-system/scripts/module-create.sh
#
# (c)2009, Laurence Withers, <l@lwithers.me.uk>.
@ -19,7 +19,7 @@ cd $(dirname $(pwd))
P=$(basename $(pwd))
TOP=$(pwd)
[ -z "${VERBOSE}" ] && VERBOSE="0"
source scripts/functions.sh || exit 1
source "./scripts/functions.sh" || exit 1
@ -62,7 +62,7 @@ get_cname() {
# for each argument X, it will replace @X@ with ${X}
do_parameter_subst() {
CNAME=$(get_cname ${NAME})
do_cmd source ~/.lwbuildrc || exit 1
do_cmd source "~/.lwbuildrc" || exit 1
for param in P NAME CNAME AUTHOR EMAIL VIM_MODELINE KATE_MODELINE $@
do
do_cmd_redir sedscript echo "s,@${param}@,${!param},g" || exit 1
@ -113,7 +113,7 @@ do_cmd cd src/${NAME} || cleanup
do_cmd rm instantiate || cleanup
do_cmd_redir .params echo "${MODULE_PARAMS}" || cleanup
( source ../../${TEMPLATE}/instantiate ) || cleanup
( source "../../${TEMPLATE}/instantiate" ) || cleanup
print_success "Module instantiated"
grep -r "@TODO@" .

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# lw-build-system/scripts/release.sh
#
# (c)2009, Laurence Withers, <l@lwithers.me.uk>.

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# lw-build-system/scripts/version.sh
#
# (c)2009, Laurence Withers <l@lwithers.me.uk>.
@ -43,32 +43,32 @@ edit_versions() {
}
bump_major() {
source version
source "./version"
edit_versions "version" "VERMAJOR" "$[${VERMAJOR} + 1]" "VERMINOR" "0" "VERMICRO" "0"
}
bump_minor() {
source version
source "./version"
edit_versions "version" "VERMINOR" "$[${VERMINOR} + 1]" "VERMICRO" "0"
}
bump_micro() {
source version
source "./version"
edit_versions "version" "VERMICRO" "$[${VERMICRO} + 1]"
}
bump_somajor() {
source src/$1/soversion
source "./src/$1/soversion"
edit_versions "src/$1/soversion" "SOMAJOR" "$[${SOMAJOR} + 1]" "SOMINOR" "0" "SOMICRO" "0"
}
bump_somicro() {
source src/$1/soversion
source "./src/$1/soversion"
edit_versions "src/$1/soversion" "SOMICRO" "$[${SOMICRO} + 1]"
}
do_tag() {
source version
source "./version"
git tag "${VERMAJOR}.${VERMINOR}.${VERMICRO}"
}

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# @P@/make.sh
#
# (c)2009, @AUTHOR@, <@EMAIL@>.
@ -15,19 +15,19 @@ then
echo "Configuration file not found???"
exit 1
fi
source "config" # don't fail on error, since last command in config might return false
source "./config" # don't fail on error, since last command in config might return false
# Get version information
source version || exit 1
source "./version" || exit 1
VERSION="${VERMAJOR}.${VERMINOR}.${VERMICRO}"
# Get standard functions
[ -z "${VERBOSE}" ] && VERBOSE="0"
source scripts/functions.sh || exit 1
source "./scripts/functions.sh" || exit 1
# List of directories which will be emptied by clean.

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# @P@/test.sh
#
# (c)2009, @AUTHOR@, <@EMAIL@>.
@ -33,10 +33,10 @@ print_tests() {
echo "---------------------------------------------------------------------"
for EXE in obj/tests/*
do
[ -x ${EXE} ] || continue
NAME=$(echo ${EXE} | sed 's,obj/tests/,,')
[ -x "${EXE}" ] || continue
NAME="$(echo "${EXE}" | sed 's,obj/tests/,,')"
echo -ne "${NAME}\t"
LD_LIBRARY_PATH="obj" ${EXE} --print-summary
LD_LIBRARY_PATH="obj" "${EXE}" --print-summary
done
}

View File

@ -33,7 +33,7 @@ cd ${X}
cd $(dirname $0) || exit 1
SCRIPT_ROOT=$(pwd)
source skel/scripts/functions.sh || exit 1
source "./skel/scripts/functions.sh" || exit 1
do_cmd cd ${PROJECT_ROOT} || exit 1