Merge branch 'master' of git://git.openbox.org/dana/openbox
[mikachu/openbox.git] / release / email
1 #!/bin/sh
2
3 help() {
4   echo "Usage: $0 <revision> <version> [lastrelease]"
5   echo
6   echo "  <revision>    The revision which should be used for release."
7   echo "  <version>     The version of the release."
8   echo "  [lastrelease] The revision of the most recent release made."
9   echo "                By default it uses the most recent release-tag."
10   exit 1
11 }
12
13 REV="$1"
14 test -z "$REV" && help
15 VERSION="$2"
16 test -z "$VERSION" && help
17 LAST="$3"
18
19 . release/common
20
21 SUBJECT="[RELEASE] Openbox $VERSION"
22 MAILINGLIST=openbox@icculus.org
23
24 cat <<EOF > $WORKDIR/.email
25 Hello,
26
27 Openbox $VERSION is now available!
28
29 Some noteworthy changes are:
30 $CLNOWRAP
31
32 ======== Download ========
33
34 Download links are here: http://openbox.org/wiki/Openbox:Download
35
36 ======== Commits ========
37
38 The following is a full list of commits appearing in this release.
39 You can see the full commits here: http://git.openbox.org/?p=dana/openbox.git;a=shortlog;h=refs/tags/release-$VERSION
40
41
42 $SHORTLOG
43 EOF
44
45 if test -z $EDITOR; then
46     nano -w $WORKDIR/.email || error "failed to edit email, set \$EDITOR"
47 else
48     $EDITOR $WORKDIR/.email || error "failed to edit email with \$EDTIOR"
49 fi
50
51 test -e $WORKDIR/.email || error "email file disappeared"
52 cat $WORKDIR/.email | mail -s "$SUBJECT" "$MAILINGLIST" || \
53     error "mail to $MAILINGLIST failed"
54
55 clean
56 exit 0