From: Pieter Lexis Date: Wed, 31 Mar 2021 14:04:27 +0000 (+0200) Subject: Fix the package version _on_ prerelease tags X-Git-Tag: dnsdist-1.6.0-rc1~35^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10252%2Fhead;p=thirdparty%2Fpdns.git Fix the package version _on_ prerelease tags Closes #9842 --- diff --git a/builder-support/gen-version b/builder-support/gen-version index 4411794d72..c2a56b451b 100755 --- a/builder-support/gen-version +++ b/builder-support/gen-version @@ -37,6 +37,9 @@ if [ ! -z "$(git rev-parse --abbrev-ref HEAD 2> /dev/null)" ]; then LAST_TAG="$(echo ${GIT_VERSION} | cut -d- -f1-2)" COMMITS_SINCE_TAG="$(echo ${GIT_VERSION} | cut -d- -f3)" GIT_HASH="$(echo ${GIT_VERSION} | cut -d- -f4)" + elif [ $(echo ${GIT_VERSION} | awk -F"-" '{print NF-1}') = '1' ]; then + # Exactly on a pre-release + LAST_TAG="$(echo ${GIT_VERSION} | cut -d- -f1-2)" else LAST_TAG="$(echo ${GIT_VERSION} | cut -d- -f1)" COMMITS_SINCE_TAG="$(echo ${GIT_VERSION} | cut -d- -f2)"