s3: Fix a winbind race leading to 100% CPU
[Samba.git] / script / librelease.sh
blobb2bc9e712a17e9d8bd4f785d55ded853e66e8859
1 #!/bin/bash
2 # make a release of a Samba library
4 GPG_USER='Samba Library Distribution Key <samba-bugs@samba.org>'
6 if [ ! -d ".git" ]; then
7 echo "Run this script from the top-level directory in the"
8 echo "repository"
9 exit 1
12 if [ $# -lt 1 ]; then
13 echo "Usage: librelease.sh <LIBNAMES>"
14 exit 1
18 release_lib() {
19 lib="$1"
20 srcdir="$2"
22 pushd $srcdir
24 echo "Releasing library $lib"
26 echo "building release tarball"
27 tgzname=$(make dist 2>&1 | grep ^Created | cut -d' ' -f2)
28 [ -f "$tgzname" ] || {
29 echo "Failed to create tarball"
30 exit 1
32 tarname=$(basename $tgzname .gz)
33 echo "Tarball: $tarname"
34 gunzip -f $tgzname || exit 1
35 [ -f "$tarname" ] || {
36 echo "Failed to decompress tarball $tarname"
37 exit 1
40 tagname=$(basename $tarname .tar | sed s/[\.]/-/g)
41 echo "tagging as $tagname"
42 git tag -s "$tagname" -m "$lib: tag release $tagname"
44 echo "signing"
45 rm -f "$tarname.asc"
46 gpg -u "$GPG_USER" --detach-sign --armor $tarname || exit 1
47 [ -f "$tarname.asc" ] || {
48 echo "Failed to create signature $tarname.asc"
49 exit 1
51 echo "compressing"
52 gzip -f -9 $tarname
53 [ -f "$tgzname" ] || {
54 echo "Failed to compress $tgzname"
55 exit 1
58 echo "Transferring"
59 rsync -Pav $tarname.asc $tgzname master.samba.org:~ftp/pub/$lib/
61 popd
64 for lib in $*; do
65 case $lib in
66 talloc | tdb | tevent)
67 release_lib $lib "lib/$lib"
69 ldb)
70 release_lib $lib "source4/lib/$lib"
73 echo "Unknown library $lib"
74 exit 1
75 esac
76 done