aboutsummaryrefslogtreecommitdiff
path: root/contrib/verifybinaries
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-07-02 19:48:08 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-07-04 19:35:25 +0300
commit1ac454a3844b9b8389de0f660fa9455c0efa7140 (patch)
tree25912907998366914c0e0328eb53e214e35af13c /contrib/verifybinaries
parent6c21a801f3df4942d09d5a33d3dab04807f7bb37 (diff)
downloadbitcoin-1ac454a3844b9b8389de0f660fa9455c0efa7140.tar.xz
Enable ShellCheck rules
Enabled ShellCheck rules: SC1087 SC2001 SC2004 SC2005 SC2006 SC2016 SC2028 SC2048 SC2066 (note that IFS already contains only a line feed) SC2116 SC2166 SC2181 SC2206 SC2207 SC2230 SC2236
Diffstat (limited to 'contrib/verifybinaries')
-rwxr-xr-xcontrib/verifybinaries/verify.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/contrib/verifybinaries/verify.sh b/contrib/verifybinaries/verify.sh
index fc7492ad3b..bfe74aa4fa 100755
--- a/contrib/verifybinaries/verify.sh
+++ b/contrib/verifybinaries/verify.sh
@@ -13,7 +13,7 @@
export LC_ALL=C
function clean_up {
- for file in $*
+ for file in "$@"
do
rm "$file" 2> /dev/null
done
@@ -82,22 +82,20 @@ else
exit 2
fi
-#first we fetch the file containing the signature
-WGETOUT=$(wget -N "$HOST1$BASEDIR$SIGNATUREFILENAME" 2>&1)
-
-#and then see if wget completed successfully
-if [ $? -ne 0 ]; then
+if ! WGETOUT=$(wget -N "$HOST1$BASEDIR$SIGNATUREFILENAME" 2>&1); then
echo "Error: couldn't fetch signature file. Have you specified the version number in the following format?"
+ # shellcheck disable=SC1087
echo "[$VERSIONPREFIX]<version>-[$RCVERSIONSTRING[0-9]] (example: ${VERSIONPREFIX}0.10.4-${RCVERSIONSTRING}1)"
echo "wget output:"
+ # shellcheck disable=SC2001
echo "$WGETOUT"|sed 's/^/\t/g'
exit 2
fi
-WGETOUT=$(wget -N -O "$SIGNATUREFILENAME.2" "$HOST2$BASEDIR$SIGNATUREFILENAME" 2>&1)
-if [ $? -ne 0 ]; then
+if ! WGETOUT=$(wget -N -O "$SIGNATUREFILENAME.2" "$HOST2$BASEDIR$SIGNATUREFILENAME" 2>&1); then
echo "bitcoin.org failed to provide signature file, but bitcoincore.org did?"
echo "wget output:"
+ # shellcheck disable=SC2001
echo "$WGETOUT"|sed 's/^/\t/g'
clean_up $SIGNATUREFILENAME
exit 3
@@ -128,6 +126,7 @@ if [ $RET -ne 0 ]; then
fi
echo "gpg output:"
+ # shellcheck disable=SC2001
echo "$GPGOUT"|sed 's/^/\t/g'
clean_up $SIGNATUREFILENAME $SIGNATUREFILENAME.2 $TMPFILE
exit "$RET"