aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2020-05-08 09:22:05 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2020-05-08 09:22:33 -0700
commitbb8dfcef28e56dcf630a6fab9393c0979d9e5c6d (patch)
treeb69b138083cfdbd4798ca9e2e6a588a17586ab7b /mastermirror-staging.sh
parentChange git-restore-mtime from python2.7 to 3.6 (diff)
downloadmastermirror-scripts-bb8dfcef28e56dcf630a6fab9393c0979d9e5c6d.tar.gz
mastermirror-scripts-bb8dfcef28e56dcf630a6fab9393c0979d9e5c6d.tar.bz2
mastermirror-scripts-bb8dfcef28e56dcf630a6fab9393c0979d9e5c6d.zip
mastermirror-staging: better checking of required commands
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'mastermirror-staging.sh')
-rwxr-xr-xmastermirror-staging.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/mastermirror-staging.sh b/mastermirror-staging.sh
index 0495171..22c76aa 100755
--- a/mastermirror-staging.sh
+++ b/mastermirror-staging.sh
@@ -27,14 +27,15 @@ WGET="/usr/bin/wget --timeout=2 --quiet --timestamping"
GIT_RESTORE_MTIME="/usr/lib/python-exec/python3.6/git-restore-mtime -q -m -c --first-parent"
rc=0
-for cmd in \
- "${GIT_RESTORE_MTIME}" \
- "${WGET}" \
- "${GIT}" \
+for cmdname in \
+ GIT_RESTORE_MTIME \
+ WGET \
+ GIT \
; do
+ cmd=${!cmdname}
cmd=${cmd/ *}
- if [ ! -x $cmd ]; then
- echo "Missing tool: $cmd" 1>&2
+ if [[ -z "$cmd" ]] || [[ ! -x "$cmd" ]]; then
+ echo "Missing tool ($cmdname): $cmd" 1>&2
rc=1
fi
done