PKGBUILDs/community/consul/fix-build-version-info.patch
2019-06-29 20:32:55 +00:00

74 lines
2.3 KiB
Diff

--- a/version/version.go 2018-06-26 09:57:33.703932696 +0200
+++ b/version/version.go 2018-06-26 09:59:05.986536238 +0200
@@ -1,7 +1,6 @@
package version
import (
- "fmt"
"strings"
)
@@ -27,24 +26,6 @@ var (
// for displaying to humans.
func GetHumanVersion() string {
version := Version
- if GitDescribe != "" {
- version = GitDescribe
- }
-
- release := VersionPrerelease
- if GitDescribe == "" && release == "" {
- release = "dev"
- }
-
- if release != "" {
- if !strings.HasSuffix(version, "-"+release) {
- // if we tagged a prerelease version then the release is in the version already
- version += fmt.Sprintf("-%s", release)
- }
- if GitCommit != "" {
- version += fmt.Sprintf(" (%s)", GitCommit)
- }
- }
// Strip off any single quotes added by the git information.
return strings.Replace(version, "'", "", -1)
--- a/GNUmakefile 2019-05-08 20:34:08.000000000 +0200
+++ b/GNUmakefile 2019-05-09 09:55:40.400630733 +0200
@@ -21,12 +21,7 @@ GOARCH?=$(shell go env GOARCH)
GOPATH=$(shell go env GOPATH)
ASSETFS_PATH?=agent/bindata_assetfs.go
-# Get the git commit
-GIT_COMMIT?=$(shell git rev-parse --short HEAD)
-GIT_DIRTY?=$(shell test -n "`git status --porcelain`" && echo "+CHANGES" || true)
-GIT_DESCRIBE?=$(shell git describe --tags --always --match "v*")
-GIT_IMPORT=github.com/hashicorp/consul/version
-GOLDFLAGS=-X $(GIT_IMPORT).GitCommit=$(GIT_COMMIT)$(GIT_DIRTY) -X $(GIT_IMPORT).GitDescribe=$(GIT_DESCRIBE)
+GOLDFLAGS=
ifeq ($(FORCE_REBUILD),1)
NOCACHE=--no-cache
@@ -248,16 +243,6 @@ ui: ui-docker static-assets-docker
tools:
go get -u -v $(GOTOOLS)
-version:
- @echo -n "Version: "
- @$(SHELL) $(CURDIR)/build-support/scripts/version.sh
- @echo -n "Version + release: "
- @$(SHELL) $(CURDIR)/build-support/scripts/version.sh -r
- @echo -n "Version + git: "
- @$(SHELL) $(CURDIR)/build-support/scripts/version.sh -g
- @echo -n "Version + release + git: "
- @$(SHELL) $(CURDIR)/build-support/scripts/version.sh -r -g
-
docker-images: go-build-image ui-build-image
@@ -286,4 +271,4 @@ proto:
.PHONY: all ci bin dev dist cov test test-ci test-internal test-install-deps cover format vet ui static-assets tools
.PHONY: docker-images go-build-image ui-build-image static-assets-docker consul-docker ui-docker
-.PHONY: version proto test-envoy-integ
+.PHONY: proto test-envoy-integ