6 Star 22 Fork 36

Gitee 极速下载/gpdb

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/greenplum-db/gpdb
克隆/下载
getversion 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/env bash
# Make sure we're running from the root git repository, not whatever submodule
# we could have been called from.
pushd $(dirname "$0") > /dev/null
VERSION=$(perl -e 'while(<>){print $1 if (/^PACKAGE_VERSION='\''(.+)'\''$/)}' < configure)
BUILDNUMBER=dev
# Call git describe, and convert it to a semi-semantic version, like
# 5.0.0-alpha.0+dev.52.g123abc
generate_dev_version() {
git describe | perl -pe 's/(.*)-([0-9]*)-(g[0-9a-f]*)/\1+dev.\2.\3/'
}
# If we are in a Git repository and have git installed, build the version
# string using the latest tag in case it's reachable
if type git >/dev/null 2>&1 && [ -d '.git' ] ; then
# Check for tag reachability, in case of shallow clones we might not
# be able to use git describe since the commit which was tagged is
# unreachable even if we have pulled the tags. If we can reach it,
# overwrite the VERSION from autoconf with the output, else append
# HEAD commit info
if git describe >/dev/null 2>&1 ; then
VERSION=$(generate_dev_version)
else
VERSION+=+
VERSION+=$(git rev-parse --short HEAD)
fi
# If not a git repository and VERSION file exists, use version string from file.
elif [[ -s ./VERSION ]]; then
VERSION=$(awk -F' build ' '{print $1}' ./VERSION)
BUILDNUMBER=$(awk -F' build ' '{print $2}' ./VERSION)
fi
FLAG="${1:-noflag}"
if [ "$FLAG" = '--short' ] ; then
echo "${VERSION}"
else
if [[ ${BUILDNUMBER} = 'dev' && -f BUILD_NUMBER ]] ; then
BUILDNUMBER=`cat BUILD_NUMBER`
fi
echo "${VERSION} build ${BUILDNUMBER}"
fi
popd > /dev/null
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/mirrors/gpdb.git
[email protected]:mirrors/gpdb.git
mirrors
gpdb
gpdb
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385