#!/bin/bash -e # # Copyright © 2002 Rick Younie # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see # . # ####################################################################### # # craft a bug report or fail/success reply to a buildd log mail # using vim, mutt and optionally quintuple-agent: # mutt # 'f'orward the message # (may require autoedit & edit_headers .muttrc settings) # vim # map :%!~buildd/bin/dobuildlog agpg # map :%!~buildd/bin/dobuildlog gpg # map :%!~buildd/bin/dobuildlog bug # these require setting by the user SIGNOPTS='--clearsign --default-key younie@debian.org' FROM="$EMAIL" # "Your Name " ARCH=m68k # for the bug report log link print_header () { echo "From: $FROM" sed -n ' /^-----/,/^Automatic/ { s/From: /To: /p s/^Subject: Log/Subject: Re: Log/p }' echo } fail_options () { cat << EOF failed this one takes a comment, multi-line, indenting optional dep-wait - usage: dep-wait some-package (>= version), another-package (>> version) giveback manual newvers not-for-us purge - purges the source tree from the chroot retry upload-rem EOF } success_fail () { STATUS=$(sed -n '/^-----/,/^Automatic/ s/^Subject: Log for \([^ ]*\) build .*/\1/p') case "$STATUS" in successful ) print_header sed -n '/\.changes:$/,$ { /^Format: /,/^$/p }' |$SIGNPRG 2>/dev/null ;; failed ) print_header fail_options sed -n '/^Automatic build of/,$p' ;; * ) echo "..this doesn't appear to be a buildd success/fail message" exit 1 ;; esac } bug_report () { PKG=$1 VERS=$2 cat << EOF From: $FROM To: submit@bugs.debian.org Subject: $PKG_VERS: fails to build Package: $PKG Version: $VERS Severity: serious Hi, EOF sed -n '/^Automatic build of/,/^Build needed/ s/^/| /p' cat <