Remove unused variable
[dana/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 MIKACHU=mikachu@icculus.org
24
25 cat <<EOF > $WORKDIR/.email
26 Hello,
27
28 Openbox $VERSION is now available!
29
30 Some noteworthy changes are:
31 $CLNOWRAP
32
33 ======== Download ========
34
35 Download links are here: http://openbox.org/wiki/Openbox:Download
36
37 ======== Commits ========
38
39 The following is a full list of commits appearing in this release.
40 You can see the full commits here: http://git.openbox.org/?p=dana/openbox.git;a=shortlog;h=refs/tags/release-$VERSION
41
42
43 $SHORTLOG
44 EOF
45
46 if test -z $EDITOR; then
47     nano -w $WORKDIR/.email || error "failed to edit email, set \$EDITOR"
48 else
49     $EDITOR $WORKDIR/.email || error "failed to edit email with \$EDTIOR"
50 fi
51
52 test -e $WORKDIR/.email || error "email file disappeared"
53 cat $WORKDIR/.email | mail -s "$SUBJECT" "$MAILINGLIST" || \
54     error "mail to $MAILINGLIST failed"
55
56 echo "Hi Mikachu,
57
58 Please update the freshmeat.net Openbox stuff for $VERSION. Thanks!" | \
59 mail -s "Freshmeat.net for Openbox $VERSION" "$MIKACHU" || \
60     error "mail to $MIKACHU failed"
61
62 clean
63 exit 0