-Copyright (c) <year> <owner>
+Copyright (c) <year> <owner>
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-Copyright (c) <year> <owner>.
+Copyright (c) <year> <owner>.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission
notice are preserved on all copies.
-Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided
-that the entire resulting derived work is distributed under the
+Permission is granted to copy and distribute modified versions of
+this manual under the conditions for verbatim copying, provided
+that the entire resulting derived work is distributed under the
terms of a permission notice identical to this one.
-Since the Linux kernel and libraries are constantly changing, this
-manual page may be incorrect or out-of-date. The author(s) assume
-no responsibility for errors or omissions, or for damages resulting
+Since the Linux kernel and libraries are constantly changing, this
+manual page may be incorrect or out-of-date. The author(s) assume
+no responsibility for errors or omissions, or for damages resulting
from the use of the information contained herein.
-Formatted or processed versions of this manual, if unaccompanied by
+Formatted or processed versions of this manual, if unaccompanied by
the source, must acknowledge the copyright and authors of this work.
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Even show FIXMEs that aren't generally interesting. (Typically
# these FIXMEs are notes to the maintainer to reverify something
# at a future date.)
-
- show_all="y"
+
+ show_all="y"
;;
-
+
*) echo "Unknown option: $OPTARG"
exit 1
;;
do
cat "$page" | awk -v SHOW_ALL=$show_all -v PAGE_NAME="$page" \
'
- BEGIN {
- page_FIXME_cnt = 0;
+ BEGIN {
+ page_FIXME_cnt = 0;
}
-
- /FIXME/ {
-
+
+ /FIXME/ {
+
# /.\" FIXME . / ==> do not display this FIXME, unless
# -a command-line option was supplied
-
+
if ($0 ~ /^\.\\" FIXME \./ )
FIXME_type = "hidden"
else if ($0 ~ /^\.\\" FIXME *\?/ )
print PAGE_NAME;
}
page_FIXME_cnt++;
-
- finished = 0;
- do {
- print $0;
-
- # Implicit end of FIXME is end-of-file or a line
+
+ finished = 0;
+ do {
+ print $0;
+
+ # Implicit end of FIXME is end-of-file or a line
# that is not a comment
-
+
if (getline == 0)
finished = 1;
-
- if (!($0 ~ /^.\\"/))
+
+ if (!($0 ~ /^.\\"/))
finished = 1;
-
+
# /.\" .$/ ==> Explicit end of FIXME
-
- if ($0 ~ /^.\\" \.$/)
+
+ if ($0 ~ /^.\\" \.$/)
finished = 1;
} while (!finished);
-
+
print "";
}
}
The files in this directory are scripts for man-pages maintenance tasks.
-They may be useful for downstream man-pages package maintainers or for
+They may be useful for downstream man-pages package maintainers or for
man-pages translators. This directory does not contain any files that
need to be installed in order to use the manual pages.
# The problem is how to determine what is a "function name".
# The approach this script takes is the following:
#
-# For each manual page named in the command line that contains
+# For each manual page named in the command line that contains
# more than one line (i.e., skip man-page link files)
# Create a set of names taken from the .SH section of the
-# page and from grepping all pages for names that
+# page and from grepping all pages for names that
# have .so links to this page
# For each name obtained above
-# If we can find something that looks like a prototype on
+# If we can find something that looks like a prototype on
# the page, then
# Try to substitute instances of that name on the page.
# (instances are considered to be words formatted
#
# and take a good look at the output. In particular, you can scan
# the output for *possible* problems by looking for the pattern: /^%%%/
-# The script's output should be enough to help you determine if the
+# The script's output should be enough to help you determine if the
# problem is real or not.
#
# Suggested usage (in this case to fix pages in Section 2):
# Use the "-n" option for a dry run, in order to see what would be
# done, without actually doing it.
#
-# (And, yes, there are many ways that this script could probably be
+# (And, yes, there are many ways that this script could probably be
# made to work faster...)
#
######################################################################
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# (http://www.gnu.org/licenses/gpl-2.0.html).
#
#
-#
+#
file_base="tmp.$(basename $0)"
shift $(( $OPTIND - 1 ))
-# Only process files with > 1 line -- single-line files are link files
+# Only process files with > 1 line -- single-line files are link files
for page in $(wc "$@" 2> /dev/null | awk '$1 > 1 {print $4}'| \
grep -v '^total'); do
# be our guesses about function names to look for
sh_nlist=$(cat $page | \
- awk 'BEGIN { p = 0 }
- /^\.SH NAME/ { p = NR }
+ awk 'BEGIN { p = 0 }
+ /^\.SH NAME/ { p = NR }
/^.SH/ && NR > p { p = 0 } # Stop at the next .SH directive
p > 0 && NR > p { print $0 } # These are the lines between
# the two .SH directives
sh_nlist=$(echo $sh_nlist | sed -e 's/ *\\-.*//' -e 's/, */ /g')
echo "### .SH name list:" $sh_nlist
- # Some pages like msgop.2 don't actually list the function names in
- # the .SH section -- but we can try using link pages to give us
+ # Some pages like msgop.2 don't actually list the function names in
+ # the .SH section -- but we can try using link pages to give us
# another guess at the right function names to look for
so_nlist=$(grep -l "^\\.so.*/$(echo $page| \
echo "### .so name list:" $so_nlist
# Combine the two lists, eliminate duplicates
-
+
nlist=$(echo $sh_nlist $so_nlist | tr ' ' '\012' | sort -u)
maybechanged=0
-
+
cp $page $work_dst_file
rm -f $matches_for_all_names; # touch $matches_for_all_names
echo "########## trying $rname ##########"
rm -f $matches_for_this_name
-
+
grep "^.BR* $name *$" $page | \
>> $matches_for_this_name
grep "^.BR $name [^(\"]$" $page | \
>> $matches_for_this_name
grep '\\fB'"$name"'\\f[PR]$' $page | \
>> $matches_for_this_name
-
+
cat $matches_for_this_name | sed -e 's/^/### MATCH: /'
cat $matches_for_this_name >> $matches_for_all_names
# like a function prototype for this name in the page
if grep -q "$name *(" $page || \
- grep -q "$name\\\\f.[\\ ]*(" $page; then
+ grep -q "$name\\\\f.[\\ ]*(" $page; then
# '.B name$'
- # '.BR name [^("]*$
+ # '.BR name [^("]*$
# (The use of [^"] in the above eliminates lines
# like: .BR func " and " func
# Those lines better be done manually.)
# If the file was changed, then:
# show "diff -U" output to user;
- # and count number of changed lines and compare it with what
+ # and count number of changed lines and compare it with what
# we expected, displaying a warning if it wasn't what was expected
if test $maybechanged -ne 0 && ! cmp -s $page $work_dst_file; then
made_matches=$(diff -U 0 $page $work_dst_file | grep '^\+[^+]' | \
wc -l | awk '{print $1}')
- # The following line makes the changes -- comment it out if you
+ # The following line makes the changes -- comment it out if you
# just want to do a dry run to see what changes would be made.
if test $really_do_it -ne 0; then
echo "%%%%%%%%%% WARNING: NOT ENOUGH MATCHES: " \
"$made_matches < $min_match"
fi
-
-done
+
+done
# clean up
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# This script is designed to help with "by hand" tidy-ups after
# the automated changes made by add_parens_for_own_funcs.sh.
#
-# The first argument to this script names a manual page directory where
-# 'man2' and 'man3' subdirectories can be found. The pages names in
-# these directories are used to generate a series of regular expressions
-# that can be used to search the manual page files that are named in
+# The first argument to this script names a manual page directory where
+# 'man2' and 'man3' subdirectories can be found. The pages names in
+# these directories are used to generate a series of regular expressions
+# that can be used to search the manual page files that are named in
# the remaining command-line arguments.
#
-# Example usage:
+# Example usage:
#
# cd man-pages-x.yy
# sh find_dots_no_parens.sh . man?/*.? > matches.log
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
awk_script_file=tmp.$0.awk
rm -f $awk_script_file
-# We grep out a few page names that are likely to generate false
+# We grep out a few page names that are likely to generate false
# positives...
echo '{' >> $awk_script_file
for page in $(
- find $dir/man2/* $dir/man3/* -type f -name '*.[23]' |
+ find $dir/man2/* $dir/man3/* -type f -name '*.[23]' |
egrep -v '/(stderr|stdin|stdout|errno|termios|string)\..$'); do
-
+
base=$(basename $page | sed -e 's/\.[23]$//')
echo " myvar == \"$base\" ||" >> $awk_script_file
echo ' print $0' >> $awk_script_file
echo '}' >> $awk_script_file
-grep '^\.[BRI][BRI]* [a-zA-Z0-9_][a-zA-Z0-9_]*[^a-zA-Z_]*$' $* |
+grep '^\.[BRI][BRI]* [a-zA-Z0-9_][a-zA-Z0-9_]*[^a-zA-Z_]*$' $* |
awk -f $awk_script_file | grep -v '([0-9]*)'
rm -f $awk_script_file
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#
#
-for file in "$@" ; do
+for file in "$@" ; do
# Do not process files that are redirects.
grep -qE "^\.so man.*" "$file"
if test $? -ne 0; then
words=$(MANWIDTH=2000 man -l "$file" 2> /dev/null | col -b | \
tr ' \008' '\012' | sed -e '/^$/d' | \
- sed 's/ *$//' |
+ sed 's/ *$//' |
awk 'BEGIN {p=""} {if (p==$0) print p; p=$0}' | \
grep '[a-zA-Z]' | tr '\012' ' ')
if test -n "$words"; then
# This script is designed to help with "by hand" tidy-ups after
# the automated changes made by add_parens_for_own_funcs.sh.
#
-# The first argument to this script names a manual page directory where
-# 'man2' and 'man3' subdirectories can be found. The pages names in
-# these directories are used to generate a series of regular expressions
-# that can be used to search the manual page files that are named in
+# The first argument to this script names a manual page directory where
+# 'man2' and 'man3' subdirectories can be found. The pages names in
+# these directories are used to generate a series of regular expressions
+# that can be used to search the manual page files that are named in
# the remaining command-line arguments.
#
-# Example usage:
+# Example usage:
#
# cd man-pages-x.yy
# sh find_slashes_no_parens.sh . man?/*.? > matches.log
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
regexp_file=tmp.$0.regexp
rm -f $regexp_file
-# We grep out a few page names that are likely to generate false
+# We grep out a few page names that are likely to generate false
# positives...
for page in $(
- find $dir/man2/* $dir/man3/* -type f -name '*.[23]' |
+ find $dir/man2/* $dir/man3/* -type f -name '*.[23]' |
egrep -v '/(stderr|stdin|stdout|errno|termios|string)\..$'); do
-
+
base=$(basename $page | sed -e 's/\.[23]$//')
echo "\\\\f[BI]$base\\\\f[PB][^(]" >> $regexp_file
cat $f | awk '
/^\.\\" *FIXME/ {
if ($0 ~ /.*FIXME *\..*/) {
- # FIXMES of the form "FIXME ." are "private" and
+ # FIXMES of the form "FIXME ." are "private" and
# ignored by this script
} else {
sub("FIXME[: ]*", "")
# .BR name ()
#
# This script changes instances to the latter format.
-# It does not fix all such instances: some will have to be
+# It does not fix all such instances: some will have to be
# done manually.
#
# Use the "-n" option for a dry run, in order to see what would be
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
shift $(( $OPTIND - 1 ))
-# Only process files with > 1 line -- single-line files are link files
+# Only process files with > 1 line -- single-line files are link files
for page in $(wc "$@" 2> /dev/null | awk '$1 > 1 {print $4}'| \
grep -v '^total'); do
-STYLE: legacy man(7) date format: Dd
-STYLE: lower case character in document title: Dt
-STYLE: operating system explicitly specified: Os
-STYLE: referenced manual not found: Xr
-WARNING: cross reference to self: Xr
+STYLE: legacy man(7) date format: Dd
+STYLE: lower case character in document title: Dt
+STYLE: operating system explicitly specified: Os
+STYLE: referenced manual not found: Xr
+WARNING: cross reference to self: Xr