1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-12 21:58:10 +03:00
samba-mirror/lib/talloc/script/release-script.sh

69 lines
1.5 KiB
Bash
Raw Normal View History

2009-05-05 09:50:19 -04:00
#!/bin/bash
LNAME=talloc
LINCLUDE=talloc.h
2009-05-05 09:50:19 -04:00
if [ "$1" = "" ]; then
echo "Please provide version string, eg: 1.2.0"
exit 1
fi
if [ ! -d "lib/${LNAME}" ]; then
2009-05-05 09:50:19 -04:00
echo "Run this script from the samba base directory."
exit 1
fi
curbranch=`git branch |grep "^*" | tr -d "* "`
2009-05-05 09:50:19 -04:00
version=$1
strver=`echo ${version} | tr "." "-"`
# Checkout the release tag
git branch -f ${LNAME}-release-script-${strver} ${LNAME}-${strver}
2009-05-05 09:50:19 -04:00
if [ ! "$?" = "0" ]; then
echo "Unable to checkout ${LNAME}-${strver} release"
2009-05-05 09:50:19 -04:00
exit 1
fi
function cleanquit {
#Clean up
git checkout $curbranch
git branch -d ${LNAME}-release-script-${strver}
exit $1
}
# NOTE: use cleanquit after this point
git checkout ${LNAME}-release-script-${strver}
2009-05-05 09:50:19 -04:00
# Test configure agrees with us
confver=`grep "^AC_INIT" lib/${LNAME}/configure.ac | tr -d "AC_INIT(${LNAME}, " | tr -d ")"`
2009-05-05 09:50:19 -04:00
if [ ! "$confver" = "$version" ]; then
echo "Wrong version, requested release for ${version}, found ${confver}"
cleanquit 1
fi
# Check exports and signatures are up to date
pushd lib/${LNAME}
./script/abi_checks.sh ${LNAME} ${LINCLUDE}
abicheck=$?
popd
if [ ! "$abicheck" = "0" ]; then
echo "ERROR: ABI Checks produced warnings!"
cleanquit 1
2009-05-05 09:50:19 -04:00
fi
git clean -f -x -d lib/${LNAME}
git clean -f -x -d lib/replace
2009-05-05 09:50:19 -04:00
# Now build tarball
cp -a lib/${LNAME} ${LNAME}-${version}
cp -a lib/replace ${LNAME}-${version}/libreplace
pushd ${LNAME}-${version}
2009-05-05 09:50:19 -04:00
./autogen.sh
popd
tar cvzf ${LNAME}-${version}.tar.gz ${LNAME}-${version}
rm -fr ${LNAME}-${version}
2009-05-05 09:50:19 -04:00
cleanquit 0