From 13866f7ebd6beb3cf996ee13550c5d7d44ed3610 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Tue, 25 May 2021 16:02:01 +0200 Subject: [PATCH] ci: fix bitcoin-only strings check of fw images shellcheck saves the day In tools/check-bitcoin-only line 9: RETURN=1 ^----^ SC2030: Modification of RETURN is local (to subshell caused by pipeline). In tools/check-bitcoin-only line 13: exit $RETURN ^-----^ SC2031: RETURN was modified in a subshell. That change might be lost. --- tools/check-bitcoin-only | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/check-bitcoin-only b/tools/check-bitcoin-only index f82b5d1c1..812dfceba 100755 --- a/tools/check-bitcoin-only +++ b/tools/check-bitcoin-only @@ -1,12 +1,20 @@ #!/bin/sh RETURN=0 +EXCEPTIONS="decred|omni|ripple|dash|TEXT_MARGIN_LEFT|APP_CARDANO_PASSPHRASE|APP_MONERO_LIVE_REFRESH|ed25519 cardano|dash_width|dashlane|flo|mnemonic|meter|refuse|fused|enemy|cinema|syntaxerror|mix|palm" + # dump all coins except the first 3 (Bitcoin, Testnet, Regtest) -./common/tools/cointool.py dump -l -p -t | grep '"name"' | cut -d '"' -f 4 | tail -n +4 | while read altcoin; do +ALTCOINS=$(./common/tools/cointool.py dump -l -p -t | grep '"name"' | cut -d '"' -f 4 | tail -n +4) +# split on newlines only +OLDIFS=$IFS +IFS=" +" +for altcoin in $ALTCOINS; do # echo :"$altcoin": - if strings $1 | grep "$altcoin" | grep -v TEXT_MARGIN_LEFT | grep -v _MIN_MNEMONIC_LENGTH_WORD ; then + if strings "$1" | grep -i "$altcoin" | grep -Evi "$EXCEPTIONS" ; then RETURN=1 fi done +IFS=$OLDIFS exit $RETURN