From b37b19f34460936d2c990305e638f5abf3fffe5a Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Thu, 7 Aug 2014 14:55:13 +0200 Subject: [PATCH] Version handling for v0.9+ --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 808e400f2..0fd7076aa 100644 --- a/main.go +++ b/main.go @@ -337,11 +337,14 @@ func ensureDir(dir string, mode int) { } } -var vRe = regexp.MustCompile(`^(v\d+\.\d+\.\d+)-.+`) +var vRe = regexp.MustCompile(`^(v\d+\.\d+\.\d+(?:-[a-z]\w+)?)[+\.-]`) // transformVersion returns a version number formatted correctly, with all // development versions aggregated into one. func transformVersion(v string) string { + if v == "unknown-dev" { + return v + } if !strings.HasPrefix(v, "v") { v = "v" + v }