2013-04-05 02:47:06 +04:00
|
|
|
#!/bin/bash
|
2002-10-30 10:37:53 +03:00
|
|
|
|
2013-04-05 02:47:06 +04:00
|
|
|
# Midnight Commander - check the documentation for compatibility with groff and nroff.
|
|
|
|
#
|
|
|
|
# Copyright (C) 2002, 2003, 2011, 2013
|
|
|
|
# The Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# Written by:
|
|
|
|
# Pavel Roskin <proski@gnu.org> 2002, 2003
|
|
|
|
# Ilia Maslakov <il.smind@gmail.com>, 2011
|
|
|
|
# Slava Zanko <slavazanko@gmail.com>, 2013
|
|
|
|
#
|
|
|
|
# This file is part of the Midnight Commander.
|
|
|
|
#
|
|
|
|
# The Midnight Commander is free software: you can redistribute it
|
|
|
|
# and/or modify it under the terms of the GNU General Public License as
|
|
|
|
# published by the Free Software Foundation, either version 3 of the License,
|
|
|
|
# or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# The Midnight Commander 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
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2002-11-05 21:05:31 +03:00
|
|
|
|
2024-10-26 19:22:17 +03:00
|
|
|
set +e
|
2013-04-05 02:47:06 +04:00
|
|
|
|
2024-10-26 19:22:17 +03:00
|
|
|
MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname "$(pwd)")}
|
2002-11-05 21:01:58 +03:00
|
|
|
|
2013-04-05 02:47:06 +04:00
|
|
|
#*** main code *********************************************************
|
|
|
|
|
|
|
|
[ -r "${MC_SOURCE_ROOT_DIR}/doc/man/mc.1.in" ] || {
|
2024-10-26 19:22:17 +03:00
|
|
|
echo "ERROR: cannot read doc/man/mc.1.in" 2>&1
|
2013-04-05 02:47:06 +04:00
|
|
|
exit 1
|
|
|
|
}
|
2002-11-05 21:01:58 +03:00
|
|
|
|
2024-10-26 19:22:17 +03:00
|
|
|
for cmd in groff nroff ; do
|
|
|
|
IFS='' ROFF_WARNINGS="$ROFF_WARNINGS
|
|
|
|
$(
|
|
|
|
find "${MC_SOURCE_ROOT_DIR}/doc" -name '*.[1-9].in' \
|
|
|
|
-exec sh -c "$cmd -K UTF-8 -Tutf8 -mandoc -ww '{}' | grep 'warning:'" \; 2>&1
|
|
|
|
)"
|
2011-02-16 23:21:01 +03:00
|
|
|
done
|
|
|
|
|
2024-10-26 19:22:17 +03:00
|
|
|
# Check that English manuals are in ASCII
|
|
|
|
ASCII_WARNINGS=$(find "${MC_SOURCE_ROOT_DIR}/doc" -maxdepth 1 -name '*.[1-9].in' -exec groff -Tascii -ww {} \; 2>&1)
|
2013-04-05 02:47:06 +04:00
|
|
|
|
2024-10-26 19:22:17 +03:00
|
|
|
if [ "x`printf '%s' "${ROFF_WARNINGS}${ASCII_WARNINGS}" | tr -d "$IFS"`" != x ] ; then
|
|
|
|
echo "$ROFF_WARNINGS" | sort -u | grep .
|
|
|
|
echo "$ASCII_WARNINGS" | sort -u | grep .
|
|
|
|
exit 1
|
|
|
|
fi
|