~ubuntu-branches/ubuntu/hardy/sbuild/hardy

« back to all changes in this revision

Viewing changes to bin/dobuildlog

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2005-04-01 21:23:30 UTC
  • mfrom: (1.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050401212330-lnjvuwrm9urpy54l
Tags: 0.35
Michael Banck:

* bin/abort-current-build: Remove the `-B' from the grep line as
  `sbuild -s' does not pass that option to dpkg-configure and abort-
  current-build fails in that case.
* sbuild: Set the locale to `POSIX' to make debconf and debhelper calls in
  the chroot not spew out locale warnings all the time.
  (closes: #287672)
* sbuild: Removed check for specific distributions. Instead, fail if
  build/chroot-$dist is not there.
* sbuild: Only override Distribution in .changes if specified as option on
  the command-line.
  (closes: #300145)
* sbuild: Specify full path for Dir::Etc::main and Dir::Etc::parts.
* example.sbuildrc: Clarify that $maintainer_name is not mandatory and
  overrides Maintainer: field, whereas $uploader_name overrides
  the Changed-By: field in changes.
* Applied patch by Santiago Vila:
  - Moves scripts from /usr/lib/sbuild to /usr/share/sbuild and modifies
    all callers accordingly.
  - Add -n option to tail to comply with POSIX.
  - Call /usr/sbin/sendmail instead of /usr/lib/sendmail.
  (closes: #292717)
* sbuild: Tolerate '0' as version number, thanks Santiago Vila.
  (closes: #300205)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash -e
 
2
#
 
3
# vim:ts=4:noet:wrap:sts=4:sw=4:
 
4
# $Id: dobuildlog,v 1.1.1.1 2004/09/17 13:17:41 frankie Exp $
 
5
# Rick Younie <rick@def.debian.net>
 
6
#
 
7
# craft a bug report or fail/success reply to a buildd log mail
 
8
# using vim, mutt and optionally quintuple-agent:
 
9
#   mutt
 
10
#               'f'orward the message
 
11
#       (may require autoedit & edit_headers .muttrc settings)
 
12
#   vim
 
13
#               map <F3> :%!~buildd/bin/dobuildlog agpg<CR>
 
14
#               map <S-F3> :%!~buildd/bin/dobuildlog gpg<CR>
 
15
#               map <F4> :%!~buildd/bin/dobuildlog bug<CR>
 
16
 
 
17
# these require setting by the user
 
18
SIGNOPTS='--clearsign --default-key younie@debian.org'
 
19
FROM="$EMAIL"   # "Your Name <your@addr.ess>"
 
20
ARCH=m68k               # for the bug report log link
 
21
 
 
22
print_header () {
 
23
        echo "From: $FROM"
 
24
        sed -n '
 
25
                /^-----/,/^Automatic/ {
 
26
                        s/From: /To: /p
 
27
                        s/^Subject: Log/Subject: Re: Log/p
 
28
                }'
 
29
        echo
 
30
}
 
31
 
 
32
fail_options () {
 
33
        cat << EOF
 
34
failed
 
35
 this one takes a comment,
 
36
 multi-line, indenting optional
 
37
dep-wait
 
38
  - usage: dep-wait some-package (>= version), another-package (>> version)
 
39
giveback
 
40
manual
 
41
newvers
 
42
not-for-us
 
43
purge
 
44
  - purges the source tree from the chroot
 
45
retry
 
46
upload-rem
 
47
 
 
48
 
 
49
EOF
 
50
}
 
51
 
 
52
success_fail () {
 
53
        STATUS=$(sed -n '/^-----/,/^Automatic/ s/^Subject: Log for \([^ ]*\) build .*/\1/p')
 
54
 
 
55
        case "$STATUS" in
 
56
                successful )
 
57
                        print_header
 
58
                        sed -n '/\.changes:$/,$ {
 
59
                                /^Format: /,/^$/p
 
60
                        }' |$SIGNPRG 2>/dev/null
 
61
                        ;;
 
62
                failed )
 
63
                        print_header
 
64
                        fail_options
 
65
                        sed -n '/^Automatic build of/,$p'
 
66
                        ;;
 
67
                * )
 
68
                        echo "..this doesn't appear to be a buildd success/fail message"
 
69
                        exit 1
 
70
                        ;;
 
71
        esac
 
72
}
 
73
 
 
74
bug_report () {
 
75
        PKG=$1
 
76
        VERS=$2
 
77
        
 
78
cat << EOF
 
79
From: $FROM
 
80
To: submit@bugs.debian.org
 
81
Subject: $PKG_VERS: fails to build
 
82
 
 
83
Package: $PKG
 
84
Version: $VERS
 
85
Severity: serious
 
86
 
 
87
Hi,
 
88
 
 
89
 
 
90
EOF
 
91
sed -n '/^Automatic build of/,/^Build needed/ s/^/| /p'
 
92
cat <<EOF
 
93
 
 
94
 
 
95
The $ARCH build logs for $PKG can be found at
 
96
 http://buildd.debian.org/build.php?arch=$ARCH&pkg=$PKG
 
97
 
 
98
 
 
99
EOF
 
100
}
 
101
 
 
102
case "$1" in
 
103
        gpg | agpg )
 
104
                SIGNPRG="$1 $SIGNOPTS"
 
105
                success_fail
 
106
                exit 0
 
107
                ;;
 
108
        bug )
 
109
                PKG_VERS=$(sed -n '/^-----/,/^Automatic/ s/^Subject: Log for \([^ ]*\) build of \([^ ]*\) .*/\2/p')
 
110
                bug_report $(echo "$PKG_VERS" |sed 's/_/ /')
 
111
                ;;
 
112
        * )
 
113
                echo "Usage: $(basename $0) gpg|agpg|bug"
 
114
                exit 1
 
115
                ;;
 
116
esac