Fixup version release detection

pull/4245/head
Matt Keeler 7 years ago
parent ca1a0619bd
commit b739bbfefe

@ -138,6 +138,7 @@ function parse_version {
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"
do
@ -151,6 +152,7 @@ function parse_version {
done
done
# override the version from source with the value of the GIT_DESCRIBE env var if present
if test -n "${git_version}"
then
@ -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}"

Loading…
Cancel
Save