build: Replace hypen in -dirty for version (ref #6758) (#6858)

This commit is contained in:
Simon Frei 2020-07-28 10:58:01 +02:00 committed by GitHub
parent 08e0f938a9
commit 21dd9d6b43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -874,7 +874,10 @@ func getGitVersion() (string, error) {
}
v0 := string(bs)
versionRe := regexp.MustCompile(`-([0-9]{1,3}-g[0-9a-f]{5,10})`)
// To be more semantic-versionish and ensure proper ordering in our
// upgrade process, we make sure there's only one hypen in the version.
versionRe := regexp.MustCompile(`-([0-9]{1,3}-g[0-9a-f]{5,10}(-dirty)?)`)
if m := versionRe.FindStringSubmatch(vcur); len(m) > 0 {
suffix := strings.ReplaceAll(m[1], "-", ".")