Debian Codegraph @

man/mansed

raw
1 #! /bin/sh
2 :
3 #$Id: mansed,v 1.30 2000/09/28 01:23:07 guenther Exp $
4
5 if test -z "$IFS"
6 then IFS=" \
7 \
8
9 "
10 export IFS
11 fi
12
13 test 5 != $# &&
14 echo "Don't start this script directly, use \`make'" && exit 1
15
16 SHELL=$1
17 SRC="$2"
18 DEST="$3"
19 RM="$4"
20 DEVNULL=$5
21 export SHELL SRC DEST RM DEVNULL
22 TMPF0=/tmp/_mansed.0.$$
23 TMPF1=/tmp/_mansed.1.$$
24
25 if test ! -f "$DEST"
26 then
27 trap "$RM \"$DEST\" $TMPF0 $TMPF1;exit 1" 1 2 3 15
28 fi
29
30 (cat <<\HERE
31 .\"if n .pl +(135i-\n(.pu)
32 .de Id
33 .ds Rv \\$3
34 .ds Dt \\$4
35 ..
36 HERE
37 sed -e '1,/^.ex/ d' -e '/^\.TH/ q' <$SRC
38 cat <<\HERE
39 .rn SH Sh
40 .de SH
41 .br
42 .ne 11
43 .Sh "\\$1"
44 ..
45 .rn SS Ss
46 .de SS
47 .br
48 .ne 10
49 .Ss "\\$1"
50 ..
51 .rn TP Tp
52 .de TP
53 .br
54 .ne 9
55 .Tp \\$1
56 ..
57 .rn RS Rs
58 .de RS
59 .na
60 .nf
61 .Rs
62 ..
63 .rn RE Re
64 .de RE
65 .Re
66 .fi
67 .ad
68 ..
69 .de Sx
70 .PP
71 .ne \\$1
72 .RS
73 ..
74 .de Ex
75 .RE
76 .PP
77 ..
78 HERE
79 sed -e '1,/^\.TH/ d' <$SRC
80 expr "X$DEST" : '.*[18]$' >$DEVNULL && cat <<HERE
81 .Sh SOURCE
82 This program is part of the
83 .I procmail mail-processing-package
84 (v@PM_VERSION@) available at http://www.procmail.org/ or
85 ftp.procmail.org in
86 .BR pub/procmail/ .
87 .Sh MAILINGLIST
88 There exists a mailinglist for questions relating to any program in the
89 procmail package:
90 .RS
91 @PM_MAILINGLIST@
92 .RS
93 for submitting questions/answers.
94 .RE
95 @PM_MAILINGLISTR@
96 .RS
97 for subscription requests.
98 .RE
99 .PP
100 .RE
101 If you would like to stay informed about new versions and official patches send
102 a subscription request to
103 .RS
104 [email protected]
105 .RE
106 (this is a readonly list).
107 HERE
108 cat <<HERE
109 .SH AUTHORS
110 @AUTHORS@
111 .\".if n .pl -(\n(.tu-1i)
112 .rm SH
113 .rn Sh SH
114 .rm SS
115 .rn Ss SS
116 .rm TP
117 .rn Tp TP
118 .rm RS
119 .rn Rs RS
120 .rm RE
121 .rn Re RE
122 HERE
123 )| sed -f man.sed.0000 >$TMPF0
124
125 if test $? != 0
126 then
127 $RM $TMPF0
128 exit 1
129 fi
130
131 for a in man.sed.[0-9]*
132 do
133 case $a in
134 man.sed.0000) ;;
135 man.sed.????)
136 mv $TMPF0 $TMPF1
137 if sed -f $a <$TMPF1 >$TMPF0
138 then
139 :
140 else
141 $RM $TMPF1 $TMPF0
142 exit 1
143 fi
144 esac
145 done
146
147 cat $TMPF0 >"$DEST"
148 result=$?
149
150 $RM $TMPF0 $TMPF1
151 exit $result