PKGBUILDs/community/consul/fix-build-version-info.patch

76 lines
2.5 KiB
Diff
Raw Normal View History

2018-06-26 12:54:12 +00:00
--- 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)
2019-03-01 13:52:37 +00:00
--- b/GNUmakefile 2019-01-08 15:44:48.494251517 +0100
+++ c/GNUmakefile 2019-01-08 15:48:07.639739133 +0100
@@ -23,12 +23,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)
-GIT_IMPORT=github.com/hashicorp/consul/version
-GOLDFLAGS=-X $(GIT_IMPORT).GitCommit=$(GIT_COMMIT)$(GIT_DIRTY) -X $(GIT_IMPORT).GitDescribe=$(GIT_DESCRIBE)
+GOLDFLAGS=
EXTLDFLAGS := ${LDFLAGS}
ifeq ($(FORCE_REBUILD),1)
@@ -238,17 +233,6 @@ ui: ui-legacy-docker ui-docker static-as
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 ui-legacy-build-image
go-build-image:
@@ -276,4 +263,4 @@ ui-legacy-docker: ui-legacy-build-image
.PHONY: all ci bin dev dist cov test test-ci test-internal test-install-deps cover format vet ui static-assets tools vendorfmt
-.PHONY: docker-images go-build-image ui-build-image ui-legacy-build-image static-assets-docker consul-docker ui-docker ui-legacy-docker version proto
+.PHONY: docker-images go-build-image ui-build-image ui-legacy-build-image static-assets-docker consul-docker ui-docker ui-legacy-docker proto