treewide: remove "v" prefix from versions
A semantic version does not have a "v" prefix.
https://semver.org/#is-v123-a-semantic-version
Change-Id: I95aa2014ba3330d33428e57e5f354eabfe6d1423
Reviewed-on: https://review.monogon.dev/c/monogon/+/4170
Tested-by: Jenkins CI
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
diff --git a/build/print-workspace-status.py b/build/print-workspace-status.py
index f03b244..992a8fc 100755
--- a/build/print-workspace-status.py
+++ b/build/print-workspace-status.py
@@ -103,7 +103,7 @@
# tags. All prerelease identifies will be appended by this code.
if not re.match(r"^v[0-9]+\.[0-9]+\.[0-9]+$", version):
return None
- return Version(product, version, [])
+ return Version(product, version[1:], [])
# Is this a release build of the given product?
@@ -148,8 +148,8 @@
break
if version is None:
- # This product never had a release! Use v0.0.0 as a fallback.
- version = Version(product, "v0.0.0", [])
+ # This product never had a release! Use 0.0.0 as a fallback.
+ version = Version(product, "0.0.0", [])
if not args.nostamp:
# ... and count the number of all commits ever to use as the devXXX
# prerelease identifier.
diff --git a/metropolis/node/core/update/update.go b/metropolis/node/core/update/update.go
index f241e05..6e41768 100644
--- a/metropolis/node/core/update/update.go
+++ b/metropolis/node/core/update/update.go
@@ -284,7 +284,7 @@
RetryNotify: func(err error, d time.Duration) {
s.Logger.Warningf("Error while fetching OS image, retrying in %v: %v", d, err)
},
- UserAgent: "MonogonOS/" + strings.TrimPrefix(version.Semver(mversion.Version), "v"),
+ UserAgent: "MonogonOS/" + version.Semver(mversion.Version),
Scheme: imageRef.Scheme,
Host: imageRef.Host,
Repository: imageRef.Repository,
diff --git a/version/stampgo/main.go b/version/stampgo/main.go
index 3f8502c..439dca5 100644
--- a/version/stampgo/main.go
+++ b/version/stampgo/main.go
@@ -106,10 +106,6 @@
productVersion := values["STABLE_MONOGON_"+flagProduct+"_version"]
if productVersion != "" {
- if productVersion[0] != 'v' {
- log.Fatalf("Invalid %s version %q: does not start with v", flagProduct, productVersion)
- }
- productVersion = productVersion[1:]
v, err := semver.NewVersion(productVersion)
if err != nil {
log.Fatalf("Invalid %s version %q: %v", flagProduct, productVersion, err)
diff --git a/version/version.go b/version/version.go
index 2929684..05fe630 100644
--- a/version/version.go
+++ b/version/version.go
@@ -23,7 +23,7 @@
// Semver converts a spec.Version proto message into a SemVer 2.0.0 compatible
// string.
func Semver(v *spec.Version) string {
- ver := "v" + Release(v.Release)
+ ver := Release(v.Release)
var prerelease []string
if git := v.GitInformation; git != nil {
if n := git.CommitsSinceRelease; n != 0 {