Skip to content

Commit 518edb3

Browse files
committed
bin/check-warn.sh: use tee, capture stderr
Sphinx automatically redirects all warnings and fatal errors to stderr. Use tee to write these outputs to the log files directly and still keep terminal output for debug purposes. This also has the benefit of preserving coloring when we echo the offending warnings. Signed-off-by: Randolph Sapp <[email protected]>
1 parent cad6bbb commit 518edb3

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

bin/check-warn.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ summary()
4949

5050
rm -f build/_new-warn.log
5151
diff --changed-group-format="%>" --unchanged-group-format="" \
52-
build/_a-warn.log build/_b-warn.log > build/_new-warn.log
52+
build/_a.log build/_b.log > build/_new-warn.log
5353

5454
_num=$(wc -l build/_new-warn.log)
5555

@@ -64,23 +64,21 @@ summary()
6464

6565
generate_log()
6666
{
67-
local git_hash log_name log_path warning_log_path
67+
local git_hash log_name log_path
6868

6969
git_hash=$1
7070
log_name=$2
7171

7272
log_path="build/${log_name}.log"
73-
warning_log_path="build/${log_name}-warn.log"
7473

7574
git checkout "${git_hash}" || exit 10
7675

7776
mkdir -p build
7877

79-
rm -f "${log_path}" "${warning_log_path}"
78+
rm -f "${log_path}"
8079
make DEVFAMILY="${_dev}" OS="${_os}" clean
81-
make DEVFAMILY="${_dev}" OS="${_os}" config >> "${log_path}" 2>&1 || exit 12
82-
make DEVFAMILY="${_dev}" OS="${_os}" >> "${log_path}" 2>&1 || exit 13
83-
grep "WARNING:" "${log_path}" > "${warning_log_path}"
80+
make DEVFAMILY="${_dev}" OS="${_os}" config 2> >(tee -a "${log_path}" >&2) || exit 12
81+
make DEVFAMILY="${_dev}" OS="${_os}" 2> >(tee -a "${log_path}" >&2) || exit 13
8482
}
8583

8684
rev-parse()

0 commit comments

Comments
 (0)