18 Star 1 Fork 4

openKylin/gpac

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
check_revision.sh 998 Bytes
一键复制 编辑 原始数据 按行查看 历史
周淦清 提交于 2024-04-25 18:54 . Import Upstream version 2.0.0+dfsg1
#!/bin/sh
version="`grep '#define GPAC_VERSION ' \"./include/gpac/version.h\" | cut -d '"' -f 2`"
#check for .git - if so use nb commits till last tag for rev + commit id
if [ -d ".git" ]; then
TAG=$(git describe --tags --abbrev=0 2>>gtmp)
VERSION=$(echo `git describe --tags --long 2>>gtmp || echo "UNKNOWN"` | sed "s/^$TAG-//")
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>>gtmp || echo "UNKNOWN")
revision="$VERSION-$BRANCH"
rm gtmp
echo "#define GPAC_GIT_REVISION \"$revision\"" > htmp
if ! diff htmp ./include/gpac/revision.h > /dev/null ; then
echo "revision has changed"
rm ./include/gpac/revision.h
mv htmp ./include/gpac/revision.h
else
rm htmp
fi
else
#otherwise, check id -DEV is in the version name. If not consider this a release
if [ ! -e ".include/gpac/revision.h" ]; then
if [[ "$version" != *"-DEV"* ]]; then
echo "#define GPAC_GIT_REVISION \"release\"" > ./include/gpac/revision.h
else
echo "#define GPAC_GIT_REVISION \"UNKNOWN_REV\"" > ./include/gpac/revision.h
fi
fi
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openkylin/gpac.git
git@gitee.com:openkylin/gpac.git
openkylin
gpac
gpac
tmp

搜索帮助

D67c1975 1850385 1daf7b77 1850385