mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 04:12:19 +00:00
Rewrite list-licenses.sh to use array+find
This commit is contained in:
parent
97b0513f99
commit
a5331ea544
@ -5,15 +5,16 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
|||||||
GREP_CMD=ggrep
|
GREP_CMD=ggrep
|
||||||
FIND_CMD=gfind
|
FIND_CMD=gfind
|
||||||
else
|
else
|
||||||
FIND_CMD=find
|
FIND_CMD='find'
|
||||||
GREP_CMD=grep
|
GREP_CMD='grep'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ROOT_PATH="$(git rev-parse --show-toplevel)"
|
ROOT_PATH="$(git rev-parse --show-toplevel)"
|
||||||
LIBS_PATH="${ROOT_PATH}/contrib"
|
LIBS_PATH="${ROOT_PATH}/contrib"
|
||||||
|
|
||||||
ls -1 -d ${LIBS_PATH}/*/ "${ROOT_PATH}/base/poco" | ${GREP_CMD} -F -v -- '-cmake' | LC_ALL=C sort | while read LIB; do
|
mapfile -t libs < <(echo "${ROOT_PATH}/base/poco"; find "${LIBS_PATH}" -type d -maxdepth 1 ! -name '*-cmake' | LC_ALL=C sort)
|
||||||
LIB_NAME=$(basename $LIB)
|
for LIB in "${libs[@]}"; do
|
||||||
|
LIB_NAME=$(basename "$LIB")
|
||||||
|
|
||||||
LIB_LICENSE=$(
|
LIB_LICENSE=$(
|
||||||
LC_ALL=C ${FIND_CMD} "$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 ${FIND_CMD} "$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" |
|
||||||
|
Loading…
Reference in New Issue
Block a user