Fetch the repository succeeded.
#!/bin/bash
VERSION_MAJOR=`cat CMakeLists.txt|grep VERSION_MAJOR | head -n 1 | grep set | head -n 1 |cut -f 2 -d " "|cut -f 1 -d ")"`
VERSION_MINOR=`cat CMakeLists.txt|grep VERSION_MINOR | head -n 1 | grep set | head -n 1 |cut -f 2 -d " "|cut -f 1 -d ")"`
VERSION_DEBUG=`cat CMakeLists.txt|grep VERSION_DEBUG | head -n 1 | grep set | head -n 1 |cut -f 2 -d " "|cut -f 1 -d ")"`
VERSION=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_DEBUG
LIBNAME=jrtplib
TMPDIR=`tempfile`
CURDIR=`pwd`
rm -r $TMPDIR
if ! mkdir $TMPDIR ; then
echo "Couldn't create temporary directory"
exit -1
fi
cd $TMPDIR
TMPDIR=`pwd` # Get the full path
cd $CURDIR
if ! git archive --format tar --prefix=${LIBNAME}-${VERSION}/ HEAD | (cd $TMPDIR && tar xf -) ; then
echo "Couldn't archive repository"
exit -1
fi
cd $TMPDIR/${LIBNAME}-${VERSION}
rm -f `find . -name ".git*"`
rm -f builddist.sh
rm -rf sphinxdoc
rm -f TODO
rm -rf nodist
rm -f aboutrfc3550.txt
cd ..
if ! tar cfz ${LIBNAME}-${VERSION}.tar.gz ${LIBNAME}-${VERSION}/ ; then
echo "Couldn't create archive"
exit -1
fi
if ! tar cfj ${LIBNAME}-${VERSION}.tar.bz2 ${LIBNAME}-${VERSION}/ ; then
echo "Couldn't create archive"
exit -1
fi
if ! zip ${LIBNAME}-${VERSION}.zip `find ${LIBNAME}-${VERSION}/` ; then
echo "Couldn't create archive"
exit -1
fi
mv $TMPDIR $CURDIR/
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。