libXtst relies on libXi for headers.
[xorg-util-modular.git] / release.sh
blob6e1b9a024354789dacbd2b00092656037ce1a1be
1 #!/bin/sh
3 set -e
5 announce_list="xorg-announce@lists.freedesktop.org"
6 host_people=annarchy.freedesktop.org
7 host_xorg=xorg.freedesktop.org
8 user=`whoami`
10 usage()
12 cat <<HELP
13 Usage: `basename $0` [options] <section> <tag_previous> <tag_current>
15 Options:
16 --force force overwritting an existing release
17 --user <name> username on $host_people (default "`whoami`")
18 --help this help message
19 HELP
22 gen_announce_mail()
24 case "$tag_previous" in
25 initial)
26 range="$tag_current"
29 range="$tag_previous".."$tag_current"
31 esac
33 cat <<RELEASE
34 Subject: [ANNOUNCE] $module $version
35 To: $announce_list
37 `git-log --no-merges "$range" | git shortlog`
39 git tag: $tag_current
41 http://$host_xorg/$section_path/$tarbz2
42 MD5: `cd $tarball_dir && md5sum $tarbz2`
43 SHA1: `cd $tarball_dir && sha1sum $tarbz2`
45 http://$host_xorg/$section_path/$targz
46 MD5: `cd $tarball_dir && md5sum $targz`
47 SHA1: `cd $tarball_dir && sha1sum $targz`
49 RELEASE
52 export LC_ALL=C
54 while [ $# != 0 ]; do
55 case "$1" in
56 --force)
57 force="yes"
58 shift
60 --help)
61 usage
62 exit 0
64 --user)
65 shift
66 user=$1
67 shift
69 --*)
70 echo "error: unknown option"
71 usage
72 exit 1
75 section="$1"
76 tag_previous="$2"
77 tag_current="$3"
78 shift 3
79 if [ $# != 0 ]; then
80 echo "error: unknown parameter"
81 usage
82 exit 1
85 esac
86 done
88 tarball_dir="$(dirname $(find . -name config.status))"
89 module="${tag_current%-*}"
90 version="${tag_current##*-}"
91 tarbz2="$tag_current.tar.bz2"
92 targz="$tag_current.tar.gz"
93 announce="$tarball_dir/$tag_current.announce"
95 section_path="archive/individual/$section"
96 srv_path="/srv/$host_xorg/$section_path"
98 echo "checking parameters"
99 if ! [ -f "$tarball_dir/$tarbz2" ] ||
100 ! [ -f "$tarball_dir/$targz" ] ||
101 [ -z "$tag_previous" ] ||
102 [ -z "$section" ]; then
103 echo "error: incorrect parameters!"
104 usage
105 exit 1
108 echo "checking for proper current dir"
109 if ! [ -d .git ]; then
110 echo "error: do this from your git dir, weenie"
111 exit 1
114 echo "checking for an existing tag"
115 if ! git tag -l $tag_current >/dev/null; then
116 echo "error: you must tag your release first!"
117 exit 1
120 echo "checking for an existing release"
121 if ssh $user@$host_people ls $srv_path/$targz >/dev/null 2>&1 ||
122 ssh $user@$host_people ls $srv_path/$tarbz2 >/dev/null 2>&1; then
123 if [ "x$force" = "xyes" ]; then
124 echo "warning: overriding released file ... here be dragons."
125 else
126 echo "error: file already exists!"
127 exit 1
131 echo "generating announce mail template, remember to sign it"
132 gen_announce_mail >$announce
133 echo " at: $announce"
135 echo "installing release into server"
136 scp $tarball_dir/$targz $tarball_dir/$tarbz2 $user@$host_people:$srv_path
138 echo "pushing changes upstream"
139 git push origin
140 git push origin $tag_current