From b858cf7b5a9563b0a409704b4109f7e2aa2f84cf Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Date: Tue, 24 Aug 2021 21:08:35 +0530 Subject: [PATCH] partial merge #20359: Various config.site.in improvements and linting - PYTHONPATH change breaks package detection for some reason --- depends/config.site.in | 16 +++++++++++++--- test/lint/lint-shell.sh | 3 ++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/depends/config.site.in b/depends/config.site.in index fcfaac2be63ab1..8bea2469441a7a 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -1,4 +1,14 @@ -depends_prefix="`dirname ${ac_site_file}`/.." +# shellcheck shell=sh disable=SC2034 # Many variables set will be used in + # ./configure but shellcheck doesn't know + # that, hence: disable=SC2034 + +true # Dummy command because shellcheck treats all directives before first + # command as file-wide, and we only want to disable for one line. + # + # See: https://github.com/koalaman/shellcheck/wiki/Directive + +# shellcheck disable=SC2154 +depends_prefix="$(cd "$(dirname ${ac_site_file})/.." && pwd)" cross_compiling=maybe host_alias=@HOST@ @@ -43,7 +53,7 @@ if test x@host_os@ = xdarwin; then fi PATH=$depends_prefix/native/bin:$PATH -PKG_CONFIG="`which pkg-config` --static" +PKG_CONFIG="$(which pkg-config) --static" # These two need to remain exported because pkg-config does not see them # otherwise. That means they must be unexported at the end of configure.ac to @@ -61,7 +71,7 @@ fi if test -n "@CXX@" -a -z "${CXX}"; then CXX="@CXX@" fi -PYTHONPATH=$depends_prefix/native/lib/python/dist-packages:$PYTHONPATH +PYTHONPATH="${depends_prefix}/native/lib/python3/dist-packages${PYTHONPATH:+${PATH_SEPARATOR}}${PYTHONPATH}" if test -n "@AR@"; then AR=@AR@ diff --git a/test/lint/lint-shell.sh b/test/lint/lint-shell.sh index 3781b6ae76baff..f15324d4c17eba 100755 --- a/test/lint/lint-shell.sh +++ b/test/lint/lint-shell.sh @@ -55,7 +55,8 @@ if ! command -v shellcheck > /dev/null; then fi EXCLUDE="--exclude=$(IFS=','; echo "${disabled[*]}")" -if ! shellcheck "$EXCLUDE" $(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|univalue)/'); then +SOURCED_FILES=$(git ls-files | xargs gawk '/^# shellcheck shell=/ {print FILENAME} {nextfile}') # Check shellcheck directive used for sourced files +if ! shellcheck "$EXCLUDE" $SOURCED_FILES $(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|univalue)/'); then EXIT_CODE=1 fi