Skip to content

Commit

Permalink
replace source with . in posix sh scripts
Browse files Browse the repository at this point in the history
source makes the intent and the inclusion of another script much
clearer, but it's not in POSIX and dash apparently does not support
it.
  • Loading branch information
rofl0r committed Nov 12, 2013
1 parent 1d5866f commit 7bb3fcc
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions KEEP/bin/butch
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [ ! -e "$CONFIG" ] ; then
exit 1
fi

source "$CONFIG"
. "$CONFIG"

BINDIR=$(dirname "$(readlink -f "$0")")

Expand Down Expand Up @@ -65,6 +65,6 @@ case $1 in
install|prefetch|rebuild) : ;;
*) usage;; # we exec anyway to get butch-core's usage info
esac

exec "$BINDIR"/$prog "$@"

2 changes: 1 addition & 1 deletion build-stage
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
export H="$PWD"
source ./config
. ./config

if [ ! -r "$H"/config ]; then
printf -- "couldn't read configuration file: %s\n" "$H/config"
Expand Down
2 changes: 1 addition & 1 deletion enter-chroot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
[ -z "$CONFIG" ] && CONFIG=./config
source "$CONFIG"
. "$CONFIG"
export H="$PWD"

if [ -z "$R" ] ; then
Expand Down
2 changes: 1 addition & 1 deletion utils/print-builddir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
source "$PWD"/config
. "$PWD"/config
echo "$R"

2 changes: 1 addition & 1 deletion utils/resume-stage0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

# this var is usually set by build-stage; omitting it results in build error of stage0_finish
export H="$PWD"
source "$H"/config
. "$H"/config
CONFIG="$H"/config BUTCHDB="$R"/var/lib/butch.db "$R"/bin/butch install stage0
2 changes: 1 addition & 1 deletion utils/run-emulator.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
export H="$PWD"
source ./config
. ./config

console=
rw=rw
Expand Down
2 changes: 1 addition & 1 deletion utils/update-chroot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
MYDIR=$(dirname "$(readlink -f "$0")")
export H="$MYDIR/.."
source "$H"/config
. "$H"/config

if [ -z "$R" ] ; then
echo "error sourcing config" >&2
Expand Down

0 comments on commit 7bb3fcc

Please sign in to comment.