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
20 Usage: `basename $0` [options] [<section> [<tag_previous> [<tag_current>]]]
21 or: `basename $0` [options] <section> initial [<tag_current>]
24 --force force overwritting an existing release
25 --user <name> username on $host_people
26 --help this help message
27 --ignore-local-changes don't abort on uncommitted local changes
28 --remote git remote where the change should be pushed (default "origin")
29 --moduleset jhbuild moduleset to update with relase info
36 Uncommitted changes found. Did you forget to commit? Aborting.
37 Use --ignore-local-changes to skip this check.
44 case "$tag_previous" in
49 range
="$tag_previous"..
"$tag_current"
53 MD5SUM
=`which md5sum || which gmd5sum`
54 SHA1SUM
=`which sha1sum || which gsha1sum`
55 SHA256SUM
=`which sha256sum || which gsha256sum`
57 if [ "$section" = "libdrm" ]; then
60 elif [ "$section" = "xkeyboard-config" ]; then
69 Subject: [ANNOUNCE] $module $version
73 `git log --no-merges "$range" | git shortlog`
77 http://$host/$section_path/$tarbz2
78 MD5: `cd $tarball_dir && $MD5SUM $tarbz2`
79 SHA1: `cd $tarball_dir && $SHA1SUM $tarbz2`
80 SHA256: `cd $tarball_dir && $SHA256SUM $tarbz2`
82 http://$host/$section_path/$targz
83 MD5: `cd $tarball_dir && $MD5SUM $targz`
84 SHA1: `cd $tarball_dir && $SHA1SUM $targz`
85 SHA256: `cd $tarball_dir && $SHA256SUM $targz`
107 --ignore-local-changes)
122 echo "error: unknown option"
138 echo "error: unknown parameter"
147 # Attempt to auto-detect values if not specified
150 if [ -z "$section" ]; then
151 section
="$(git config --get "remote.
${remote}.url
" | sed -n 's%^.*freedesktop.org/git/xorg/\([^/]*\).*$%\1%p')"
152 echo "Detected section: $section"
156 if [ -z "$tag_previous" ]; then
157 tag_previous
="$(git describe --abbrev=0 HEAD^)"
158 echo "Detected previous tag: $tag_previous"
162 if [ -z "$tag_current" ]; then
163 tag_current
="$(git describe --abbrev=0)"
164 echo "Detected current tag: $tag_current"
168 if [ "${auto_detected}" = "yes" ] ; then
169 echo -n "Proceed? (Y/N) "
170 while read answer
; do
174 *) echo -n "Incorrect Response. Proceed? (Y/N) " ; continue ;;
179 # Check for required values
180 if [ -z "$section" ]; then
181 echo "error: section not found."
186 if [ -z "$tag_previous" ] ; then
187 echo "error: previous tag not found."
192 if [ -z "$tag_current" ] ; then
193 echo "error: current tag not found."
198 if [ "x$tag_previous" = "x$tag_current" ] ; then
199 echo "current tag ($tag_current) must be different than"
200 echo "previous tag ($tag_previous)"
204 # Check for uncommitted/queued changes.
205 if [ "x$ignorechanges" != "x1" ]; then
207 git
diff --quiet HEAD
> /dev
/null
2>&1
208 if [ $?
-ne 0 ]; then
214 # Check if the object has been pushed. Do do so
215 # 1. Check if the current branch has the object. If not, abort.
216 # 2. Check if the object is on $remote/branchname. If not, abort.
217 local_sha
=`git rev-list -1 $tag_current`
218 current_branch
=`git branch | grep "\*" | sed -e "s/\* //"`
220 git rev-list
$current_branch |
grep $local_sha > /dev
/null
221 if [ $?
-eq 1 ]; then
222 echo "Cannot find tag '$tag_current' on current branch. Aborting."
223 echo "Switch to the correct branch and re-run the script."
227 revs
=`git rev-list $remote/$current_branch..$current_branch | wc -l`
228 if [ $revs -ne 0 ]; then
229 git rev-list
$remote/$current_branch..
$current_branch |
grep $local_sha > /dev
/null
231 if [ $?
-ne 1 ]; then
232 echo "$remote/$current_branch doesn't have object $local_sha"
233 echo "for tag '$tag_current'. Did you push branch first? Aborting."
239 tarball_dir
="$(dirname $(find . -name config.status))"
240 module
="${tag_current%-*}"
241 if [ "x$module" = "x$tag_current" ]; then
242 # version-number-only tag.
244 module
=`basename $pwd`
245 version
="$tag_current"
247 # module-and-version style tag
248 version
="${tag_current##*-}"
251 detected_module
=`grep 'PACKAGE = ' $tarball_dir/Makefile | sed 's|PACKAGE = ||'`
252 if [ -f $detected_module-$version.
tar.bz2
]; then
253 module
=$detected_module
256 modulever
=$module-$version
257 tarbz2
="$modulever.tar.bz2"
258 targz
="$modulever.tar.gz"
259 announce
="$tarball_dir/$modulever.announce"
261 echo "checking parameters"
262 if ! [ -f "$tarball_dir/$tarbz2" ] ||
263 ! [ -f "$tarball_dir/$targz" ]; then
264 echo "error: tarballs not found. Did you run make dist?"
269 if [ -n "$moduleset" ]; then
270 echo "checking for moduleset"
271 if ! [ -w "$moduleset" ]; then
272 echo "moduleset $moduleset does not exist or is not writable"
277 if [ "$section" = "libdrm" ]; then
278 section_path
="libdrm"
279 srv_path
="/srv/$host_dri/www/$section_path"
280 elif [ "$section" = "xkeyboard-config" ]; then
281 section_path
="archive/individual/data"
282 srv_path
="/srv/$host_xorg/$section_path"
284 section_path
="archive/individual/$section"
285 srv_path
="/srv/$host_xorg/$section_path"
288 echo "checking for proper current dir"
289 if ! [ -d .git
]; then
290 echo "error: do this from your git dir, weenie"
294 echo "checking for an existing tag"
295 if ! git tag
-l $tag_current >/dev
/null
; then
296 echo "error: you must tag your release first!"
300 echo "checking for an existing release"
301 if ssh $user$host_people ls $srv_path/$targz >/dev
/null
2>&1 ||
302 ssh $user$host_people ls $srv_path/$tarbz2 >/dev
/null
2>&1; then
303 if [ "x$force" = "xyes" ]; then
304 echo "warning: overriding released file ... here be dragons."
306 echo "error: file already exists!"
311 echo "generating announce mail template, remember to sign it"
312 gen_announce_mail
>$announce
313 echo " at: $announce"
315 if [ -n "$moduleset" ]; then
316 echo "updating moduleset $moduleset"
317 real_script_path
=`readlink -f "$0"`
318 modulardir
=`dirname "$real_script_path"`
319 sha1sum=`cd $tarball_dir && $SHA1SUM $targz | cut -d' ' -f1`
320 $modulardir/update-moduleset.sh
$moduleset $sha1sum $targz
323 echo "installing release into server"
324 scp
$tarball_dir/$targz $tarball_dir/$tarbz2 $user$host_people:$srv_path
326 echo "pushing tag upstream"
327 git push
$remote $tag_current