Skip to content

Commit d778ef5

Browse files
committed
hack/scripts: strip "v" prefix from version strings
The version generation script was including the 'v' prefix from git tags in generated version strings, which is inconsistent with our current packages. - Tagged releases produce clean version numbers (e.g., "1.0.0" instead of "v1.0.0") - Nightly builds generate pseudo-versions without 'v' prefix Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
1 parent d926568 commit d778ef5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hack/scripts/gen-ver.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ if [ -z "$srcdir" ]; then
2121
fi
2222

2323
version=$(git -C "${srcdir}" describe --match 'v[0-9]*' --always --tags)
24+
version=${version#v}
2425
commit="$(git --git-dir "${srcdir}/.git" rev-parse HEAD)"
2526
commitShort=${commit:0:7}
2627

@@ -71,8 +72,8 @@ if [[ "$NIGHTLY_BUILD" == "1" ]] || [[ "$version" == *-dev ]] || [[ -z "$(git -C
7172
gitUnix="$(git --git-dir "${srcdir}/.git" log -1 --pretty='%ct')"
7273
gitDate="$(TZ=UTC date -u --date "@$gitUnix" +'%Y%m%d%H%M%S')"
7374
# generated version is now something like 'v0.0.0-20180719213702-cd5e2db'
74-
version="v0.0.0-${gitDate}-${commitShort}" # (using hyphens)
75-
pkgVersion="v0.0.0~${gitDate}.${commitShort}" # (using tilde and periods)
75+
version="0.0.0-${gitDate}-${commitShort}" # (using hyphens)
76+
pkgVersion="0.0.0~${gitDate}.${commitShort}" # (using tilde and periods)
7677
rpmRelease=0
7778
fi
7879

0 commit comments

Comments
 (0)