summaryrefslogtreecommitdiff
path: root/hack
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2021-02-18 15:16:48 -0500
committerChris Evich <cevich@redhat.com>2021-04-12 10:01:03 -0400
commite296b6023ec6b02747943a9c3e1a5935e1f2e705 (patch)
tree1de04c652cbcb5941fd0fa21fe6fc04fcdbe6d46 /hack
parentde8243453d47648df0fa290592c9f1b33b384dd9 (diff)
downloadpodman-e296b6023ec6b02747943a9c3e1a5935e1f2e705.tar.gz
podman-e296b6023ec6b02747943a9c3e1a5935e1f2e705.tar.bz2
podman-e296b6023ec6b02747943a9c3e1a5935e1f2e705.zip
Fix incorrect version number output
Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'hack')
-rwxr-xr-xhack/get_release_info.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/hack/get_release_info.sh b/hack/get_release_info.sh
index 69cf8cd57..40c473246 100755
--- a/hack/get_release_info.sh
+++ b/hack/get_release_info.sh
@@ -14,11 +14,19 @@ valid_args() {
cut -d '*' -f 1
}
+# `git describe` does not reliably produce a useful version number.
+scrape_version() {
+ local versionfile='version/version.go'
+ local version_line=$(grep -m 1 'var Version =' $versionfile)
+ local version_string=$(cut -d '"' -f 2 <<<"$version_line")
+ echo "$version_string" | tr -d '[:space:]'
+}
+
unset OUTPUT
case "$1" in
# Wild-card suffix needed by valid_args() e.g. possible bad grep of "$(echo $FOO)"
VERSION*)
- OUTPUT="${CIRRUS_TAG:-$(git fetch --tags && git describe HEAD 2> /dev/null)}"
+ OUTPUT="${CIRRUS_TAG:-$(scrape_version)}"
;;
NUMBER*)
OUTPUT="$($0 VERSION | sed 's/-.*//')"