From b739bbfefe71cadac232ae4a9a31b712e705cf1b Mon Sep 17 00:00:00 2001 From: Matt Keeler Date: Mon, 18 Jun 2018 11:57:35 -0400 Subject: [PATCH] Fixup version release detection --- build-support/functions/10-util.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build-support/functions/10-util.sh b/build-support/functions/10-util.sh index 03a94de5f1..d4d5d79562 100644 --- a/build-support/functions/10-util.sh +++ b/build-support/functions/10-util.sh @@ -137,6 +137,7 @@ function parse_version { # Get the main version out of the source file version_main=$(awk '$1 == "Version" && $2 == "=" { gsub(/"/, "", $3); print $3 }' < ${vfile}) release_main=$(awk '$1 == "VersionPrerelease" && $2 == "=" { gsub(/"/, "", $3); print $3 }' < ${vfile}) + # try to determine the version if we have build tags for tag in "$GOTAGS" @@ -150,6 +151,7 @@ function parse_version { fi done done + # override the version from source with the value of the GIT_DESCRIBE env var if present if test -n "${git_version}" @@ -162,19 +164,19 @@ function parse_version { if is_set "${include_release}" then # Get the release version out of the source file - release="${release_main}" + rel_ver="${release_main}" # When no GIT_DESCRIBE env var is present and no release is in the source then we # are definitely in dev mode - if test -z "${git_version}" -a -z "$release" + if test -z "${git_version}" -a -z "${rel_ver}" then - release="dev" + rel_ver="dev" fi # Add the release to the version - if test -n "$release" + if test -n "${rel_ver}" then - version="${version}-${release}" + version="${version}-${rel_ver}" # add the git commit to the version if test -n "${git_commit}"