Subject: bin/389: send-pr.el busted.
To: None <gnats-admin>
From: None <sommerfeld@orchard.medford.ma.us>
List: netbsd-bugs
Date: 08/03/1994 19:35:11
>Number: 389
>Category: bin
>Synopsis: send-pr.el busted on non-gnats site.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: gnats-admin (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Aug 3 19:35:10 1994
>Originator: Bill Sommerfeld
>Organization:
none
>Release: 1.0 Beta
>Environment:
System: NetBSD orchard.medford.ma.us 1.0-ALPHA NetBSD 1.0-ALPHA (ORCHARD) #4: Fri Jul 22 10:36:08 EDT 1994 root@orchard.medford.ma.us:/u1/nsys/sys/arch/i386/compile/ORCHARD i386
>Description:
send-pr looks for the file /usr/share/gnats/gnats-adm/config,
which isn't distributed in NetBSD; it attempts to catch errors
when this fails, but the way it does this is really lame.
It's better to just see if the config file exists at all
before bothering to start a subshell to parse it..
Also, send-pr.el should be installed *somewhere* in the system..
This should probably be reflected back to Cygnus.
>How-To-Repeat:
start emacs
load send-pr.el out of /src/gnu/usr.bin/send-pr/obj/send-pr.el
M-x send-pr
>Fix:
The change is smaller than it appears since I had to reindent
the code..
diff -c -r1.1.1.1 send-pr-el.in
*** 1.1.1.1 1994/05/17 19:31:15
--- send-pr-el.in 1994/08/04 01:59:27
***************
*** 88,105 ****
;;; user in his/her .emacs file.
;;;
(defun gnats::get-config (var)
! (let ((shell-file-name "/bin/sh")
! (buf (generate-new-buffer " *GNATS config*"))
! ret)
! (save-excursion
! (set-buffer buf)
! (shell-command (concat ". " gnats:root "/gnats-adm/config; echo $" var )
! t)
! (if (looking-at "/bin/sh:\\|\n")
! (setq ret nil)
! (setq ret (buffer-substring (point-min) (- (point-max) 1)))))
! (kill-buffer buf)
! ret))
;; const because it must match the script's value
(defconst send-pr:datadir (or (gnats::get-config "DATADIR") "xDATADIRx")
--- 88,107 ----
;;; user in his/her .emacs file.
;;;
(defun gnats::get-config (var)
! (let ((config-file (concat gnats:root "/gnats-adm/config")))
! (if (file-exists-p config-file)
! (let ((shell-file-name "/bin/sh")
! (buf (generate-new-buffer " *GNATS config*"))
! ret)
! (save-excursion
! (set-buffer buf)
! (shell-command (concat ". " config-file "; echo $" var )
! t)
! (if (looking-at "/bin/sh:\\|\n")
! (setq ret nil)
! (setq ret (buffer-substring (point-min) (- (point-max) 1)))))
! (kill-buffer buf)
! ret))))
;; const because it must match the script's value
(defconst send-pr:datadir (or (gnats::get-config "DATADIR") "xDATADIRx")
>Audit-Trail:
>Unformatted:
------------------------------------------------------------------------------