summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2017-05-05 18:41:08 -0400
committerErich Eckner <git@eckner.net>2017-07-14 06:57:23 +0200
commitc440e6f1c531688668ae25924f85cc45980f8295 (patch)
treeccb404a660ae827fdbbd45c00eddc11831e6e216 /lib
parent18e2fc20d4eeaa17d4aa1b9b5e323598d68e5227 (diff)
downloaddevtools-c440e6f1c531688668ae25924f85cc45980f8295.tar.xz
Quote strings that shellcheck warns about.
These changes are all strictly "slap some double-quotes in there". Anything more than that is not included in this commit.
Diffstat (limited to 'lib')
-rw-r--r--lib/common.sh16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/common.sh b/lib/common.sh
index 8f043e8..4a15d9a 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -79,7 +79,7 @@ cleanup() {
if [[ -n ${WORKDIR:-} ]] && $_setup_workdir; then
rm -rf "$WORKDIR"
fi
- exit ${1:-0}
+ exit "${1:-0}"
}
abort() {
@@ -112,7 +112,7 @@ in_array() {
local needle=$1; shift
local item
for item in "$@"; do
- [[ $item = $needle ]] && return 0 # Found
+ [[ $item = "$needle" ]] && return 0 # Found
done
return 1 # Not Found
}
@@ -134,7 +134,7 @@ get_full_version() {
else
for i in pkgver pkgrel epoch; do
local indirect="${i}_override"
- eval $(declare -f package_$1 | sed -n "s/\(^[[:space:]]*$i=\)/${i}_override=/p")
+ eval "$(declare -f "package_$1" | sed -n "s/\(^[[:space:]]*$i=\)/${i}_override=/p")"
[[ -z ${!indirect} ]] && eval ${indirect}=\"${!i}\"
done
if (( ! epoch_override )); then
@@ -155,9 +155,9 @@ lock() {
eval "exec $1>"'"$2"'
fi
- if ! flock -n $1; then
+ if ! flock -n "$1"; then
stat_busy "${@:3}"
- flock $1
+ flock "$1"
stat_done
fi
}
@@ -172,9 +172,9 @@ slock() {
eval "exec $1>"'"$2"'
fi
- if ! flock -sn $1; then
+ if ! flock -sn "$1"; then
stat_busy "${@:3}"
- flock -s $1
+ flock -s "$1"
stat_done
fi
}
@@ -184,6 +184,8 @@ slock() {
##
lock_close() {
local fd=$1
+ # https://github.com/koalaman/shellcheck/issues/862
+ # shellcheck disable=2034
exec {fd}>&-
}