Merge pull request #8894 from daverodgman/quietbuild2

Follow-up non-verbose logs
This commit is contained in:
Gilles Peskine 2024-03-13 00:50:42 +00:00 committed by GitHub
commit 68f46414cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 9 deletions

View File

@ -12,8 +12,8 @@
# export VERBOSE_LOGS=1
# don't silence invocations containing these arguments
export NO_SILENCE=" --version "
NO_SILENCE=" --version "
export TOOL="cmake"
TOOL="cmake"
exec "$(dirname "$0")/quiet.sh" "$@"
. "$(dirname "$0")/quiet.sh"

View File

@ -12,8 +12,8 @@
# export VERBOSE_LOGS=1
# don't silence invocations containing these arguments
export NO_SILENCE=" --version | test "
NO_SILENCE=" --version | test "
export TOOL="make"
TOOL="make"
exec "$(dirname "$0")/quiet.sh" "$@"
. "$(dirname "$0")/quiet.sh"

10
tests/scripts/quiet/quiet.sh Executable file → Normal file
View File

@ -22,9 +22,13 @@
# be silenced, e.g. " --version | test ". In this example, "make lib test" will
# not be silent, but "make lib" will be.
# Locate original tool
TOOL_WITH_PATH=$(dirname "$0")/$TOOL
ORIGINAL_TOOL=$(type -ap "${TOOL}" | grep -v -Fx "$TOOL_WITH_PATH" | head -n1)
# Identify path to original tool. There is an edge-case here where the quiet wrapper is on the path via
# a symlink or relative path, but "type -ap" yields the wrapper with it's normalised path. We use
# the -ef operator to compare paths, to avoid picking the wrapper in this case (to avoid infinitely
# recursing).
while IFS= read -r ORIGINAL_TOOL; do
if ! [[ $ORIGINAL_TOOL -ef "$0" ]]; then break; fi
done < <(type -ap -- "$TOOL")
print_quoted_args() {
# similar to printf '%q' "$@"