Skip to content

Commit 3f10b25

Browse files
committedApr 19, 2024
msg-filter: ignore version-release in kernel scripts
... installed in `usr/src/kernels/...+debug/scripts` Related: https://issues.redhat.com/browse/OSH-563
1 parent 2f835d4 commit 3f10b25

9 files changed

+55
-2
lines changed
 

‎src/lib/msg-filter.cc

+5
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@ std::string MsgFilter::filterPath(const std::string &origPath) const
263263
return tmpPath;
264264
}
265265

266+
// "/usr/src/kernels/4.18.0-552.el8.x86_64+debug/..."
267+
// -> "/usr/src/kernels/VERSION-RELEASE+debug/..."
268+
const RE reKrnUsrSrc("^(/usr/src/kernels/)[^/-]+-[^/-]+((?:\\+debug)?/.*)$");
269+
path = regexReplaceWrap(path, reKrnUsrSrc, "\\1VERSION-RELEASE\\2");
270+
266271
boost::smatch sm;
267272
if (boost::regex_match(path, sm, d->rePyBuild)) {
268273
// %{_builddir}/build/lib/setuptools/glob.py ->

‎tests/csdiff/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ test_csdiff(diff-misc 16-cov-parser-key-event)
8484
test_csdiff(diff-misc 17-cov-parser-key-event)
8585
test_csdiff(diff-misc 18-cov-parser-key-event)
8686
test_csdiff(diff-misc 19-cov-parser-key-event)
87+
test_csdiff(diff-misc 21-kernel-shell-code)
8788
test_csdiff(diff-misc 23-cov-parser-key-event)
8889

8990
add_subdirectory(filter-file)

‎tests/csdiff/diff-misc/21-kernel-shell-code-add-z.err

Whitespace-only changes.

‎tests/csdiff/diff-misc/21-kernel-shell-code-add.err

Whitespace-only changes.

‎tests/csdiff/diff-misc/21-kernel-shell-code-fix-z.err

Whitespace-only changes.

‎tests/csdiff/diff-misc/21-kernel-shell-code-fix.err

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Error: SHELLCHECK_WARNING (CWE-398):
2+
/usr/libexec/kselftests/drivers/net/netdevsim/ethtool-common.sh:31:8: error[SC1073]: Couldn't parse this test expression. Fix to allow more checks.
3+
# 29| [ -z "$exp_fail" ] && cop="-ne" || cop="-eq"
4+
# 30|
5+
# 31|-> if [ $code $cop 0 ]; then
6+
# 32| ((num_errors++))
7+
# 33| return
8+
9+
Error: SHELLCHECK_WARNING (CWE-398):
10+
/usr/src/kernels/4.18.0-552.el8.x86_64+debug/scripts/decode_stacktrace.sh:116:6: error[SC1073]: Couldn't parse this test expression. Fix to allow more checks.
11+
# 114|
12+
# 115| # Format timestamps with tabs
13+
# 116|-> if [[ ${words[$i]} == \[ && ${words[$i+1]} == *\] ]]; then
14+
# 117| unset words[$i]
15+
# 118| words[$i+1]=$(printf "[%13s\n" "${words[$i+1]}")
16+
17+
Error: SHELLCHECK_WARNING (CWE-398):
18+
/usr/src/kernels/4.18.0-552.el8.x86_64/scripts/decode_stacktrace.sh:116:6: error[SC1073]: Couldn't parse this test expression. Fix to allow more checks.
19+
# 114|
20+
# 115| # Format timestamps with tabs
21+
# 116|-> if [[ ${words[$i]} == \[ && ${words[$i+1]} == *\] ]]; then
22+
# 117| unset words[$i]
23+
# 118| words[$i+1]=$(printf "[%13s\n" "${words[$i+1]}")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Error: SHELLCHECK_WARNING (CWE-398):
2+
/usr/libexec/kselftests/drivers/net/netdevsim/ethtool-common.sh:31:8: error[SC1073]: Couldn't parse this test expression. Fix to allow more checks.
3+
# 29| [ -z "$exp_fail" ] && cop="-ne" || cop="-eq"
4+
# 30|
5+
# 31|-> if [ $code $cop 0 ]; then
6+
# 32| ((num_errors++))
7+
# 33| return
8+
9+
Error: SHELLCHECK_WARNING (CWE-398):
10+
/usr/src/kernels/4.18.0-513.5.1.el8.x86_64+debug/scripts/decode_stacktrace.sh:116:6: error[SC1073]: Couldn't parse this test expression. Fix to allow more checks.
11+
# 114|
12+
# 115| # Format timestamps with tabs
13+
# 116|-> if [[ ${words[$i]} == \[ && ${words[$i+1]} == *\] ]]; then
14+
# 117| unset words[$i]
15+
# 118| words[$i+1]=$(printf "[%13s\n" "${words[$i+1]}")
16+
17+
Error: SHELLCHECK_WARNING (CWE-398):
18+
/usr/src/kernels/4.18.0-513.5.1.el8.x86_64/scripts/decode_stacktrace.sh:116:6: error[SC1073]: Couldn't parse this test expression. Fix to allow more checks.
19+
# 114|
20+
# 115| # Format timestamps with tabs
21+
# 116|-> if [[ ${words[$i]} == \[ && ${words[$i+1]} == *\] ]]; then
22+
# 117| unset words[$i]
23+
# 118| words[$i+1]=$(printf "[%13s\n" "${words[$i+1]}")

‎tests/csdiff/diff-misc/sync.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
set -x
33

44
csdiff=$(realpath ../../../csdiff_build/src/csdiff)
5+
csgrep=$(realpath ../../../csdiff_build/src/csgrep)
56
test -x "$csdiff" || exit $?
67

78
for old in *-old.err; do
89
test=${old%-old.err}
910
new=${test}-new.err
1011
for args in "" "-z"; do
11-
$csdiff $args $old $new | csgrep > ${test}-add${args}.err
12-
$csdiff $args $new $old | csgrep > ${test}-fix${args}.err
12+
$csdiff $args $old $new | $csgrep > ${test}-add${args}.err
13+
$csdiff $args $new $old | $csgrep > ${test}-fix${args}.err
1314
done
1415
done

0 commit comments

Comments
 (0)