diff options
author | Steven Rostedt (Google) <rostedt@goodmis.org> | 2023-01-04 12:37:22 -0500 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2023-01-04 19:59:42 -0500 |
commit | 18233e4c32857cb7ddd4960beeec8360ed834fc5 (patch) | |
tree | 5eed4cda5b83b69f6b06da7129b00c2628f133bd | |
parent | 6a43c88ef5e771976099c229bac3a950ef09e48a (diff) | |
download | trace-cmd-18233e4c32857cb7ddd4960beeec8360ed834fc5.tar.gz |
trace-cmd: Add check for duplicate functions in man pages
Update the check-manpages.sh script to make sure that there are no
functions that are described in more than one man page.
Link: https://lore.kernel.org/linux-trace-devel/20230104172655.145516-2-rostedt@goodmis.org/
Link: https://lore.kernel.org/linux-trace-devel/20230104123722.00887044@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rwxr-xr-x | check-manpages.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/check-manpages.sh b/check-manpages.sh index 1166bbe8..f73a6c57 100755 --- a/check-manpages.sh +++ b/check-manpages.sh @@ -15,12 +15,19 @@ cd $1 MAIN=libtracecmd MAIN_FILE=${MAIN}.txt +PROCESSED="" + # Ignore man pages that do not contain functions IGNORE="" for man in ${MAIN}-*.txt; do - sed -ne '/^NAME/,/^SYNOP/{/^[a-z]/{s/, *$//;s/,/\n/g;s/ //g;s/-.*$/-/;/-/{s/-//p;q};p}}' $man | while read a; do + for a in `sed -ne '/^NAME/,/^SYNOP/{/^[a-z]/{s/, *$//;s/,/\n/g;s/ //g;s/-.*$/-/;/-/{s/-//p;q};p}}' $man`; do + if [ "${PROCESSED/:${a} /}" != "${PROCESSED}" ]; then + P="${PROCESSED/:${a} */}" + echo "Found ${a} in ${man} and in ${P/* /}" + fi + PROCESSED="${man}:${a} ${PROCESSED}" if [ "${IGNORE/$man/}" != "${IGNORE}" ]; then continue fi |