chiark / gitweb /
ubuntu-daily: flip -a semantics to mean --authenticated, not --anonymous
[bin.git] / lp-bug-notify-helper
1 #! /bin/sh
2 set -e
3
4 formail -cz -X Subject: -X X-Launchpad-Bug: | \
5         perl -nle '
6                 s/\s+/ /g;
7                 if (s/^Subject:\s+//i) {
8                         s/^\[Bug (\d+)\] \[NEW\] // or exit 0;
9                         $bug = $1;
10                         $subj = $_;
11                 } elsif (s/^X-Launchpad-Bug:\s+//i) {
12                         if (/\bimportance=(\w+)/) {
13                                 $imp = $1;
14                         }
15                 }
16                 END {
17                         if (defined $bug and defined $subj) {
18                                 $imp = "Undecided" unless defined $imp;
19                                 open FILE, ">>$ENV{HOME}/.irssi/fnotify";
20                                 print FILE "LPBUG $bug $imp $subj";
21                                 close FILE;
22                         }
23                 }'