mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
WARN_MODE=early print warnings at compilation stage WARN_MODE=late print warnings at build finish stage WARN_MODE=both print both at early and at later stages
21 lines
369 B
Bash
Executable File
21 lines
369 B
Bash
Executable File
#!/bin/bash
|
|
warn_path=$1
|
|
warn_mode=$2
|
|
shift 2
|
|
|
|
warn_file="$warn_path/compile.warnings"
|
|
suppress_file="$warn_path/suppress.warnings"
|
|
|
|
exec 3>&1
|
|
cmderr=$("$@" 2>&1 1>&3)
|
|
error=$?
|
|
|
|
if [[ -n "$cmderr" ]]; then
|
|
[[ "$warn_mode" == "both" ]] &&
|
|
echo "$cmderr" >&2
|
|
[[ "$cmderr" =~ warning:(.+)$ ]] &&
|
|
echo -n "$cmderr" >> "$warn_file"
|
|
fi
|
|
|
|
exit ${error}
|