5 announce_list
="xorg-announce@lists.freedesktop.org"
6 xorg_list
="xorg@lists.freedesktop.org"
7 dri_list
="dri-devel@lists.sourceforge.net"
8 host_people
=annarchy.freedesktop.org
9 host_xorg
=xorg.freedesktop.org
10 host_dri
=dri.freedesktop.org
17 Usage: `basename $0` [options] <section> <tag_previous> <tag_current>
20 --force force overwritting an existing release
21 --user <name> username on $host_people
22 --help this help message
23 --ignore-local-changes don't abort on uncommitted local changes
24 --remote git remote where the change should be pushed (default "origin")
31 Uncommitted changes found. Did you forget to commit? Aborting.
32 Use --ignore-local-changes to skip this check.
39 case "$tag_previous" in
44 range
="$tag_previous"..
"$tag_current"
48 MD5SUM
=`which md5sum || which gmd5sum`
49 SHA1SUM
=`which sha1sum || which gsha1sum`
51 if [ $section = libdrm
]; then
60 Subject: [ANNOUNCE] $module $version
64 `git log --no-merges "$range" | git shortlog`
68 http://$host/$section_path/$tarbz2
69 MD5: `cd $tarball_dir && $MD5SUM $tarbz2`
70 SHA1: `cd $tarball_dir && $SHA1SUM $tarbz2`
72 http://$host/$section_path/$targz
73 MD5: `cd $tarball_dir && $MD5SUM $targz`
74 SHA1: `cd $tarball_dir && $SHA1SUM $targz`
96 --ignore-local-changes)
106 echo "error: unknown option"
116 echo "error: unknown parameter"
124 # Check for uncommitted/queued changes.
125 if [ "x$ignorechanges" != "x1" ]; then
127 git
diff --quiet HEAD
> /dev
/null
2>&1
128 if [ $?
-ne 0 ]; then
134 # Check if the object has been pushed. Do do so
135 # 1. Check if the current branch has the object. If not, abort.
136 # 2. Check if the object is on $remote/branchname. If not, abort.
137 local_sha
=`git rev-list -1 $tag_current`
138 current_branch
=`git branch | grep "\*" | sed -e "s/\* //"`
140 git rev-list
$current_branch |
grep $local_sha > /dev
/null
141 if [ $?
-eq 1 ]; then
142 echo "Cannot find tag '$tag_current' on current branch. Aborting."
143 echo "Switch to the correct branch and re-run the script."
147 revs
=`git rev-list $remote/$current_branch..$current_branch | wc -l`
148 if [ $revs -ne 0 ]; then
149 git rev-list
$remote/$current_branch..
$current_branch |
grep $local_sha > /dev
/null
151 if [ $?
-ne 1 ]; then
152 echo "$remote/$current_branch doesn't have object $local_sha"
153 echo "for tag '$tag_current'. Did you push branch first? Aborting."
159 tarball_dir
="$(dirname $(find . -name config.status))"
160 module
="${tag_current%-*}"
161 if [ "x$module" = "x$tag_current" ]; then
162 # version-number-only tag.
164 module
=`basename $pwd`
165 version
="$tag_current"
167 # module-and-version style tag
168 version
="${tag_current##*-}"
171 detected_module
=`grep 'PACKAGE = ' $tarball_dir/Makefile | sed 's|PACKAGE = ||'`
172 if [ -f $detected_module-$version.
tar.bz2
]; then
173 module
=$detected_module
176 modulever
=$module-$version
177 tarbz2
="$modulever.tar.bz2"
178 targz
="$modulever.tar.gz"
179 announce
="$tarball_dir/$modulever.announce"
181 echo "checking parameters"
182 if ! [ -f "$tarball_dir/$tarbz2" ] ||
183 ! [ -f "$tarball_dir/$targz" ] ||
184 [ -z "$tag_previous" ] ||
185 [ -z "$section" ]; then
186 echo "error: incorrect parameters!"
191 if [ "$section" = "libdrm" ]; then
192 section_path
="libdrm"
193 srv_path
="/srv/$host_dri/www/$section_path"
195 section_path
="archive/individual/$section"
196 srv_path
="/srv/$host_xorg/$section_path"
199 echo "checking for proper current dir"
200 if ! [ -d .git
]; then
201 echo "error: do this from your git dir, weenie"
205 echo "checking for an existing tag"
206 if ! git tag
-l $tag_current >/dev
/null
; then
207 echo "error: you must tag your release first!"
211 echo "checking for an existing release"
212 if ssh $user$host_people ls $srv_path/$targz >/dev
/null
2>&1 ||
213 ssh $user$host_people ls $srv_path/$tarbz2 >/dev
/null
2>&1; then
214 if [ "x$force" = "xyes" ]; then
215 echo "warning: overriding released file ... here be dragons."
217 echo "error: file already exists!"
222 echo "generating announce mail template, remember to sign it"
223 gen_announce_mail
>$announce
224 echo " at: $announce"
226 echo "installing release into server"
227 scp
$tarball_dir/$targz $tarball_dir/$tarbz2 $user$host_people:$srv_path
229 echo "pushing tag upstream"
230 git push
$remote $tag_current