blog
       
Sat, 15 Sep 2007

Download mbox folder from BTS with mutt

It's a nice feature that you can download a bug report log in mbox format from the Debian BTS and open it with your MUA.
As i usually have mutt open i was wondering how i can do this directly from mutt without switching to another
shell, typing bts --mbox show 666 and ending up in a second mutt instance.
However, this is not so easy as i thought it will be, mostly because you cannot directly ask for user input
(the bug number) in mutt. At least i'm not aware how this is possible.
So i ended up with abusing mutt's feature to include different config files. I added to my muttrc

# set a default bug
set my_bug=128852
set my_bts_cmd="wget -q -O /tmp/bug.mbox \
'http://bugs.debian.org/cgi-bin/bugreport.cgi?mbox=yes;bug="
macro index \CN ":set my_bug="
macro index \CB " \
source ~/.mutt/bts.rc"

wheras bts.rc contains

push "unset wait_key\n \ $my_bts_cmd$my_bug' \ set wait_key\n /tmp/bug.mbox\n"

Beside that there is no error handling propably the most ugly thing is that the quotation marks
around $my_bts_cmd are splitted over different files :-/

However, i can now do in mutt

C-N bug-id
C-B

and have the whole bug report log downloaded and opened in my current mutt session.

[/debian] permanent link



           

[Home]

About
Name: Andreas Putzo
Location: 53 N 10 E

Links

[RSS]