From 249072f280510ec7e86960528987265ffa60abd7 Mon Sep 17 00:00:00 2001 From: Sukru Senli Date: Tue, 14 Sep 2021 19:47:38 +0200 Subject: [PATCH] iop: genconfig: update TARGET_VERSION generation for non-tagged commits, TARGET_VERSION becomes _ --- iop/scripts/genconfig.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iop/scripts/genconfig.sh b/iop/scripts/genconfig.sh index da5288018..4a8847783 100755 --- a/iop/scripts/genconfig.sh +++ b/iop/scripts/genconfig.sh @@ -424,8 +424,11 @@ function genconfig { # Set target version local GIT_TAG=$(git describe --abbrev=0 --tags) - echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config - echo "CONFIG_VERSION_CODE=\"${GIT_TAG}\"" >> .config + local GIT_REV=$(git rev-parse --short HEAD) + local GIT_VER="$GIT_TAG" + git describe --contains $GIT_REV >/dev/null 2>&1 || GIT_VER="${GIT_TAG}_${GIT_REV}" + echo "CONFIG_TARGET_VERSION=\"${GIT_VER}\"" >> .config + echo "CONFIG_VERSION_CODE=\"${GIT_VER}\"" >> .config echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config # Enable Package source tree override if selected