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
commit dcee211388
9 changed files with 25 additions and 25 deletions

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}"
}