xref: /minix3/external/bsd/mdocml/dist/gmdiff (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc#!/bin/sh
2*0a6a1f1dSLionel Sambuc# Copyright (c) 2013 Ingo Schwarze <schwarze@openbsd.org>
3*0a6a1f1dSLionel Sambuc#
4*0a6a1f1dSLionel Sambuc# Permission to use, copy, modify, and distribute this software for any
5*0a6a1f1dSLionel Sambuc# purpose with or without fee is hereby granted, provided that the above
6*0a6a1f1dSLionel Sambuc# copyright notice and this permission notice appear in all copies.
7*0a6a1f1dSLionel Sambuc#
8*0a6a1f1dSLionel Sambuc# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9*0a6a1f1dSLionel Sambuc# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10*0a6a1f1dSLionel Sambuc# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11*0a6a1f1dSLionel Sambuc# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12*0a6a1f1dSLionel Sambuc# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13*0a6a1f1dSLionel Sambuc# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14*0a6a1f1dSLionel Sambuc# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*0a6a1f1dSLionel Sambuc
16*0a6a1f1dSLionel Sambucif [ `id -u` -eq 0 ]; then
17*0a6a1f1dSLionel Sambuc  echo "$0: do not run me as root"
18*0a6a1f1dSLionel Sambuc  exit 1
19*0a6a1f1dSLionel Sambucfi
20*0a6a1f1dSLionel Sambuc
21*0a6a1f1dSLionel Sambucif [ $# -eq 0 ]; then
22*0a6a1f1dSLionel Sambuc  echo "usage: $0 manual_source_file ..."
23*0a6a1f1dSLionel Sambuc  exit 1
24*0a6a1f1dSLionel Sambucfi
25*0a6a1f1dSLionel Sambuc
26*0a6a1f1dSLionel Sambucwhile [ -n "$1" ]; do
27*0a6a1f1dSLionel Sambuc  file=$1
28*0a6a1f1dSLionel Sambuc  shift
29*0a6a1f1dSLionel Sambuc  echo " ========== $file ========== "
30*0a6a1f1dSLionel Sambuc  tbl $file | groff -mandoc -Tascii -P -c 2>&1 > /tmp/groff.out
31*0a6a1f1dSLionel Sambuc  mandoc -Ios='OpenBSD ports' -Werror $file 2>&1 > /tmp/mandoc.out
32*0a6a1f1dSLionel Sambuc  diff -au /tmp/groff.out /tmp/mandoc.out 2>&1
33*0a6a1f1dSLionel Sambucdone
34*0a6a1f1dSLionel Sambuc
35*0a6a1f1dSLionel Sambucexit 0
36