112
|
1 #!/bin/sh
|
|
2 # Submit a problem report to a GNATS site.
|
|
3 # Copyright (C) 1993 Free Software Foundation, Inc.
|
|
4 # Contributed by Brendan Kehoe (brendan@cygnus.com), based on a
|
|
5 # version written by Heinz G. Seidl (hgs@cygnus.com).
|
|
6 #
|
|
7 # This file is part of GNU GNATS.
|
|
8 #
|
|
9 # GNU GNATS is free software; you can redistribute it and/or modify
|
|
10 # it under the terms of the GNU General Public License as published by
|
|
11 # the Free Software Foundation; either version 2, or (at your option)
|
|
12 # any later version.
|
|
13 #
|
|
14 # GNU GNATS is distributed in the hope that it will be useful,
|
|
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17 # GNU General Public License for more details.
|
|
18 #
|
|
19 # You should have received a copy of the GNU General Public License
|
|
20 # along with GNU GNATS; see the file COPYING. If not, write to
|
|
21 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
22
|
|
23 # The version of this send-pr.
|
|
24 VERSION=3.101
|
|
25
|
|
26 # The submitter-id for your site.
|
118
|
27 SUBMITTER=net
|
112
|
28
|
|
29 # Where the GNATS directory lives, if at all.
|
|
30 [ -z "$GNATS_ROOT" ] &&
|
|
31 GNATS_ROOT=/usr/lib/gnats/gnats-db
|
|
32
|
|
33 # The default mail address for PR submissions.
|
118
|
34 GNATS_ADDR=bugs@xemacs.org
|
112
|
35
|
|
36 # Where the gnats category tree lives.
|
118
|
37 [ -z "$DATADIR" ] &&
|
112
|
38 DATADIR=/usr/share
|
|
39
|
|
40 # If we've been moved around, try using GCC_EXEC_PREFIX.
|
|
41 [ ! -d $DATADIR/gnats -a -d "$GCC_EXEC_PREFIX" ] &&
|
|
42 DATADIR=${GCC_EXEC_PREFIX}../../../lib
|
|
43
|
|
44
|
|
45 # The default release for this host.
|
|
46 DEFAULT_RELEASE="gnats-3.101"
|
|
47
|
|
48 # The default organization.
|
|
49 DEFAULT_ORGANIZATION="XEmacs Users"
|
|
50
|
|
51 # The default site to look for.
|
118
|
52 GNATS_SITE=xemacs.org
|
112
|
53
|
|
54 # Newer config information?
|
|
55 [ -f ${GNATS_ROOT}/gnats-adm/config ] && . ${GNATS_ROOT}/gnats-adm/config
|
|
56
|
|
57 # What mailer to use. This must come after the config file, since it is
|
|
58 # host-dependent.
|
|
59 MAIL_AGENT="/usr/lib/sendmail -oi -t"
|
|
60
|
|
61 # How to read the passwd database.
|
|
62 PASSWD="cat /etc/passwd"
|
|
63
|
|
64 ECHON=bsd
|
|
65
|
|
66 if [ $ECHON = bsd ] ; then
|
|
67 ECHON1="echo -n"
|
|
68 ECHON2=
|
|
69 elif [ $ECHON = sysv ] ; then
|
|
70 ECHON1=echo
|
|
71 ECHON2='\c'
|
|
72 else
|
|
73 ECHON1=echo
|
|
74 ECHON2=
|
|
75 fi
|
|
76
|
|
77 #
|
|
78
|
|
79 if [ -z "$TMPDIR" ]; then
|
|
80 TMPDIR=/tmp
|
|
81 else
|
|
82 if [ "`echo $TMPDIR | grep '/$'`" != "" ]; then
|
|
83 TMPDIR="`echo $TMPDIR | sed -e 's,/$,,'`"
|
|
84 fi
|
|
85 fi
|
|
86
|
|
87 TEMP=$TMPDIR/p$$
|
|
88 BAD=$TMPDIR/pbad$$
|
|
89 REF=$TMPDIR/pf$$
|
|
90
|
|
91 # find a user name
|
|
92 if [ "$LOGNAME" = "" ]; then
|
|
93 if [ "$USER" != "" ]; then
|
|
94 LOGNAME="$USER"
|
|
95 else
|
|
96 LOGNAME="UNKNOWN"
|
|
97 fi
|
|
98 fi
|
|
99
|
|
100 FROM="$LOGNAME"
|
|
101 if [ -z "$REPLYTO" ]; then
|
|
102 REPLYTO="$LOGNAME"
|
|
103 fi
|
|
104
|
|
105 # Find out the name of the originator of this PR.
|
|
106 if [ -n "$NAME" ]; then
|
|
107 ORIGINATOR="$NAME"
|
|
108 elif [ -f $HOME/.fullname ]; then
|
|
109 ORIGINATOR="`sed -e '1q' $HOME/.fullname`"
|
|
110 else
|
|
111 # Must use temp file due to incompatibilities in quoting behavior
|
|
112 # and to protect shell metacharacters in the expansion of $LOGNAME
|
|
113 $PASSWD | grep "^$LOGNAME:" | awk -F: '{print $5}' | sed -e 's/,.*//' > $TEMP
|
|
114 ORIGINATOR="`cat $TEMP`"
|
|
115 rm -f $TEMP
|
|
116 fi
|
|
117
|
|
118 if [ -n "$ORGANIZATION" ]; then
|
|
119 if [ -f "$ORGANIZATION" ]; then
|
|
120 ORGANIZATION="`cat $ORGANIZATION`"
|
|
121 fi
|
|
122 else
|
|
123 if [ -n "$DEFAULT_ORGANIZATION" ]; then
|
|
124 ORGANIZATION="$DEFAULT_ORGANIZATION"
|
|
125 elif [ -f $HOME/.organization ]; then
|
|
126 ORGANIZATION="`cat $HOME/.organization`"
|
|
127 elif [ -f $HOME/.signature ]; then
|
|
128 ORGANIZATION="`cat $HOME/.signature`"
|
|
129 fi
|
|
130 fi
|
|
131
|
|
132 # If they don't have a preferred editor set, then use
|
|
133 if [ -z "$VISUAL" ]; then
|
|
134 if [ -z "$EDITOR" ]; then
|
|
135 EDIT=vi
|
|
136 else
|
|
137 EDIT="$EDITOR"
|
|
138 fi
|
|
139 else
|
|
140 EDIT="$VISUAL"
|
|
141 fi
|
|
142
|
|
143 # Find out some information.
|
|
144 SYSTEM=`( [ -f /bin/uname ] && /bin/uname -a ) || \
|
|
145 ( [ -f /usr/bin/uname ] && /usr/bin/uname -a ) || echo ""`
|
|
146 ARCH=`[ -f /bin/arch ] && /bin/arch`
|
|
147 MACHINE=`[ -f /bin/machine ] && /bin/machine`
|
|
148
|
|
149 COMMAND=`echo $0 | sed -e 's,.*/,,'`
|
|
150 USAGE="Usage: $COMMAND [-PVL] [-t address] [-f filename] [-s severity]
|
|
151 [-c address] [--request-id] [--version]"
|
|
152 REMOVE=
|
|
153 BATCH=
|
|
154 CC=
|
|
155 SEVERITY_C=
|
|
156
|
|
157 while [ $# -gt 0 ]; do
|
|
158 case "$1" in
|
|
159 -r) ;; # Ignore for backward compat.
|
|
160 -t | --to) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
|
|
161 shift ; GNATS_ADDR="$1"
|
|
162 EXPLICIT_GNATS_ADDR=true
|
|
163 ;;
|
|
164 -f | --file) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
|
|
165 shift ; IN_FILE="$1"
|
|
166 if [ "$IN_FILE" != "-" -a ! -r "$IN_FILE" ]; then
|
|
167 echo "$COMMAND: cannot read $IN_FILE"
|
|
168 exit 1
|
|
169 fi
|
|
170 ;;
|
|
171 -b | --batch) BATCH=true ;;
|
|
172 -c | --cc) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
|
|
173 shift ; CC="$1"
|
|
174 ;;
|
|
175 -s | --severity) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
|
|
176 shift ; SEVERITY_C="$1"
|
|
177 ;;
|
|
178 -p | -P | --print) PRINT=true ;;
|
|
179 -L | --list) FORMAT=norm ;;
|
|
180 -l | -CL | --lisp) FORMAT=lisp ;;
|
|
181 --request-id) REQUEST_ID=true ;;
|
|
182 -h | --help) echo "$USAGE"; exit 0 ;;
|
|
183 -V | --version) echo "$VERSION"; exit 0 ;;
|
|
184 -*) echo "$USAGE" ; exit 1 ;;
|
|
185 *) if [ -z "$USER_GNATS_SITE" ]; then
|
|
186 if [ ! -r "$DATADIR/gnats/$1" ]; then
|
|
187 echo "$COMMAND: the GNATS site $1 does not have a categories list."
|
|
188 exit 1
|
|
189 else
|
|
190 # The site name is the alias they'll have to have created.
|
|
191 USER_GNATS_SITE=$1
|
|
192 fi
|
|
193 else
|
|
194 echo "$USAGE" ; exit 1
|
|
195 fi
|
|
196 ;;
|
|
197 esac
|
|
198 shift
|
|
199 done
|
|
200
|
|
201 if [ -n "$USER_GNATS_SITE" ] && [ "$USER_GNATS_SITE" != "$GNATS_SITE" ]; then
|
|
202 GNATS_SITE=$USER_GNATS_SITE
|
|
203 GNATS_ADDR=$USER_GNATS_SITE-gnats
|
|
204 fi
|
|
205
|
|
206 if [ "$SUBMITTER" = "unknown" -a -z "$REQUEST_ID" -a -z "$IN_FILE" ]; then
|
|
207 cat << '__EOF__'
|
|
208 It seems that send-pr is not installed with your unique submitter-id.
|
|
209 You need to run
|
|
210
|
|
211 install-sid YOUR-SID
|
|
212
|
|
213 where YOUR-SID is the identification code you received with `send-pr'.
|
|
214 `send-pr' will automatically insert this value into the template field
|
|
215 `>Submitter-Id'. If you've downloaded `send-pr' from the Net, use `net'
|
|
216 for this value. If you do not know your id, run `send-pr --request-id' to
|
|
217 get one from your support site.
|
|
218 __EOF__
|
|
219 exit 1
|
|
220 fi
|
|
221
|
|
222 if [ -r "$DATADIR/gnats/$GNATS_SITE" ]; then
|
|
223 CATEGORIES=`grep -v '^#' $DATADIR/gnats/$GNATS_SITE | sort`
|
|
224 else
|
|
225 echo "$COMMAND: could not read $DATADIR/gnats/$GNATS_SITE for categories list."
|
|
226 exit 1
|
|
227 fi
|
|
228
|
|
229 if [ -z "$CATEGORIES" ]; then
|
|
230 echo "$COMMAND: the categories list for $GNATS_SITE was empty!"
|
|
231 exit 1
|
|
232 fi
|
|
233
|
|
234 case "$FORMAT" in
|
|
235 lisp) echo "$CATEGORIES" | \
|
|
236 awk 'BEGIN {printf "( "} {printf "(\"%s\") ",$0} END {printf ")\n"}'
|
|
237 exit 0
|
|
238 ;;
|
|
239 norm) l=`echo "$CATEGORIES" | \
|
|
240 awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
|
|
241 END {print max + 1;}'`
|
|
242 c=`expr 70 / $l`
|
|
243 if [ $c -eq 0 ]; then c=1; fi
|
|
244 echo "$CATEGORIES" | \
|
|
245 awk 'BEGIN {print "Known categories:"; i = 0 }
|
|
246 { printf ("%-'$l'.'$l's", $0); if ((++i % '$c') == 0) { print "" } }
|
|
247 END { print ""; }'
|
|
248 exit 0
|
|
249 ;;
|
|
250 esac
|
|
251
|
|
252 ORIGINATOR_C='<name of the PR author (one line)>'
|
|
253 ORGANIZATION_C='<organization of PR author (multiple lines)>'
|
|
254 CONFIDENTIAL_C='<[ yes | no ] (one line)>'
|
|
255 SYNOPSIS_C='<synopsis of the problem (one line)>'
|
|
256 if [ -z "$SEVERITY_C" ]; then
|
|
257 SEVERITY_C='<[ non-critical | serious | critical ] (one line)>'
|
|
258 fi
|
|
259 PRIORITY_C='<[ low | medium | high ] (one line)>'
|
|
260 CATEGORY_C='<name of the product (one line)>'
|
|
261 CLASS_C='<[ sw-bug | doc-bug | change-request | support ] (one line)>'
|
|
262 RELEASE_C='<release number or tag (one line)>'
|
|
263 ENVIRONMENT_C='<machine, os, target, libraries (multiple lines)>'
|
|
264 DESCRIPTION_C='<precise description of the problem (multiple lines)>'
|
|
265 HOW_TO_REPEAT_C='<code/input/activities to reproduce the problem (multiple lines)>'
|
|
266 FIX_C='<how to correct or work around the problem, if known (multiple lines)>'
|
|
267
|
|
268 # Catch some signals. ($xs kludge needed by Sun /bin/sh)
|
|
269 xs=0
|
|
270 trap 'rm -f $REF $TEMP; exit $xs' 0
|
|
271 trap 'echo "$COMMAND: Aborting ..."; rm -f $REF $TEMP; xs=1; exit' 1 2 3 13 15
|
|
272
|
|
273 # If they told us to use a specific file, then do so.
|
|
274 if [ -n "$IN_FILE" ]; then
|
|
275 if [ "$IN_FILE" = "-" ]; then
|
|
276 # The PR is coming from the standard input.
|
|
277 if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
|
|
278 sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" > $TEMP
|
|
279 else
|
|
280 cat > $TEMP
|
|
281 fi
|
|
282 else
|
|
283 # Use the file they named.
|
|
284 if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
|
|
285 sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" $IN_FILE > $TEMP
|
|
286 else
|
|
287 cat $IN_FILE > $TEMP
|
|
288 fi
|
|
289 fi
|
|
290 else
|
|
291
|
|
292 if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
|
|
293 # If their PR_FORM points to a bogus entry, then bail.
|
|
294 if [ ! -f "$PR_FORM" -o ! -r "$PR_FORM" -o ! -s "$PR_FORM" ]; then
|
|
295 echo "$COMMAND: can't seem to read your template file (\`$PR_FORM'), ignoring PR_FORM"
|
|
296 sleep 1
|
|
297 PRINT_INTERN=bad_prform
|
|
298 fi
|
|
299 fi
|
|
300
|
|
301 if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
|
|
302 cp $PR_FORM $TEMP ||
|
|
303 ( echo "$COMMAND: could not copy $PR_FORM" ; xs=1; exit )
|
|
304 else
|
|
305 for file in $TEMP $REF ; do
|
|
306 cat > $file << '__EOF__'
|
|
307 SEND-PR: -*- send-pr -*-
|
|
308 SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
|
|
309 SEND-PR: will all comments (text enclosed in `<' and `>').
|
|
310 SEND-PR:
|
|
311 SEND-PR: Please consult the send-pr man page `send-pr(1)' or the Texinfo
|
|
312 SEND-PR: manual if you are not sure how to fill out a problem report.
|
|
313 SEND-PR:
|
|
314 SEND-PR: Choose from the following categories:
|
|
315 SEND-PR:
|
|
316 __EOF__
|
|
317
|
|
318 # Format the categories so they fit onto lines.
|
|
319 l=`echo "$CATEGORIES" | \
|
|
320 awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
|
|
321 END {print max + 1;}'`
|
|
322 c=`expr 61 / $l`
|
|
323 if [ $c -eq 0 ]; then c=1; fi
|
|
324 echo "$CATEGORIES" | \
|
|
325 awk 'BEGIN {printf "SEND-PR: "; i = 0 }
|
|
326 { printf ("%-'$l'.'$l's", $0);
|
|
327 if ((++i % '$c') == 0) { printf "\nSEND-PR: " } }
|
|
328 END { printf "\nSEND-PR:\n"; }' >> $file
|
|
329
|
|
330 cat >> $file << __EOF__
|
|
331 To: $GNATS_ADDR
|
|
332 Subject:
|
|
333 From: $FROM
|
|
334 Reply-To: $REPLYTO
|
|
335 Cc: $CC
|
|
336 X-send-pr-version: $VERSION
|
|
337
|
|
338
|
|
339 >Submitter-Id: $SUBMITTER
|
|
340 >Originator: $ORIGINATOR
|
|
341 >Organization:
|
|
342 ${ORGANIZATION- $ORGANIZATION_C}
|
|
343 >Confidential: $CONFIDENTIAL_C
|
|
344 >Synopsis: $SYNOPSIS_C
|
|
345 >Severity: $SEVERITY_C
|
|
346 >Priority: $PRIORITY_C
|
|
347 >Category: $CATEGORY_C
|
|
348 >Class: $CLASS_C
|
|
349 >Release: ${DEFAULT_RELEASE-$RELEASE_C}
|
|
350 >Environment:
|
|
351 $ENVIRONMENT_C
|
|
352 `[ -n "$SYSTEM" ] && echo System: $SYSTEM`
|
|
353 `[ -n "$ARCH" ] && echo Architecture: $ARCH`
|
|
354 `[ -n "$MACHINE" ] && echo Machine: $MACHINE`
|
|
355 >Description:
|
|
356 $DESCRIPTION_C
|
|
357 >How-To-Repeat:
|
|
358 $HOW_TO_REPEAT_C
|
|
359 >Fix:
|
|
360 $FIX_C
|
|
361 __EOF__
|
|
362 done
|
|
363 fi
|
|
364
|
|
365 if [ "$PRINT" = true -o "$PRINT_INTERN" = true ]; then
|
|
366 cat $TEMP
|
|
367 xs=0; exit
|
|
368 fi
|
|
369
|
|
370 chmod u+w $TEMP
|
|
371 if [ -z "$REQUEST_ID" ]; then
|
|
372 eval $EDIT $TEMP
|
|
373 else
|
|
374 ed -s $TEMP << '__EOF__'
|
|
375 /^Subject/s/^Subject:.*/Subject: request for a customer id/
|
|
376 /^>Category/s/^>Category:.*/>Category: send-pr/
|
|
377 w
|
|
378 q
|
|
379 __EOF__
|
|
380 fi
|
|
381
|
|
382 if cmp -s $REF $TEMP ; then
|
|
383 echo "$COMMAND: problem report not filled out, therefore not sent"
|
|
384 xs=1; exit
|
|
385 fi
|
|
386 fi
|
|
387
|
|
388 #
|
|
389 # Check the enumeration fields
|
|
390
|
|
391 # This is a "sed-subroutine" with one keyword parameter
|
|
392 # (with workaround for Sun sed bug)
|
|
393 #
|
|
394 SED_CMD='
|
|
395 /$PATTERN/{
|
|
396 s|||
|
|
397 s|<.*>||
|
|
398 s|^[ ]*||
|
|
399 s|[ ]*$||
|
|
400 p
|
|
401 q
|
|
402 }'
|
|
403
|
|
404
|
|
405 while [ -z "$REQUEST_ID" ]; do
|
|
406 CNT=0
|
|
407
|
|
408 # 1) Confidential
|
|
409 #
|
|
410 PATTERN=">Confidential:"
|
|
411 CONFIDENTIAL=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
|
|
412 case "$CONFIDENTIAL" in
|
|
413 ""|yes|no) CNT=`expr $CNT + 1` ;;
|
|
414 *) echo "$COMMAND: \`$CONFIDENTIAL' is not a valid value for \`Confidential'." ;;
|
|
415 esac
|
|
416 #
|
|
417 # 2) Severity
|
|
418 #
|
|
419 PATTERN=">Severity:"
|
|
420 SEVERITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
|
|
421 case "$SEVERITY" in
|
|
422 ""|non-critical|serious|critical) CNT=`expr $CNT + 1` ;;
|
|
423 *) echo "$COMMAND: \`$SEVERITY' is not a valid value for \`Severity'."
|
|
424 esac
|
|
425 #
|
|
426 # 3) Priority
|
|
427 #
|
|
428 PATTERN=">Priority:"
|
|
429 PRIORITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
|
|
430 case "$PRIORITY" in
|
|
431 ""|low|medium|high) CNT=`expr $CNT + 1` ;;
|
|
432 *) echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'."
|
|
433 esac
|
|
434 #
|
|
435 # 4) Category
|
|
436 #
|
|
437 PATTERN=">Category:"
|
|
438 CATEGORY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
|
|
439 FOUND=
|
|
440 for C in $CATEGORIES
|
|
441 do
|
|
442 if [ "$C" = "$CATEGORY" ]; then FOUND=true ; break ; fi
|
|
443 done
|
|
444 if [ -n "$FOUND" ]; then
|
|
445 CNT=`expr $CNT + 1`
|
|
446 else
|
|
447 if [ -z "$CATEGORY" ]; then
|
|
448 echo "$COMMAND: you must include a Category: field in your report."
|
|
449 else
|
|
450 echo "$COMMAND: \`$CATEGORY' is not a known category."
|
|
451 fi
|
|
452 fi
|
|
453 #
|
|
454 # 5) Class
|
|
455 #
|
|
456 PATTERN=">Class:"
|
|
457 CLASS=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
|
|
458 case "$CLASS" in
|
|
459 ""|sw-bug|doc-bug|change-request|support) CNT=`expr $CNT + 1` ;;
|
|
460 *) echo "$COMMAND: \`$CLASS' is not a valid value for \`Class'."
|
|
461 esac
|
|
462
|
|
463 [ $CNT -lt 5 -a -z "$BATCH" ] &&
|
|
464 echo "Errors were found with the problem report."
|
|
465
|
|
466 while true; do
|
|
467 if [ -z "$BATCH" ]; then
|
|
468 $ECHON1 "a)bort, e)dit or s)end? $ECHON2"
|
|
469 read input
|
|
470 else
|
|
471 if [ $CNT -eq 5 ]; then
|
|
472 input=s
|
|
473 else
|
|
474 input=a
|
|
475 fi
|
|
476 fi
|
|
477 case "$input" in
|
|
478 a*)
|
|
479 if [ -z "$BATCH" ]; then
|
|
480 echo "$COMMAND: the problem report remains in $BAD and is not sent."
|
|
481 mv $TEMP $BAD
|
|
482 else
|
|
483 echo "$COMMAND: the problem report is not sent."
|
|
484 fi
|
|
485 xs=1; exit
|
|
486 ;;
|
|
487 e*)
|
|
488 eval $EDIT $TEMP
|
|
489 continue 2
|
|
490 ;;
|
|
491 s*)
|
|
492 break 2
|
|
493 ;;
|
|
494 esac
|
|
495 done
|
|
496 done
|
|
497 #
|
|
498 # Remove comments and send the problem report
|
|
499 # (we have to use patterns, where the comment contains regex chars)
|
|
500 #
|
|
501 # /^>Originator:/s;$ORIGINATOR;;
|
|
502 sed -e "
|
|
503 /^SEND-PR:/d
|
|
504 /^>Organization:/,/^>[A-Za-z-]*:/s;$ORGANIZATION_C;;
|
|
505 /^>Confidential:/s;<.*>;;
|
|
506 /^>Synopsis:/s;$SYNOPSIS_C;;
|
|
507 /^>Severity:/s;<.*>;;
|
|
508 /^>Priority:/s;<.*>;;
|
|
509 /^>Category:/s;$CATEGORY_C;;
|
|
510 /^>Class:/s;<.*>;;
|
|
511 /^>Release:/,/^>[A-Za-z-]*:/s;$RELEASE_C;;
|
|
512 /^>Environment:/,/^>[A-Za-z-]*:/s;$ENVIRONMENT_C;;
|
|
513 /^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;;
|
|
514 /^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;;
|
|
515 /^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;;
|
|
516 " $TEMP > $REF
|
|
517
|
|
518 if $MAIL_AGENT < $REF; then
|
|
519 echo "$COMMAND: problem report sent"
|
|
520 xs=0; exit
|
|
521 else
|
|
522 echo "$COMMAND: mysterious mail failure."
|
|
523 if [ -z "$BATCH" ]; then
|
|
524 echo "$COMMAND: the problem report remains in $BAD and is not sent."
|
|
525 mv $REF $BAD
|
|
526 else
|
|
527 echo "$COMMAND: the problem report is not sent."
|
|
528 fi
|
|
529 xs=1; exit
|
|
530 fi
|