aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <rostedt@goodmis.org>2023-01-04 12:31:00 -0500
committerSteven Rostedt (Google) <rostedt@goodmis.org>2023-01-04 20:02:00 -0500
commit36a24e3869cd5ac2fc607977082696e3d4685531 (patch)
tree7ddd833b6b1cb41c91dfeb532880c2273cd9f824
parenteeafd61b7de34e4f3ccbde3356f88ac2cd36234e (diff)
downloadlibtracefs-36a24e3869cd5ac2fc607977082696e3d4685531.tar.gz
libtracefs: 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/20230104123100.63349d71@gandalf.local.home Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rwxr-xr-xcheck-manpages.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/check-manpages.sh b/check-manpages.sh
index d3ec6af..776365c 100755
--- a/check-manpages.sh
+++ b/check-manpages.sh
@@ -15,12 +15,19 @@ cd $1
MAIN=libtracefs
MAIN_FILE=${MAIN}.txt
+PROCESSED=""
+
# Ignore man pages that do not contain functions
IGNORE="libtracefs-options.txt"
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