Skip to content

Commit 5bea05b

Browse files
committed
Merge #11834: [verify-commits] Fix gpg.sh's echoing for commits with '\n'
a38686c [verify-commits] Fix gpg.sh's echoing for commits with '\n' (Matt Corallo) Pull request description: Should fix master travis failures Tree-SHA512: 1e96476e4db0474f1dc2c6973cdb1154316b7cec13d3fe46f3383cfe4f1ed30c2eee08a0d047931f20b2fa83baaacb4687f39e1cab6f264009cd0292134facdd
2 parents 91eeaa0 + a38686c commit 5bea05b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

contrib/verify-commits/gpg.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ REVSIG=false
99
IFS='
1010
'
1111
if [ "$BITCOIN_VERIFY_COMMITS_ALLOW_SHA1" = 1 ]; then
12-
GPG_RES="$(echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null)"
12+
GPG_RES="$(printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null)"
1313
else
1414
# Note how we've disabled SHA1 with the --weak-digest option, disabling
1515
# signatures - including selfsigs - that use SHA1. While you might think that
@@ -24,15 +24,15 @@ else
2424
case "$LINE" in
2525
"gpg (GnuPG) 1.4.1"*|"gpg (GnuPG) 2.0."*)
2626
echo "Please upgrade to at least gpg 2.1.10 to check for weak signatures" > /dev/stderr
27-
GPG_RES="$(echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null)"
27+
GPG_RES="$(printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null)"
2828
;;
2929
# We assume if you're running 2.1+, you're probably running 2.1.10+
3030
# gpg will fail otherwise
3131
# We assume if you're running 1.X, it is either 1.4.1X or 1.4.20+
3232
# gpg will fail otherwise
3333
esac
3434
done
35-
[ "$GPG_RES" = "" ] && GPG_RES="$(echo "$INPUT" | gpg --trust-model always --weak-digest sha1 "$@" 2>/dev/null)"
35+
[ "$GPG_RES" = "" ] && GPG_RES="$(printf '%s\n' "$INPUT" | gpg --trust-model always --weak-digest sha1 "$@" 2>/dev/null)"
3636
fi
3737
for LINE in $(echo "$GPG_RES"); do
3838
case "$LINE" in
@@ -57,8 +57,8 @@ if ! $VALID; then
5757
exit 1
5858
fi
5959
if $VALID && $REVSIG; then
60-
echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null | grep "\[GNUPG:\] \(NEWSIG\|SIG_ID\|VALIDSIG\)"
60+
printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null | grep "\[GNUPG:\] \(NEWSIG\|SIG_ID\|VALIDSIG\)"
6161
echo "$GOODREVSIG"
6262
else
63-
echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null
63+
printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null
6464
fi

0 commit comments

Comments
 (0)