[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

mh: Help for creating Debian bug reports



Package: mh
Version: 6.8.4-13
Severity: normal

  How many of you Debian users also use emacs?  If so, here's a
  function which you may find useful to create an accurate, standard,
  and complete template for your bug report that includes the
  necessary pseudo-headers, system information, and inserts the package
  name at the beginning of the subject.

  It gives you a choice of mail address (submit or maintonly) as well
  as severity (wishlist, normal, grave, or critical). In fact, I ran
  it on this mail message, although I removed the
  submit@bugs.debian.org from To field.  Note the Subject, the
  pseudo-header and the trailer at the bottom.

  I use it from mh-e (and inserted the hooks below) but it can
  probably be used from other mailers as well.

  Comments welcome.

;;;
;;; insert-debian-bug-template: prepares a bug report for Debian given
;;; a mail buffer with To and Subject fields in the header.
;;;
(defun insert-debian-bug-template (recipient package severity)
  "Create a Debian bug report template."
  (interactive
   (list
    (let ((rcpt (completing-read "To [submit]: " 
				 '(("submit" 1) ("maintonly" 2)) nil t)))
      (if (equal rcpt "")
	  "submit"
	rcpt))
    (read-from-minibuffer "Package: ")
    (let ((severity (completing-read "Severity [normal]: " 
				     '(("wishlist" 1) ("normal" 2)
				       ("grave" 3) ("critical" 4)) nil t)))
      (if (equal severity "")
	  "normal"
	severity))))

  (message "Gathering system info...")

  (insert "Package: " package "\n")
  (call-process "sh" nil t nil "-c"
		(format "dpkg --status %s | grep Version" package))
  (insert "Severity: " severity "\n")

  (insert "\n\n\nDebian GNU/Linux: ")
  (call-process "sh" nil t nil "-c" "cat /etc/debian_version")
  (insert "Linux kernel:     ")
  (call-process "sh" nil t nil "-c" "uname -r")
  (insert "Gcc:              ")
  (call-process "sh" nil t nil "-c" "ls -l /lib/libc.so.5 | awk '{print $NF}'")
  (insert "Perl:             ")
  (call-process "sh" nil t nil "-c"
		"dpkg --status perl | grep Version | awk '{print $NF}'")

  (goto-char (point-min))
  (search-forward-regexp "^To:")
  (insert " " recipient "@bugs.debian.org")
  (goto-char (point-min))
  (search-forward-regexp "^Subject:")
  (insert " " package ":")

  (message "*** Ensure Version exists."))

;;; mh-e hooks
(defun my-mh-folder-mode-hook ()
  "Hook to set key bindings in MH-Folder mode."
  ...
	(local-set-key "D" 'report-debian-bug)
  ...)

(defun report-debian-bug ()
  "Send a Debian bug report."
  (interactive)
  (compose-mail-with-template (concat mh-user-path "comps/debian-bug")))

(add-hook 'mh-letter-mode-hook		'my-mh-letter-mode-hook)
(defun my-mh-letter-mode-hook ()
  "Hook to prepare letter for editing."
  ...
  ;; Insert Debian bug information, and ready point after pseudo-header.
  (if (equal mh-comp-formfile (concat mh-user-path "comps/debian-bug"))
      (progn
	(call-interactively 'insert-debian-bug-template)
	(goto-char (point-min))
	(search-forward-regexp "^$")
	(forward-char 1)))
  ...)
  


Debian GNU/Linux: 1.3
Linux kernel:     2.0.30
Gcc:              libc.so.5.4.33
Perl:             5.003.07-10

Bill Wohler <wohler@newt.com>
Say it with MIME.  Maintainer of comp.mail.mh and news.software.nn FAQs.
If you're passed on the right, you're in the wrong lane.


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: