From 3ecd67200707b7ac95b8b59e2966a78a62c55f1f Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 26 Nov 2021 05:58:43 +0300 Subject: [PATCH] Even more reproducible builds --- utils/list-licenses/list-licenses.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/utils/list-licenses/list-licenses.sh b/utils/list-licenses/list-licenses.sh index a2c9697a772..ee79ffac26f 100755 --- a/utils/list-licenses/list-licenses.sh +++ b/utils/list-licenses/list-licenses.sh @@ -2,14 +2,13 @@ ROOT_PATH="$(git rev-parse --show-toplevel)" LIBS_PATH="${ROOT_PATH}/contrib" -export LC_ALL=C -ls -1 -d ${LIBS_PATH}/*/ | grep -F -v -- '-cmake' | sort | while read LIB; do +ls -1 -d ${LIBS_PATH}/*/ | grep -F -v -- '-cmake' | LC_ALL=C sort | while read LIB; do LIB_NAME=$(basename $LIB) LIB_LICENSE=$( - find "$LIB" -type f -and '(' -iname 'LICENSE*' -or -iname 'COPYING*' -or -iname 'COPYRIGHT*' ')' -and -not '(' -iname '*.html' -or -iname '*.htm' -or -iname '*.rtf' -or -name '*.cpp' -or -name '*.h' -or -iname '*.json' ')' -printf "%d\t%p\n" | - sort | awk ' + LC_ALL=C find "$LIB" -type f -and '(' -iname 'LICENSE*' -or -iname 'COPYING*' -or -iname 'COPYRIGHT*' ')' -and -not '(' -iname '*.html' -or -iname '*.htm' -or -iname '*.rtf' -or -name '*.cpp' -or -name '*.h' -or -iname '*.json' ')' -printf "%d\t%p\n" | + LC_ALL=C sort | LC_ALL=C awk ' BEGIN { IGNORECASE=1; min_depth = 0 } /LICENSE/ { if (!min_depth || $1 <= min_depth) { min_depth = $1; license = $2 } } /COPY/ { if (!min_depth || $1 <= min_depth) { min_depth = $1; copying = $2 } }