Merge branch 'dev_ck_v2.1_feature_enhancement#1932#' into 'dev_ck_v2.1'

fix: 解决版本信息获取编译报错,兼容不同格式tag处理

See merge request ucp/driver/ucp4008_platform_spu!120
This commit is contained in:
Weihua Li 2024-06-18 06:15:01 +00:00
commit ff745c402c

View File

@ -31,11 +31,11 @@ spu_version=`git log --decorate -1 | sed -n '1p' | awk '{print substr($2,0)}'`
spu_build_date=`date +"%Y-%m-%d-%H:%M:%S"` spu_build_date=`date +"%Y-%m-%d-%H:%M:%S"`
#判断tag是否存在 #判断tag是否存在
if [ -z `git log --decorate -1 | grep -oP '(?<=tag: ).*'` ] if [ -z `git log --decorate -1 | grep -oP '(?<=tag: ).*' | awk '{print substr($1,0)}'` ]
then then
spu_tag="NULL"; spu_tag="NULL";
else else
spu_tag=`git log --decorate -1 | grep -oP '(?<=tag: ).*'` spu_tag=`git log --decorate -1 | grep -oP '(?<=tag: ).*' | awk '{print substr($1,0)}'`
spu_tag=${spu_tag%?} spu_tag=${spu_tag%?}
fi fi