1 Star 0 Fork 0

tonycoming/calamari

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
get-versions.sh 874 Bytes
一键复制 编辑 原始数据 按行查看 历史
Dan Mick 提交于 2014-02-28 17:21 . Makefile: add versioning
#!/bin/bash
#
# Output version, revision for package builds derived from git.
#
# -r: change revision to be suitable for rpm
# VERSION: output X only
# REVISION: output Y only
# no more args: output VERSION=X REVISION=Y suitable for eval
#
RPM='n'
if [ "$1" == "-r" ] ; then RPM='y' ; shift ; fi
# GITVER is the version from the current git branch, less the first char ('v')
GITVER=$(git describe | cut -c 2-)
# if GITVER contains a '-', separate at the first one into version and revision
if [[ $GITVER == *-* ]]; then
VERSION=$(echo $GITVER | sed 's/-.*//')
REVISION=$(echo $GITVER | sed 's/'${VERSION}'-//')
if [ $RPM == 'y' ] ; then
REVISION=$(echo $REVISION | sed 's/-/_/g')
fi
else
VERSION=$GITVER
REVISION="0"
fi
case "$1" in
VERSION) echo $VERSION; exit ;;
REVISION) echo $REVISION; exit ;;
*) echo "VERSION=$VERSION REVISION=$REVISION"; exit ;;
esac
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/tonycoming/calamari.git
git@gitee.com:tonycoming/calamari.git
tonycoming
calamari
calamari
master

搜索帮助