From c982b32734cdac80f2375e64b6c242b307fff1b2 Mon Sep 17 00:00:00 2001 From: zhanghaochen Date: Thu, 30 May 2024 10:38:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=89=88=E6=9C=AC=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=87=86=E5=88=99=E4=BF=AE=E6=94=B9=EF=BC=9A=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=9C=80=E6=96=B0commitID=EF=BC=9B=E8=8B=A5=E5=AD=98?= =?UTF-8?q?=E5=9C=A8tag=EF=BC=8C=E8=8E=B7=E5=8F=96tag=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=9B=E8=8B=A5=E4=B8=8D=E5=AD=98=E5=9C=A8tag=EF=BC=8Ctag?= =?UTF-8?q?=E4=B8=BANULL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index b90a08f..4ea32d4 100755 --- a/build.sh +++ b/build.sh @@ -27,10 +27,18 @@ test_option="no" case_id=21 ape_core_mask=0xf platform_build_data=0x20230926 -spu_version=`git log -1 --format="%H"` -spu_tag=`git tag | sed -n '$p'` +spu_version=`git log --decorate -1 | sed -n '1p' | awk '{print substr($2,0)}'` spu_build_date=`date +"%Y-%m-%d-%H:%M:%S"` +#判断tag是否存在 +if [ -z `git log --decorate -1 | grep -oP '(?<=tag: ).*'` ] + then + spu_tag="NULL"; + else + spu_tag=`git log --decorate -1 | grep -oP '(?<=tag: ).*'` + spu_tag=${spu_tag%?} +fi + while [[ "$#" > 0 ]]; do case $1 in --debug) debug_option="yes"; shift;;