From 3705dbfabc632002f2b46fd1e7eba4ed7a95c570 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sat, 24 Apr 2021 23:01:07 +0300 Subject: [PATCH] Avoid possible build dependency on locale and filesystem order --- release | 3 +++ src/Storages/System/StorageSystemContributors.sh | 4 +++- utils/list-licenses/list-licenses.sh | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/release b/release index f2052840cb0..dd2982f0b1d 100755 --- a/release +++ b/release @@ -31,6 +31,9 @@ set -e +# Avoid dependency on locale +LC_ALL=C + CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) cd $CUR_DIR diff --git a/src/Storages/System/StorageSystemContributors.sh b/src/Storages/System/StorageSystemContributors.sh index c4c4eb5ad30..e34bf8ee7c8 100755 --- a/src/Storages/System/StorageSystemContributors.sh +++ b/src/Storages/System/StorageSystemContributors.sh @@ -2,6 +2,8 @@ set -x +LC_ALL=C + # doesn't actually cd to directory, but return absolute path CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) # cd to directory @@ -10,7 +12,7 @@ cd $CUR_DIR CONTRIBUTORS_FILE=${CONTRIBUTORS_FILE=$CUR_DIR/StorageSystemContributors.generated.cpp} # if you don't specify HEAD here, without terminal `git shortlog` would expect input from stdin -git shortlog HEAD --summary | perl -lnE 's/^\s+\d+\s+(.+)/ "$1",/; next unless $1; say $_' > $CONTRIBUTORS_FILE.tmp +git shortlog HEAD --summary | perl -lnE 's/^\s+\d+\s+(.+)/ "$1",/; next unless $1; say $_' | sort > $CONTRIBUTORS_FILE.tmp # If git history not available - dont make target file if [ ! -s $CONTRIBUTORS_FILE.tmp ]; then diff --git a/utils/list-licenses/list-licenses.sh b/utils/list-licenses/list-licenses.sh index 8eee3f97253..cdb3e3983ff 100755 --- a/utils/list-licenses/list-licenses.sh +++ b/utils/list-licenses/list-licenses.sh @@ -2,8 +2,9 @@ ROOT_PATH="$(git rev-parse --show-toplevel)" LIBS_PATH="${ROOT_PATH}/contrib" +LC_ALL=C -ls -1 -d ${LIBS_PATH}/*/ | grep -F -v -- '-cmake' | while read LIB; do +ls -1 -d ${LIBS_PATH}/*/ | grep -F -v -- '-cmake' | sort | while read LIB; do LIB_NAME=$(basename $LIB) LIB_LICENSE=$(