test: Enable SC2086 shellcheck rule

This commit is contained in:
Hennadii Stepanov 2021-11-07 14:13:39 +02:00
parent 5cc083cd46
commit 9a1ad7bc0d
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
20 changed files with 62 additions and 57 deletions

View file

@ -15,5 +15,5 @@ export RUN_UNIT_TESTS_SEQUENTIAL="true"
export RUN_UNIT_TESTS="false" export RUN_UNIT_TESTS="false"
export GOAL="install" export GOAL="install"
export PREVIOUS_RELEASES_TO_DOWNLOAD="v0.15.2 v0.16.3 v0.17.2 v0.18.1 v0.19.1 v0.20.1" export PREVIOUS_RELEASES_TO_DOWNLOAD="v0.15.2 v0.16.3 v0.17.2 v0.18.1 v0.19.1 v0.20.1"
export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-reduce-exports export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-reduce-exports \
--enable-debug --disable-fuzz-binary CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\" CC=gcc-8 CXX=g++-8" --enable-debug --disable-fuzz-binary CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\" CC=gcc-8 CXX=g++-8"

View file

@ -12,6 +12,7 @@ fi
if [ "$CI_OS_NAME" == "macos" ]; then if [ "$CI_OS_NAME" == "macos" ]; then
sudo -H pip3 install --upgrade pip sudo -H pip3 install --upgrade pip
# shellcheck disable=SC2086
IN_GETOPT_BIN="/usr/local/opt/gnu-getopt/bin/getopt" ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES IN_GETOPT_BIN="/usr/local/opt/gnu-getopt/bin/getopt" ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES
fi fi
@ -39,6 +40,7 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
systemctl restart docker systemctl restart docker
fi fi
# shellcheck disable=SC2086
DOCKER_ID=$(docker run $DOCKER_ADMIN --rm --interactive --detach --tty \ DOCKER_ID=$(docker run $DOCKER_ADMIN --rm --interactive --detach --tty \
--mount type=bind,src=$BASE_ROOT_DIR,dst=/ro_base,readonly \ --mount type=bind,src=$BASE_ROOT_DIR,dst=/ro_base,readonly \
--mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR \ --mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR \
@ -54,7 +56,7 @@ else
fi fi
DOCKER_EXEC () { DOCKER_EXEC () {
$DOCKER_CI_CMD_PREFIX bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $P_CI_DIR && $*" $DOCKER_CI_CMD_PREFIX bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd \"$P_CI_DIR\" && $*"
} }
export -f DOCKER_EXEC export -f DOCKER_EXEC
@ -64,11 +66,12 @@ fi
if [[ $DOCKER_NAME_TAG == centos* ]]; then if [[ $DOCKER_NAME_TAG == centos* ]]; then
${CI_RETRY_EXE} DOCKER_EXEC dnf -y install epel-release ${CI_RETRY_EXE} DOCKER_EXEC dnf -y install epel-release
${CI_RETRY_EXE} DOCKER_EXEC dnf -y --allowerasing install $DOCKER_PACKAGES $PACKAGES ${CI_RETRY_EXE} DOCKER_EXEC dnf -y --allowerasing install "$DOCKER_PACKAGES" "$PACKAGES"
elif [ "$CI_USE_APT_INSTALL" != "no" ]; then elif [ "$CI_USE_APT_INSTALL" != "no" ]; then
${CI_RETRY_EXE} DOCKER_EXEC apt-get update ${CI_RETRY_EXE} DOCKER_EXEC apt-get update
${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -y $PACKAGES $DOCKER_PACKAGES ${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -y "$PACKAGES" "$DOCKER_PACKAGES"
if [ -n "$PIP_PACKAGES" ]; then if [ -n "$PIP_PACKAGES" ]; then
# shellcheck disable=SC2086
${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES
fi fi
fi fi
@ -85,8 +88,8 @@ DOCKER_EXEC echo "Free disk space:"
DOCKER_EXEC df -h DOCKER_EXEC df -h
if [ "$RUN_FUZZ_TESTS" = "true" ] || [ "$RUN_UNIT_TESTS" = "true" ] || [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then if [ "$RUN_FUZZ_TESTS" = "true" ] || [ "$RUN_UNIT_TESTS" = "true" ] || [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then
if [ ! -d ${DIR_QA_ASSETS} ]; then if [ ! -d "${DIR_QA_ASSETS}" ]; then
DOCKER_EXEC git clone --depth=1 https://github.com/bitcoin-core/qa-assets ${DIR_QA_ASSETS} DOCKER_EXEC git clone --depth=1 https://github.com/bitcoin-core/qa-assets "${DIR_QA_ASSETS}"
fi fi
export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_seed_corpus/ export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_seed_corpus/
@ -106,17 +109,17 @@ fi
if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
echo "Create $BASE_ROOT_DIR" echo "Create $BASE_ROOT_DIR"
DOCKER_EXEC rsync -a /ro_base/ $BASE_ROOT_DIR DOCKER_EXEC rsync -a /ro_base/ "$BASE_ROOT_DIR"
fi fi
if [ "$USE_BUSY_BOX" = "true" ]; then if [ "$USE_BUSY_BOX" = "true" ]; then
echo "Setup to use BusyBox utils" echo "Setup to use BusyBox utils"
DOCKER_EXEC mkdir -p $BASE_SCRATCH_DIR/bins/ DOCKER_EXEC mkdir -p "${BASE_SCRATCH_DIR}/bins/"
# tar excluded for now because it requires passing in the exact archive type in ./depends (fixed in later BusyBox version) # tar excluded for now because it requires passing in the exact archive type in ./depends (fixed in later BusyBox version)
# find excluded for now because it does not recognize the -delete option in ./depends (fixed in later BusyBox version) # find excluded for now because it does not recognize the -delete option in ./depends (fixed in later BusyBox version)
# ar excluded for now because it does not recognize the -q option in ./depends (unknown if fixed) # ar excluded for now because it does not recognize the -q option in ./depends (unknown if fixed)
# shellcheck disable=SC1010 # shellcheck disable=SC1010
DOCKER_EXEC for util in \$\(busybox --list \| grep -v "^ar$" \| grep -v "^tar$" \| grep -v "^find$"\)\; do ln -s \$\(command -v busybox\) $BASE_SCRATCH_DIR/bins/\$util\; done DOCKER_EXEC for util in \$\(busybox --list \| grep -v "^ar$" \| grep -v "^tar$" \| grep -v "^find$"\)\; do ln -s \$\(command -v busybox\) "${BASE_SCRATCH_DIR}/bins/\$util"\; done
# Print BusyBox version # Print BusyBox version
DOCKER_EXEC patch --help DOCKER_EXEC patch --help
fi fi

View file

@ -8,12 +8,12 @@ export LC_ALL=C.UTF-8
# Make sure default datadir does not exist and is never read by creating a dummy file # Make sure default datadir does not exist and is never read by creating a dummy file
if [ "$CI_OS_NAME" == "macos" ]; then if [ "$CI_OS_NAME" == "macos" ]; then
echo > $HOME/Library/Application\ Support/Bitcoin echo > "${HOME}/Library/Application Support/Bitcoin"
else else
DOCKER_EXEC echo \> \$HOME/.bitcoin DOCKER_EXEC echo \> \$HOME/.bitcoin
fi fi
DOCKER_EXEC mkdir -p ${DEPENDS_DIR}/SDKs ${DEPENDS_DIR}/sdk-sources DOCKER_EXEC mkdir -p "${DEPENDS_DIR}/SDKs" "${DEPENDS_DIR}/sdk-sources"
OSX_SDK_BASENAME="Xcode-${XCODE_VERSION}-${XCODE_BUILD_ID}-extracted-SDK-with-libcxx-headers.tar.gz" OSX_SDK_BASENAME="Xcode-${XCODE_VERSION}-${XCODE_BUILD_ID}-extracted-SDK-with-libcxx-headers.tar.gz"
OSX_SDK_PATH="${DEPENDS_DIR}/sdk-sources/${OSX_SDK_BASENAME}" OSX_SDK_PATH="${DEPENDS_DIR}/sdk-sources/${OSX_SDK_BASENAME}"
@ -42,7 +42,7 @@ if [ -n "$XCODE_VERSION" ] && [ -f "$OSX_SDK_PATH" ]; then
DOCKER_EXEC tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH" DOCKER_EXEC tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH"
fi fi
if [[ $HOST = *-mingw32 ]]; then if [[ $HOST = *-mingw32 ]]; then
DOCKER_EXEC update-alternatives --set $HOST-g++ \$\(which $HOST-g++-posix\) DOCKER_EXEC update-alternatives --set "${HOST}-g++" \$\(which "${HOST}-g++-posix"\)
fi fi
if [ -z "$NO_DEPENDS" ]; then if [ -z "$NO_DEPENDS" ]; then
if [[ $DOCKER_NAME_TAG == centos* ]]; then if [[ $DOCKER_NAME_TAG == centos* ]]; then
@ -53,7 +53,7 @@ if [ -z "$NO_DEPENDS" ]; then
else else
SHELL_OPTS="CONFIG_SHELL=" SHELL_OPTS="CONFIG_SHELL="
fi fi
DOCKER_EXEC $SHELL_OPTS make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS DOCKER_EXEC "$SHELL_OPTS" make "$MAKEJOBS" -C depends HOST="$HOST" "$DEP_OPTS"
fi fi
if [ -n "$PREVIOUS_RELEASES_TO_DOWNLOAD" ]; then if [ -n "$PREVIOUS_RELEASES_TO_DOWNLOAD" ]; then
DOCKER_EXEC test/get_previous_releases.py -b -t "$PREVIOUS_RELEASES_DIR" "${PREVIOUS_RELEASES_TO_DOWNLOAD}" DOCKER_EXEC test/get_previous_releases.py -b -t "$PREVIOUS_RELEASES_DIR" "${PREVIOUS_RELEASES_TO_DOWNLOAD}"

View file

@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8
if [ -n "$ANDROID_TOOLS_URL" ]; then if [ -n "$ANDROID_TOOLS_URL" ]; then
DOCKER_EXEC make distclean || true DOCKER_EXEC make distclean || true
DOCKER_EXEC ./autogen.sh DOCKER_EXEC ./autogen.sh
DOCKER_EXEC ./configure $BITCOIN_CONFIG --prefix=$DEPENDS_DIR/aarch64-linux-android || ( (DOCKER_EXEC cat config.log) && false) DOCKER_EXEC ./configure "$BITCOIN_CONFIG" --prefix="${DEPENDS_DIR}/aarch64-linux-android" || ( (DOCKER_EXEC cat config.log) && false)
DOCKER_EXEC "make $MAKEJOBS && cd src/qt && ANDROID_HOME=${ANDROID_HOME} ANDROID_NDK_HOME=${ANDROID_NDK_HOME} make apk" DOCKER_EXEC "make $MAKEJOBS && cd src/qt && ANDROID_HOME=${ANDROID_HOME} ANDROID_NDK_HOME=${ANDROID_NDK_HOME} make apk"
exit 0 exit 0
fi fi
@ -29,13 +29,13 @@ fi
DOCKER_EXEC mkdir -p "${BASE_BUILD_DIR}" DOCKER_EXEC mkdir -p "${BASE_BUILD_DIR}"
export P_CI_DIR="${BASE_BUILD_DIR}" export P_CI_DIR="${BASE_BUILD_DIR}"
DOCKER_EXEC "${BASE_ROOT_DIR}/configure" --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (DOCKER_EXEC cat config.log) && false) DOCKER_EXEC "${BASE_ROOT_DIR}/configure" --cache-file=config.cache "$BITCOIN_CONFIG_ALL" "$BITCOIN_CONFIG" || ( (DOCKER_EXEC cat config.log) && false)
DOCKER_EXEC make distdir VERSION=$HOST DOCKER_EXEC make distdir VERSION="$HOST"
export P_CI_DIR="${BASE_BUILD_DIR}/bitcoin-$HOST" export P_CI_DIR="${BASE_BUILD_DIR}/bitcoin-$HOST"
DOCKER_EXEC ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (DOCKER_EXEC cat config.log) && false) DOCKER_EXEC ./configure --cache-file=../config.cache "$BITCOIN_CONFIG_ALL" "$BITCOIN_CONFIG" || ( (DOCKER_EXEC cat config.log) && false)
set -o errtrace set -o errtrace
trap 'DOCKER_EXEC "cat ${BASE_SCRATCH_DIR}/sanitizer-output/* 2> /dev/null"' ERR trap 'DOCKER_EXEC "cat ${BASE_SCRATCH_DIR}/sanitizer-output/* 2> /dev/null"' ERR
@ -48,7 +48,7 @@ if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
DOCKER_EXEC 'grep -v HAVE_SYS_GETRANDOM src/config/bitcoin-config.h > src/config/bitcoin-config.h.tmp && mv src/config/bitcoin-config.h.tmp src/config/bitcoin-config.h' DOCKER_EXEC 'grep -v HAVE_SYS_GETRANDOM src/config/bitcoin-config.h > src/config/bitcoin-config.h.tmp && mv src/config/bitcoin-config.h.tmp src/config/bitcoin-config.h'
fi fi
DOCKER_EXEC make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && DOCKER_EXEC make $GOAL V=1 ; false ) DOCKER_EXEC make "$MAKEJOBS" "$GOAL" || ( echo "Build failure. Verbose build follows." && DOCKER_EXEC make "$GOAL" V=1 ; false )
DOCKER_EXEC "ccache --version | head -n 1 && ccache --show-stats" DOCKER_EXEC "ccache --version | head -n 1 && ccache --show-stats"
DOCKER_EXEC du -sh "${DEPENDS_DIR}"/*/ DOCKER_EXEC du -sh "${DEPENDS_DIR}"/*/

View file

@ -8,13 +8,13 @@ export LC_ALL=C.UTF-8
if [[ $HOST = *-mingw32 ]]; then if [[ $HOST = *-mingw32 ]]; then
# Generate all binaries, so that they can be wrapped # Generate all binaries, so that they can be wrapped
DOCKER_EXEC make $MAKEJOBS -C src/secp256k1 VERBOSE=1 DOCKER_EXEC make "$MAKEJOBS" -C src/secp256k1 VERBOSE=1
DOCKER_EXEC "${BASE_ROOT_DIR}/ci/test/wrap-wine.sh" DOCKER_EXEC "${BASE_ROOT_DIR}/ci/test/wrap-wine.sh"
fi fi
if [ -n "$QEMU_USER_CMD" ]; then if [ -n "$QEMU_USER_CMD" ]; then
# Generate all binaries, so that they can be wrapped # Generate all binaries, so that they can be wrapped
DOCKER_EXEC make $MAKEJOBS -C src/secp256k1 VERBOSE=1 DOCKER_EXEC make "$MAKEJOBS" -C src/secp256k1 VERBOSE=1
DOCKER_EXEC "${BASE_ROOT_DIR}/ci/test/wrap-qemu.sh" DOCKER_EXEC "${BASE_ROOT_DIR}/ci/test/wrap-qemu.sh"
fi fi
@ -23,15 +23,15 @@ if [ -n "$USE_VALGRIND" ]; then
fi fi
if [ "$RUN_UNIT_TESTS" = "true" ]; then if [ "$RUN_UNIT_TESTS" = "true" ]; then
DOCKER_EXEC ${TEST_RUNNER_ENV} DIR_UNIT_TEST_DATA=${DIR_UNIT_TEST_DATA} LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib make $MAKEJOBS check VERBOSE=1 DOCKER_EXEC "${TEST_RUNNER_ENV}" DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" make "$MAKEJOBS" check VERBOSE=1
fi fi
if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then
DOCKER_EXEC ${TEST_RUNNER_ENV} DIR_UNIT_TEST_DATA=${DIR_UNIT_TEST_DATA} LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib "${BASE_BUILD_DIR}/bitcoin-*/src/test/test_bitcoin*" --catch_system_errors=no -l test_suite DOCKER_EXEC "${TEST_RUNNER_ENV}" DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" "${BASE_BUILD_DIR}/bitcoin-*/src/test/test_bitcoin*" --catch_system_errors=no -l test_suite
fi fi
if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then
DOCKER_EXEC LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib ${TEST_RUNNER_ENV} test/functional/test_runner.py --ci $MAKEJOBS --tmpdirprefix "${BASE_SCRATCH_DIR}/test_runner/" --ansi --combinedlogslen=4000 --timeout-factor=${TEST_RUNNER_TIMEOUT_FACTOR} ${TEST_RUNNER_EXTRA} --quiet --failfast DOCKER_EXEC LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" "${TEST_RUNNER_ENV}" test/functional/test_runner.py --ci "$MAKEJOBS" --tmpdirprefix "${BASE_SCRATCH_DIR}/test_runner/" --ansi --combinedlogslen=4000 --timeout-factor="${TEST_RUNNER_TIMEOUT_FACTOR}" "${TEST_RUNNER_EXTRA}" --quiet --failfast
fi fi
if [ "$RUN_SECURITY_TESTS" = "true" ]; then if [ "$RUN_SECURITY_TESTS" = "true" ]; then
@ -39,5 +39,5 @@ if [ "$RUN_SECURITY_TESTS" = "true" ]; then
fi fi
if [ "$RUN_FUZZ_TESTS" = "true" ]; then if [ "$RUN_FUZZ_TESTS" = "true" ]; then
DOCKER_EXEC LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib test/fuzz/test_runner.py ${FUZZ_TESTS_CONFIG} $MAKEJOBS -l DEBUG ${DIR_FUZZ_IN} DOCKER_EXEC LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" test/fuzz/test_runner.py "${FUZZ_TESTS_CONFIG}" "$MAKEJOBS" -l DEBUG "${DIR_FUZZ_IN}"
fi fi

View file

@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1/*tests,src/minisketch/test{,-verify},src/univalue/{no_nul,test_json,unitester,object}}; do for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1/*tests,src/minisketch/test{,-verify},src/univalue/{no_nul,test_json,unitester,object}}; do
# shellcheck disable=SC2044 # shellcheck disable=SC2044
for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name $(basename $b_name)); do for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name $(basename "$b_name")); do
echo "Wrap $b ..." echo "Wrap $b ..."
mv "$b" "${b}_orig" mv "$b" "${b}_orig"
echo '#!/usr/bin/env bash' > "$b" echo '#!/usr/bin/env bash' > "$b"

View file

@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
for b_name in "${BASE_OUTDIR}/bin"/*; do for b_name in "${BASE_OUTDIR}/bin"/*; do
# shellcheck disable=SC2044 # shellcheck disable=SC2044
for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name $(basename $b_name)); do for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name $(basename "$b_name")); do
echo "Wrap $b ..." echo "Wrap $b ..."
mv "$b" "${b}_orig" mv "$b" "${b}_orig"
echo '#!/usr/bin/env bash' > "$b" echo '#!/usr/bin/env bash' > "$b"

View file

@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1/*tests,src/minisketch/test{,-verify},src/univalue/{no_nul,test_json,unitester,object}}.exe; do for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1/*tests,src/minisketch/test{,-verify},src/univalue/{no_nul,test_json,unitester,object}}.exe; do
# shellcheck disable=SC2044 # shellcheck disable=SC2044
for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name "$(basename $b_name)"); do for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name "$(basename "$b_name")"); do
if (file "$b" | grep "Windows"); then if (file "$b" | grep "Windows"); then
echo "Wrap $b ..." echo "Wrap $b ..."
mv "$b" "${b}_orig" mv "$b" "${b}_orig"

View file

@ -17,7 +17,7 @@ WALLET_TOOL=${WALLET_TOOL:-$BINDIR/bitcoin-wallet}
BITCOINUTIL=${BITCOINQT:-$BINDIR/bitcoin-util} BITCOINUTIL=${BITCOINQT:-$BINDIR/bitcoin-util}
BITCOINQT=${BITCOINQT:-$BINDIR/qt/bitcoin-qt} BITCOINQT=${BITCOINQT:-$BINDIR/qt/bitcoin-qt}
[ ! -x $BITCOIND ] && echo "$BITCOIND not found or not executable." && exit 1 [ ! -x "$BITCOIND" ] && echo "$BITCOIND not found or not executable." && exit 1
# Don't allow man pages to be generated for binaries built from a dirty tree # Don't allow man pages to be generated for binaries built from a dirty tree
DIRTY="" DIRTY=""
@ -30,7 +30,7 @@ done
if [ -n "$DIRTY" ] if [ -n "$DIRTY" ]
then then
echo -e "WARNING: the following binaries were built from a dirty tree:\n" echo -e "WARNING: the following binaries were built from a dirty tree:\n"
echo -e $DIRTY echo -e "$DIRTY"
echo "man pages generated from dirty binaries should NOT be committed." echo "man pages generated from dirty binaries should NOT be committed."
echo "To properly generate man pages, please commit your changes to the above binaries, rebuild them, then run this script again." echo "To properly generate man pages, please commit your changes to the above binaries, rebuild them, then run this script again."
fi fi
@ -46,8 +46,8 @@ $BITCOIND --version | sed -n '1!p' >> footer.h2m
for cmd in $BITCOIND $BITCOINCLI $BITCOINTX $WALLET_TOOL $BITCOINUTIL $BITCOINQT; do for cmd in $BITCOIND $BITCOINCLI $BITCOINTX $WALLET_TOOL $BITCOINUTIL $BITCOINQT; do
cmdname="${cmd##*/}" cmdname="${cmd##*/}"
help2man -N --version-string=${BTCVER[0]} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd} help2man -N --version-string="${BTCVER[0]}" --include=footer.h2m -o "${MANDIR}/${cmdname}.1" "${cmd}"
sed -i "s/\\\-${BTCVER[1]}//g" ${MANDIR}/${cmdname}.1 sed -i "s/\\\-${BTCVER[1]}//g" "${MANDIR}/${cmdname}.1"
done done
rm -f footer.h2m rm -f footer.h2m

View file

@ -20,7 +20,7 @@ expand_path() {
cd "${1}" && pwd -P cd "${1}" && pwd -P
} }
BDB_PREFIX="$(expand_path ${1})/db4"; shift; BDB_PREFIX="$(expand_path "${1}")/db4"; shift;
BDB_VERSION='db-4.8.30.NC' BDB_VERSION='db-4.8.30.NC'
BDB_HASH='12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef' BDB_HASH='12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef'
BDB_URL="https://download.oracle.com/berkeley-db/${BDB_VERSION}.tar.gz" BDB_URL="https://download.oracle.com/berkeley-db/${BDB_VERSION}.tar.gz"

View file

@ -22,6 +22,6 @@ if [ -z "$SIGNATURE" ]; then
exit 1 exit 1
fi fi
${SIGNAPPLE} apply ${UNSIGNED} ${SIGNATURE} ${SIGNAPPLE} apply "${UNSIGNED}" "${SIGNATURE}"
mv ${ROOTDIR} ${OUTDIR} mv ${ROOTDIR} ${OUTDIR}
echo "Signed: ${OUTDIR}" echo "Signed: ${OUTDIR}"

View file

@ -9,11 +9,11 @@ if ! [[ "$2" =~ ^(git@)?(www.)?github.com(:|/)bitcoin/bitcoin(.git)?$ ]]; then
fi fi
while read LINE; do while read LINE; do
set -- A $LINE set -- A "$LINE"
if [ "$4" != "refs/heads/master" ]; then if [ "$4" != "refs/heads/master" ]; then
continue continue
fi fi
if ! ./contrib/verify-commits/verify-commits.py $3 > /dev/null 2>&1; then if ! ./contrib/verify-commits/verify-commits.py "$3" > /dev/null 2>&1; then
echo "ERROR: A commit is not signed, can't push" echo "ERROR: A commit is not signed, can't push"
./contrib/verify-commits/verify-commits.py ./contrib/verify-commits/verify-commits.py
exit 1 exit 1

View file

@ -26,7 +26,7 @@ if [ "${BITCOIN_GENBUILD_NO_GIT}" != "1" ] && [ -e "$(command -v git)" ] && [ "$
# if latest commit is tagged and not dirty, then override using the tag name # if latest commit is tagged and not dirty, then override using the tag name
RAWDESC=$(git describe --abbrev=0 2>/dev/null) RAWDESC=$(git describe --abbrev=0 2>/dev/null)
if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 $RAWDESC 2>/dev/null)" ]; then if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 "$RAWDESC" 2>/dev/null)" ]; then
git diff-index --quiet HEAD -- && GIT_TAG=$RAWDESC git diff-index --quiet HEAD -- && GIT_TAG=$RAWDESC
fi fi

View file

@ -5,10 +5,10 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php. # file COPYING or http://www.opensource.org/licenses/mit-license.php.
export LC_ALL=C export LC_ALL=C
FRAMEDIR=$(dirname $0) FRAMEDIR=$(dirname "$0")
for i in {0..35} for i in {0..35}
do do
frame=$(printf "%03d" $i) frame=$(printf "%03d" "$i")
angle=$((i * 10)) angle=$((i * 10))
convert $FRAMEDIR/../src/spinner.png -background "rgba(0,0,0,0.0)" -distort SRT $angle $FRAMEDIR/spinner-$frame.png convert "${FRAMEDIR}/../src/spinner.png" -background "rgba(0,0,0,0.0)" -distort SRT $angle "${FRAMEDIR}/spinner-${frame}.png"
done done

View file

@ -12,7 +12,7 @@
# one. Any remaining diff signals an error. # one. Any remaining diff signals an error.
export LC_ALL=C export LC_ALL=C
if test -z $1; then if test -z "$1"; then
echo "Usage: $0 <commit>..." echo "Usage: $0 <commit>..."
exit 1 exit 1
fi fi
@ -20,10 +20,10 @@ fi
RET=0 RET=0
PREV_BRANCH=$(git name-rev --name-only HEAD) PREV_BRANCH=$(git name-rev --name-only HEAD)
PREV_HEAD=$(git rev-parse HEAD) PREV_HEAD=$(git rev-parse HEAD)
for commit in $(git rev-list --reverse $1); do for commit in $(git rev-list --reverse "$1"); do
if git rev-list -n 1 --pretty="%s" $commit | grep -q "^scripted-diff:"; then if git rev-list -n 1 --pretty="%s" "$commit" | grep -q "^scripted-diff:"; then
git checkout --quiet $commit^ || exit git checkout --quiet "$commit"^ || exit
SCRIPT="$(git rev-list --format=%b -n1 $commit | sed '/^-BEGIN VERIFY SCRIPT-$/,/^-END VERIFY SCRIPT-$/{//!b};d')" SCRIPT="$(git rev-list --format=%b -n1 "$commit" | sed '/^-BEGIN VERIFY SCRIPT-$/,/^-END VERIFY SCRIPT-$/{//!b};d')"
if test -z "$SCRIPT"; then if test -z "$SCRIPT"; then
echo "Error: missing script for: $commit" echo "Error: missing script for: $commit"
echo "Failed" echo "Failed"
@ -32,16 +32,16 @@ for commit in $(git rev-list --reverse $1); do
echo "Running script for: $commit" echo "Running script for: $commit"
echo "$SCRIPT" echo "$SCRIPT"
(eval "$SCRIPT") (eval "$SCRIPT")
git --no-pager diff --exit-code $commit && echo "OK" || (echo "Failed"; false) || RET=1 git --no-pager diff --exit-code "$commit" && echo "OK" || (echo "Failed"; false) || RET=1
fi fi
git reset --quiet --hard HEAD git reset --quiet --hard HEAD
else else
if git rev-list "--format=%b" -n1 $commit | grep -q '^-\(BEGIN\|END\)[ a-zA-Z]*-$'; then if git rev-list "--format=%b" -n1 "$commit" | grep -q '^-\(BEGIN\|END\)[ a-zA-Z]*-$'; then
echo "Error: script block marker but no scripted-diff in title of commit $commit" echo "Error: script block marker but no scripted-diff in title of commit $commit"
echo "Failed" echo "Failed"
RET=1 RET=1
fi fi
fi fi
done done
git checkout --quiet $PREV_BRANCH 2>/dev/null || git checkout --quiet $PREV_HEAD git checkout --quiet "$PREV_BRANCH" 2>/dev/null || git checkout --quiet "$PREV_HEAD"
exit $RET exit $RET

View file

@ -82,6 +82,7 @@ if [ -z "$latest_squash" ]; then
echo "ERROR: $DIR is not a subtree" >&2 echo "ERROR: $DIR is not a subtree" >&2
exit 2 exit 2
fi fi
# shellcheck disable=SC2086
set $latest_squash set $latest_squash
old=$1 old=$1
rev=$2 rev=$2
@ -92,6 +93,7 @@ if [ -z "$tree_actual" ]; then
echo "FAIL: subtree directory $DIR not found in $COMMIT" >&2 echo "FAIL: subtree directory $DIR not found in $COMMIT" >&2
exit 1 exit 1
fi fi
# shellcheck disable=SC2086
set $tree_actual set $tree_actual
tree_actual_type=$2 tree_actual_type=$2
tree_actual_tree=$3 tree_actual_tree=$3
@ -102,23 +104,23 @@ if [ "d$tree_actual_type" != "dtree" ]; then
fi fi
# get the tree at the time of the last subtree update # get the tree at the time of the last subtree update
tree_commit=$(git show -s --format="%T" $old) tree_commit=$(git show -s --format="%T" "$old")
echo "$DIR in $COMMIT was last updated in commit $old (tree $tree_commit)" echo "$DIR in $COMMIT was last updated in commit $old (tree $tree_commit)"
# ... and compare the actual tree with it # ... and compare the actual tree with it
if [ "$tree_actual_tree" != "$tree_commit" ]; then if [ "$tree_actual_tree" != "$tree_commit" ]; then
git diff $tree_commit $tree_actual_tree >&2 git diff "$tree_commit" "$tree_actual_tree" >&2
echo "FAIL: subtree directory was touched without subtree merge" >&2 echo "FAIL: subtree directory was touched without subtree merge" >&2
exit 1 exit 1
fi fi
if [ "$check_remote" != "0" ]; then if [ "$check_remote" != "0" ]; then
# get the tree in the subtree commit referred to # get the tree in the subtree commit referred to
if [ "d$(git cat-file -t $rev 2>/dev/null)" != dcommit ]; then if [ "d$(git cat-file -t "$rev" 2>/dev/null)" != dcommit ]; then
echo "subtree commit $rev unavailable: cannot compare. Did you add and fetch the remote?" >&2 echo "subtree commit $rev unavailable: cannot compare. Did you add and fetch the remote?" >&2
exit 1 exit 1
fi fi
tree_subtree=$(git show -s --format="%T" $rev) tree_subtree=$(git show -s --format="%T" "$rev")
echo "$DIR in $COMMIT was last updated to upstream commit $rev (tree $tree_subtree)" echo "$DIR in $COMMIT was last updated to upstream commit $rev (tree $tree_subtree)"
# ... and compare the actual tree with it # ... and compare the actual tree with it

View file

@ -3,5 +3,5 @@
export LC_ALL=C export LC_ALL=C
set -e set -e
cd "$(dirname $0)/../.." cd "$(dirname "$0")/../.."
test/lint/lint-files.py test/lint/lint-files.py

View file

@ -38,7 +38,7 @@ while IFS= read -r commit_hash || [[ -n "$commit_hash" ]]; do
while IFS= read -r line || [[ -n "$line" ]]; do while IFS= read -r line || [[ -n "$line" ]]; do
n_line=$((n_line+1)) n_line=$((n_line+1))
length=${#line} length=${#line}
if [ $n_line -eq 2 ] && [ $length -ne 0 ]; then if [ $n_line -eq 2 ] && [ "$length" -ne 0 ]; then
echo "The subject line of commit hash ${commit_hash} is followed by a non-empty line. Subject lines should always be followed by a blank line." echo "The subject line of commit hash ${commit_hash} is followed by a non-empty line. Subject lines should always be followed by a blank line."
EXIT_CODE=1 EXIT_CODE=1
fi fi

View file

@ -12,7 +12,7 @@ export LC_ALL=C
IGNORE_REGEXP="/(leveldb|secp256k1|minisketch|univalue|crc32c)/" IGNORE_REGEXP="/(leveldb|secp256k1|minisketch|univalue|crc32c)/"
# cd to root folder of git repo for git ls-files to work properly # cd to root folder of git repo for git ls-files to work properly
cd "$(dirname $0)/../.." || exit 1 cd "$(dirname "$0")/../.." || exit 1
filter_suffix() { filter_suffix() {
git ls-files | grep -E "^src/.*\.${1}"'$' | grep -Ev "${IGNORE_REGEXP}" git ls-files | grep -E "^src/.*\.${1}"'$' | grep -Ev "${IGNORE_REGEXP}"

View file

@ -11,7 +11,6 @@ export LC_ALL=C
# Disabled warnings: # Disabled warnings:
disabled=( disabled=(
SC2046 # Quote this to prevent word splitting. SC2046 # Quote this to prevent word splitting.
SC2086 # Double quote to prevent globbing and word splitting.
SC2162 # read without -r will mangle backslashes. SC2162 # read without -r will mangle backslashes.
) )
@ -24,8 +23,9 @@ fi
SHELLCHECK_CMD=(shellcheck --external-sources --check-sourced) SHELLCHECK_CMD=(shellcheck --external-sources --check-sourced)
EXCLUDE="--exclude=$(IFS=','; echo "${disabled[*]}")" EXCLUDE="--exclude=$(IFS=','; echo "${disabled[*]}")"
SOURCED_FILES=$(git ls-files | xargs gawk '/^# shellcheck shell=/ {print FILENAME} {nextfile}') # Check shellcheck directive used for sourced files # Check shellcheck directive used for sourced files
if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE" $SOURCED_FILES $(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|minisketch|univalue)/'); then mapfile -t SOURCED_FILES < <(git ls-files | xargs gawk '/^# shellcheck shell=/ {print FILENAME} {nextfile}')
if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE" "${SOURCED_FILES[@]}" $(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|minisketch|univalue)/'); then
EXIT_CODE=1 EXIT_CODE=1
fi fi