s3/docs: Fix typos.
[Samba/gebeck_regimport.git] / lib / talloc / release-script.sh
blob7ec47b7ee198b20d8f4b78ee18c2151af260e74c
1 #!/bin/bash
3 if [ "$1" = "" ]; then
4 echo "Please provide version string, eg: 1.2.0"
5 exit 1
6 fi
8 if [ ! -d "lib/talloc" ]; then
9 echo "Run this script from the samba base directory."
10 exit 1
13 curbranch=`git-branch |grep "^*" | tr -d "* "`
15 version=$1
16 strver=`echo ${version} | tr "." "-"`
18 # Checkout the release tag
19 git branch -f talloc-release-script-${strver} talloc-${strver}
20 if [ ! "$?" = "0" ]; then
21 echo "Unable to checkout talloc-${strver} release"
22 exit 1
25 git checkout talloc-release-script-${strver}
27 # Test configure agrees with us
28 confver=`grep "^AC_INIT" lib/talloc/configure.ac | tr -d "AC_INIT(talloc, " | tr -d ")"`
29 if [ ! "$confver" = "$version" ]; then
30 echo "Wrong version, requested release for ${version}, found ${confver}"
31 exit 1
34 # Now build tarball
35 cp -a lib/talloc talloc-${version}
36 cp -a lib/replace talloc-${version}/libreplace
37 pushd talloc-${version}
38 ./autogen.sh
39 popd
40 tar cvzf talloc-${version}.tar.gz talloc-${version}
41 rm -fr talloc-${version}
43 #Clean up
44 git checkout $curbranch
45 git branch -d talloc-release-script-${strver}