diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-08-16 02:18:29 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-08-16 02:18:29 -0400 |
commit | 9862c71c160631bfc1a14ccbd42688c547ca9c0b (patch) | |
tree | 737caec8a421f93263f6e477466f6db37e1367d3 | |
parent | fabc14e262414debb6bbd562e6a6a37afa2cce79 (diff) | |
download | devtools32-9862c71c160631bfc1a14ccbd42688c547ca9c0b.tar.xz |
support formatted messages to stat_busy, lock, and slock
-rw-r--r-- | lib/common.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/common.sh b/lib/common.sh index c9deebc..5a9f6fe 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -50,7 +50,7 @@ error() { stat_busy() { local mesg=$1; shift - printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}...${ALL_OFF}" >&2 + printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}...${ALL_OFF}" "$@" >&2 } stat_done() { @@ -140,7 +140,7 @@ get_full_version() { lock() { local fd=$1 local file=$2 - local mesg=$3 + local mesg=("$@:3") # Only reopen the FD if it wasn't handed to us if [[ "$(readlink -f /dev/fd/$fd)" != "$(readlink -f "$file")" ]]; then @@ -149,7 +149,7 @@ lock() { fi if ! flock -n $fd; then - stat_busy "$mesg" + stat_busy "${mesg[@]}" flock $fd stat_done fi @@ -161,7 +161,7 @@ lock() { slock() { local fd=$1 local file=$2 - local mesg=$3 + local mesg=("$@:3") # Only reopen the FD if it wasn't handed to us if [[ "$(readlink -f /dev/fd/$fd)" != "$(readlink -f "$file")" ]]; then @@ -171,7 +171,7 @@ slock() { eval "exec $fd>"'"$file"' if ! flock -sn $fd; then - stat_busy "$mesg" + stat_busy "${mesg[@]}" flock -s $fd stat_done fi |