5 announce_list
="xorg-announce@lists.freedesktop.org"
6 xorg_list
="xorg@lists.freedesktop.org"
7 dri_list
="dri-devel@lists.sourceforge.net"
8 xkb_list
="xkb@listserv.bat.ru"
10 host_people
=annarchy.freedesktop.org
11 host_xorg
=xorg.freedesktop.org
12 host_dri
=dri.freedesktop.org
19 Usage: `basename $0` [options] <section> <tag_previous> <tag_current>
22 --force force overwritting an existing release
23 --user <name> username on $host_people
24 --help this help message
25 --ignore-local-changes don't abort on uncommitted local changes
26 --remote git remote where the change should be pushed (default "origin")
33 Uncommitted changes found. Did you forget to commit? Aborting.
34 Use --ignore-local-changes to skip this check.
41 case "$tag_previous" in
46 range
="$tag_previous"..
"$tag_current"
50 MD5SUM
=`which md5sum || which gmd5sum`
51 SHA1SUM
=`which sha1sum || which gsha1sum`
53 if [ "$section" = "libdrm" ]; then
56 elif [ "$section" = "xkeyboard-config" ]; then
65 Subject: [ANNOUNCE] $module $version
69 `git log --no-merges "$range" | git shortlog`
73 http://$host/$section_path/$tarbz2
74 MD5: `cd $tarball_dir && $MD5SUM $tarbz2`
75 SHA1: `cd $tarball_dir && $SHA1SUM $tarbz2`
77 http://$host/$section_path/$targz
78 MD5: `cd $tarball_dir && $MD5SUM $targz`
79 SHA1: `cd $tarball_dir && $SHA1SUM $targz`
101 --ignore-local-changes)
111 echo "error: unknown option"
121 echo "error: unknown parameter"
129 # Check for uncommitted/queued changes.
130 if [ "x$ignorechanges" != "x1" ]; then
132 git
diff --quiet HEAD
> /dev
/null
2>&1
133 if [ $?
-ne 0 ]; then
139 # Check if the object has been pushed. Do do so
140 # 1. Check if the current branch has the object. If not, abort.
141 # 2. Check if the object is on $remote/branchname. If not, abort.
142 local_sha
=`git rev-list -1 $tag_current`
143 current_branch
=`git branch | grep "\*" | sed -e "s/\* //"`
145 git rev-list
$current_branch |
grep $local_sha > /dev
/null
146 if [ $?
-eq 1 ]; then
147 echo "Cannot find tag '$tag_current' on current branch. Aborting."
148 echo "Switch to the correct branch and re-run the script."
152 revs
=`git rev-list $remote/$current_branch..$current_branch | wc -l`
153 if [ $revs -ne 0 ]; then
154 git rev-list
$remote/$current_branch..
$current_branch |
grep $local_sha > /dev
/null
156 if [ $?
-ne 1 ]; then
157 echo "$remote/$current_branch doesn't have object $local_sha"
158 echo "for tag '$tag_current'. Did you push branch first? Aborting."
164 tarball_dir
="$(dirname $(find . -name config.status))"
165 module
="${tag_current%-*}"
166 if [ "x$module" = "x$tag_current" ]; then
167 # version-number-only tag.
169 module
=`basename $pwd`
170 version
="$tag_current"
172 # module-and-version style tag
173 version
="${tag_current##*-}"
176 detected_module
=`grep 'PACKAGE = ' $tarball_dir/Makefile | sed 's|PACKAGE = ||'`
177 if [ -f $detected_module-$version.
tar.bz2
]; then
178 module
=$detected_module
181 modulever
=$module-$version
182 tarbz2
="$modulever.tar.bz2"
183 targz
="$modulever.tar.gz"
184 announce
="$tarball_dir/$modulever.announce"
186 echo "checking parameters"
187 if ! [ -f "$tarball_dir/$tarbz2" ] ||
188 ! [ -f "$tarball_dir/$targz" ]; then
189 echo "error: tarballs not found. Did you run make dist?"
194 if [ -z "$tag_previous" ] ||
195 [ -z "$section" ]; then
196 echo "error: previous tag or section not found."
201 if [ "$section" = "libdrm" ]; then
202 section_path
="libdrm"
203 srv_path
="/srv/$host_dri/www/$section_path"
204 elif [ "$section" = "xkeyboard-config" ]; then
205 section_path
="archive/individual/data"
206 srv_path
="/srv/$host_xorg/$section_path"
208 section_path
="archive/individual/$section"
209 srv_path
="/srv/$host_xorg/$section_path"
212 echo "checking for proper current dir"
213 if ! [ -d .git
]; then
214 echo "error: do this from your git dir, weenie"
218 echo "checking for an existing tag"
219 if ! git tag
-l $tag_current >/dev
/null
; then
220 echo "error: you must tag your release first!"
224 echo "checking for an existing release"
225 if ssh $user$host_people ls $srv_path/$targz >/dev
/null
2>&1 ||
226 ssh $user$host_people ls $srv_path/$tarbz2 >/dev
/null
2>&1; then
227 if [ "x$force" = "xyes" ]; then
228 echo "warning: overriding released file ... here be dragons."
230 echo "error: file already exists!"
235 echo "generating announce mail template, remember to sign it"
236 gen_announce_mail
>$announce
237 echo " at: $announce"
239 echo "installing release into server"
240 scp
$tarball_dir/$targz $tarball_dir/$tarbz2 $user$host_people:$srv_path
242 echo "pushing tag upstream"
243 git push
$remote $tag_current