]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix the package version _on_ prerelease tags 10382/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 31 Mar 2021 14:04:27 +0000 (16:04 +0200)
committerOtto <otto.moerbeek@open-xchange.com>
Mon, 10 May 2021 13:52:46 +0000 (15:52 +0200)
Closes #9842

(cherry picked from commit 121a191d5ecd24818053a39013608e424a36142a)

builder-support/gen-version

index 4411794d7244775ea3ff958d686fabe49db21d1a..c2a56b451bef4ffbce8261aaa9127e0bed99f0c8 100755 (executable)
@@ -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)"