diff options
author | Steven Rostedt (Google) <rostedt@goodmis.org> | 2023-01-04 12:26:54 -0500 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2023-01-06 17:13:54 -0500 |
commit | be050d73fc1f922c05a038bf1d1f04c892c5bfdc (patch) | |
tree | b3b7d32d94b9aed53ca5ef64af8ac01b38b8da23 | |
parent | 414028d689376a6c4e9065cbcba99c11a4f26dd8 (diff) | |
download | libtraceevent-be050d73fc1f922c05a038bf1d1f04c892c5bfdc.tar.gz |
libtraceevent: 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.
The output will look like this:
Found tep_find_function in libtraceevent-func_find.txt and in libtraceevent-func_apis.txt
Found tep_find_function_address in libtraceevent-func_find.txt and in libtraceevent-func_apis.txt
Link: https://lore.kernel.org/linux-trace-devel/20221224153225.ojre2c3fxktfxtj2@carbon.lan/
Link: https://lore.kernel.org/linux-trace-devel/20230104172655.145516-2-rostedt@goodmis.org
Reported-by: Daniel Wagner <dwagner@suse.de>
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 85b3b74..4e9850f 100755 --- a/check-manpages.sh +++ b/check-manpages.sh @@ -15,12 +15,19 @@ cd $1 MAIN=libtraceevent 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 |