]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
torture: Make config2csv.sh properly handle comments in .boot files
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 29 Dec 2025 19:13:57 +0000 (11:13 -0800)
committerBoqun Feng <boqun.feng@gmail.com>
Thu, 1 Jan 2026 08:44:36 +0000 (16:44 +0800)
As in strip the "#" and everything after it and *then* tokenize.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
tools/testing/selftests/rcutorture/bin/config2csv.sh

index 0cf55f1bf6548a4440c5d5e55cde723429adbb35..aeab4d6f11ad2635fd95bbc998fd8381d863e68c 100755 (executable)
@@ -42,7 +42,7 @@ do
        grep -v '^#' < $i | grep -v '^ *$' > $T/p
        if test -r $i.boot
        then
-               tr -s ' ' '\012' < $i.boot | grep -v '^#' >> $T/p
+               sed -e 's/#.*$//' < $i.boot | tr -s ' ' '\012' >> $T/p
        fi
        sed -e 's/^[^=]*$/&=?/' < $T/p |
        sed -e 's/^\([^=]*\)=\(.*\)$/\tp["\1:'"$i"'"] = "\2";\n\tc["\1"] = 1;/' >> $T/p.awk