cmd/*, lib/build: Set correct LongVersion (fixes #5993) (#5997)

The relay and discosrv didn't use the new lib/build package, now they
do. Conversely the lib/build package wasn't aware there might be other
users and hard coded the program name - now it's set by the build
script
This commit is contained in:
Jakob Borg
2019-10-07 13:30:25 +02:00
committed by GitHub
parent 999d4a0e23
commit 67b8ef1f3e
7 changed files with 65 additions and 113 deletions

View File

@@ -18,10 +18,11 @@ import (
var (
// Injected by build script
Program = "syncthing"
Version = "unknown-dev"
Host = "unknown" // Set by build script
User = "unknown" // Set by build script
Stamp = "0" // Set by build script
Host = "unknown"
User = "unknown"
Stamp = "0"
// Static
Codename = "Fermium Flea"
@@ -73,7 +74,7 @@ func setBuildData() {
Date = time.Unix(int64(stamp), 0)
date := Date.UTC().Format("2006-01-02 15:04:05 MST")
LongVersion = fmt.Sprintf(`syncthing %s "%s" (%s %s-%s) %s@%s %s`, Version, Codename, runtime.Version(), runtime.GOOS, runtime.GOARCH, User, Host, date)
LongVersion = fmt.Sprintf(`%s %s "%s" (%s %s-%s) %s@%s %s`, Program, Version, Codename, runtime.Version(), runtime.GOOS, runtime.GOARCH, User, Host, date)
if len(Tags) > 0 {
LongVersion = fmt.Sprintf("%s [%s]", LongVersion, strings.Join(Tags, ", "))