Skip to content

Commit

Permalink
trace-cmd: Add check for duplicate functions in man pages
Browse files Browse the repository at this point in the history
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/[email protected]/
Link: https://lore.kernel.org/linux-trace-devel/[email protected]

Signed-off-by: Steven Rostedt (Google) <[email protected]>
  • Loading branch information
rostedt committed Jan 5, 2023
1 parent 6a43c88 commit 18233e4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion check-manpages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 18233e4

Please sign in to comment.