From f6b3382fa3cf988e7e80d0cab14393d4f9ec2113 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 4 Oct 2017 19:58:51 +0200 Subject: Remove unused variables --- contrib/gitian-build.sh | 1 - contrib/verify-commits/verify-commits.sh | 2 -- contrib/verifybinaries/verify.sh | 2 -- 3 files changed, 5 deletions(-) (limited to 'contrib') diff --git a/contrib/gitian-build.sh b/contrib/gitian-build.sh index 8fdec21b0e..511c1a4c48 100755 --- a/contrib/gitian-build.sh +++ b/contrib/gitian-build.sh @@ -6,7 +6,6 @@ sign=false verify=false build=false -setupenv=false # Systems to build linux=true diff --git a/contrib/verify-commits/verify-commits.sh b/contrib/verify-commits/verify-commits.sh index 7194b040eb..85661f4670 100755 --- a/contrib/verify-commits/verify-commits.sh +++ b/contrib/verify-commits/verify-commits.sh @@ -12,8 +12,6 @@ VERIFIED_ROOT=$(cat "${DIR}/trusted-git-root") VERIFIED_SHA512_ROOT=$(cat "${DIR}/trusted-sha512-root-commit") REVSIG_ALLOWED=$(cat "${DIR}/allow-revsig-commits") -HAVE_FAILED=false - HAVE_GNU_SHA512=1 [ ! -x "$(which sha512sum)" ] && HAVE_GNU_SHA512=0 diff --git a/contrib/verifybinaries/verify.sh b/contrib/verifybinaries/verify.sh index 409f517c9f..320add64d0 100755 --- a/contrib/verifybinaries/verify.sh +++ b/contrib/verifybinaries/verify.sh @@ -76,8 +76,6 @@ if [ -n "$1" ]; then BASEDIR="$BASEDIR$RCSUBDIR.$RCVERSION/" fi fi - - SIGNATUREFILE="$BASEDIR$SIGNATUREFILENAME" else echo "Error: need to specify a version on the command line" exit 2 -- cgit v1.2.3 From b9e79ab415996964cfdfaaa0f8dddbcda8aa7d32 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 4 Oct 2017 21:15:55 +0200 Subject: Remove "\n" from echo argument. echo does not support escape sequences. --- contrib/gitian-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/gitian-build.sh b/contrib/gitian-build.sh index 511c1a4c48..a7d9fe3bef 100755 --- a/contrib/gitian-build.sh +++ b/contrib/gitian-build.sh @@ -105,7 +105,7 @@ while :; do fi shift else - echo 'Error: "--os" requires an argument containing an l (for linux), w (for windows), or x (for Mac OSX)\n' + echo 'Error: "--os" requires an argument containing an l (for linux), w (for windows), or x (for Mac OSX)' exit 1 fi ;; -- cgit v1.2.3 From 1e44ae0e198b0bc3c4363774a27a3e72a5c2a47b Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 4 Oct 2017 21:19:45 +0200 Subject: Add error handling: exit if cd fails --- contrib/tidy_datadir.sh | 2 +- contrib/verifybinaries/verify.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib') diff --git a/contrib/tidy_datadir.sh b/contrib/tidy_datadir.sh index 8960f8811d..b845b34e41 100755 --- a/contrib/tidy_datadir.sh +++ b/contrib/tidy_datadir.sh @@ -4,7 +4,7 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. if [ -d "$1" ]; then - cd "$1" + cd "$1" || exit 1 else echo "Usage: $0 " >&2 echo "Removes obsolete Bitcoin database files" >&2 diff --git a/contrib/verifybinaries/verify.sh b/contrib/verifybinaries/verify.sh index 320add64d0..bf2a10337d 100755 --- a/contrib/verifybinaries/verify.sh +++ b/contrib/verifybinaries/verify.sh @@ -33,7 +33,7 @@ if [ ! -d "$WORKINGDIR" ]; then mkdir "$WORKINGDIR" fi -cd "$WORKINGDIR" +cd "$WORKINGDIR" || exit 1 #test if a version number has been passed as an argument if [ -n "$1" ]; then -- cgit v1.2.3 From 564a172dfdce5d0c234c271a7a521ef440ff5565 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 4 Oct 2017 21:23:31 +0200 Subject: Add required space to [[ -n "$1" ]] (previously [[ -n"$1" ]]) --- contrib/gitian-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/gitian-build.sh b/contrib/gitian-build.sh index a7d9fe3bef..631fba9089 100755 --- a/contrib/gitian-build.sh +++ b/contrib/gitian-build.sh @@ -188,7 +188,7 @@ then fi # Get signer -if [[ -n"$1" ]] +if [[ -n "$1" ]] then SIGNER=$1 shift -- cgit v1.2.3 From 80f5f28d38e59b550ab7e7465cfa48defee343a6 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 4 Oct 2017 21:25:25 +0200 Subject: Fix incorrect quoting of quotes (the previous quotes had no effect beyond unquoting) --- contrib/macdeploy/detached-sig-create.sh | 2 +- contrib/verify-commits/verify-commits.sh | 2 +- contrib/verifybinaries/verify.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'contrib') diff --git a/contrib/macdeploy/detached-sig-create.sh b/contrib/macdeploy/detached-sig-create.sh index 7f017bb4f1..3379a4599c 100755 --- a/contrib/macdeploy/detached-sig-create.sh +++ b/contrib/macdeploy/detached-sig-create.sh @@ -40,7 +40,7 @@ grep CodeResources < "${TEMPLIST}" | while read i; do RESOURCE="${TEMPDIR}/${OUTROOT}/${TARGETFILE}" DIRNAME="`dirname "${RESOURCE}"`" mkdir -p "${DIRNAME}" - echo "Adding resource for: "${TARGETFILE}"" + echo "Adding resource for: \"${TARGETFILE}\"" cp "${i}" "${RESOURCE}" done diff --git a/contrib/verify-commits/verify-commits.sh b/contrib/verify-commits/verify-commits.sh index 85661f4670..98ee243ea7 100755 --- a/contrib/verify-commits/verify-commits.sh +++ b/contrib/verify-commits/verify-commits.sh @@ -36,7 +36,7 @@ PREV_COMMIT="" while true; do if [ "$CURRENT_COMMIT" = $VERIFIED_ROOT ]; then - echo "There is a valid path from "$CURRENT_COMMIT" to $VERIFIED_ROOT where all commits are signed!" + echo "There is a valid path from \"$CURRENT_COMMIT\" to $VERIFIED_ROOT where all commits are signed!" exit 0 fi diff --git a/contrib/verifybinaries/verify.sh b/contrib/verifybinaries/verify.sh index bf2a10337d..e0266bf08a 100755 --- a/contrib/verifybinaries/verify.sh +++ b/contrib/verifybinaries/verify.sh @@ -87,7 +87,7 @@ WGETOUT=$(wget -N "$HOST1$BASEDIR$SIGNATUREFILENAME" 2>&1) #and then see if wget completed successfully if [ $? -ne 0 ]; then echo "Error: couldn't fetch signature file. Have you specified the version number in the following format?" - echo "[$VERSIONPREFIX]-[$RCVERSIONSTRING[0-9]] (example: "$VERSIONPREFIX"0.10.4-"$RCVERSIONSTRING"1)" + echo "[$VERSIONPREFIX]-[$RCVERSIONSTRING[0-9]] (example: ${VERSIONPREFIX}0.10.4-${RCVERSIONSTRING}1)" echo "wget output:" echo "$WGETOUT"|sed 's/^/\t/g' exit 2 -- cgit v1.2.3 From 193c2fb4c88fbc4e0b19033ed9c0351ac1f02269 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 4 Oct 2017 21:32:21 +0200 Subject: Use bash instead of POSIX sh. POSIX sh does not support arrays. --- contrib/devtools/gen-manpages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/devtools/gen-manpages.sh b/contrib/devtools/gen-manpages.sh index 967717e1e0..925d6a6252 100755 --- a/contrib/devtools/gen-manpages.sh +++ b/contrib/devtools/gen-manpages.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)} SRCDIR=${SRCDIR:-$TOPDIR/src} -- cgit v1.2.3 From 683b9d280bba7a0f0f78818e5e29a21cef2eb5e6 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Mon, 9 Oct 2017 23:20:52 +0200 Subject: Fix valid path output --- contrib/verify-commits/verify-commits.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/verify-commits/verify-commits.sh b/contrib/verify-commits/verify-commits.sh index 98ee243ea7..9ba01791a8 100755 --- a/contrib/verify-commits/verify-commits.sh +++ b/contrib/verify-commits/verify-commits.sh @@ -33,10 +33,11 @@ fi NO_SHA1=1 PREV_COMMIT="" +INITIAL_COMMIT=${CURRENT_COMMIT} while true; do if [ "$CURRENT_COMMIT" = $VERIFIED_ROOT ]; then - echo "There is a valid path from \"$CURRENT_COMMIT\" to $VERIFIED_ROOT where all commits are signed!" + echo "There is a valid path from \"$INITIAL_COMMIT\" to $VERIFIED_ROOT where all commits are signed!" exit 0 fi -- cgit v1.2.3 From 13a81b19df7acff51187655bb755f1371f9c83ca Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 18 Oct 2017 07:34:25 +0200 Subject: Add quotes to variable assignment (as requested by @TheBlueMatt) --- contrib/verify-commits/verify-commits.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/verify-commits/verify-commits.sh b/contrib/verify-commits/verify-commits.sh index 9ba01791a8..78320a4ce3 100755 --- a/contrib/verify-commits/verify-commits.sh +++ b/contrib/verify-commits/verify-commits.sh @@ -33,7 +33,7 @@ fi NO_SHA1=1 PREV_COMMIT="" -INITIAL_COMMIT=${CURRENT_COMMIT} +INITIAL_COMMIT="${CURRENT_COMMIT}" while true; do if [ "$CURRENT_COMMIT" = $VERIFIED_ROOT ]; then -- cgit v1.2.3