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