3 # Midnight Commander - check the documentation for compatibility with groff and nroff.
5 # Copyright (C) 2002, 2003, 2011, 2013
6 # The Free Software Foundation, Inc.
9 # Pavel Roskin <proski@gnu.org> 2002, 2003
10 # Ilia Maslakov <il.smind@gmail.com>, 2011
11 # Slava Zanko <slavazanko@gmail.com>, 2013
13 # This file is part of the Midnight Commander.
15 # The Midnight Commander is free software: you can redistribute it
16 # and/or modify it under the terms of the GNU General Public License as
17 # published by the Free Software Foundation, either version 3 of the License,
18 # or (at your option) any later version.
20 # The Midnight Commander is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program. If not, see <http://www.gnu.org/licenses/>.
30 MC_SOURCE_ROOT_DIR
=${MC_SOURCE_ROOT_DIR:-$(dirname "$(pwd)")}
32 #*** main code *********************************************************
34 [ -r "${MC_SOURCE_ROOT_DIR}/doc/man/mc.1.in" ] ||
{
35 echo "ERROR: cannot read doc/man/mc.1.in" 2>&1
39 for cmd
in groff nroff
; do
40 IFS
='' ROFF_WARNINGS
="$ROFF_WARNINGS
42 find "${MC_SOURCE_ROOT_DIR}/doc
" -name '*.[1-9].in' \
43 -exec sh -c "$cmd -K UTF-8
-Tutf8 -mandoc -ww '{}' |
grep 'warning:'" \; 2>&1
47 # Check that English manuals are in ASCII
48 ASCII_WARNINGS
=$
(find "${MC_SOURCE_ROOT_DIR}/doc" -maxdepth 1 -name '*.[1-9].in' -exec groff -Tascii -ww {} \
; 2>&1)
50 if [ "x`printf '%s' "${ROFF_WARNINGS}${ASCII_WARNINGS}" | tr -d "$IFS"`" != x
] ; then
51 echo "$ROFF_WARNINGS" |
sort -u |
grep .
52 echo "$ASCII_WARNINGS" |
sort -u |
grep .