Browse Source

Fixup version release detection

pull/4245/head
Matt Keeler 7 years ago
parent
commit
b739bbfefe
  1. 12
      build-support/functions/10-util.sh

12
build-support/functions/10-util.sh

@ -137,6 +137,7 @@ function parse_version {
# Get the main version out of the source file # Get the main version out of the source file
version_main=$(awk '$1 == "Version" && $2 == "=" { gsub(/"/, "", $3); print $3 }' < ${vfile}) version_main=$(awk '$1 == "Version" && $2 == "=" { gsub(/"/, "", $3); print $3 }' < ${vfile})
release_main=$(awk '$1 == "VersionPrerelease" && $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 # try to determine the version if we have build tags
for tag in "$GOTAGS" for tag in "$GOTAGS"
@ -150,6 +151,7 @@ function parse_version {
fi fi
done done
done done
# override the version from source with the value of the GIT_DESCRIBE env var if present # override the version from source with the value of the GIT_DESCRIBE env var if present
if test -n "${git_version}" if test -n "${git_version}"
@ -162,19 +164,19 @@ function parse_version {
if is_set "${include_release}" if is_set "${include_release}"
then then
# Get the release version out of the source file # 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 # When no GIT_DESCRIBE env var is present and no release is in the source then we
# are definitely in dev mode # are definitely in dev mode
if test -z "${git_version}" -a -z "$release" if test -z "${git_version}" -a -z "${rel_ver}"
then then
release="dev" rel_ver="dev"
fi fi
# Add the release to the version # Add the release to the version
if test -n "$release" if test -n "${rel_ver}"
then then
version="${version}-${release}" version="${version}-${rel_ver}"
# add the git commit to the version # add the git commit to the version
if test -n "${git_commit}" if test -n "${git_commit}"

Loading…
Cancel
Save