mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
Add : commit details to bor version (#730)
* add : commit details to bor version * fix : MAKEFILE * undo : rm test-txpool-race * rm : params/build_date * rm : params/gitbranch and params/gitdate
This commit is contained in:
parent
6f153f05d7
commit
ec14a06dc2
3 changed files with 18 additions and 6 deletions
8
Makefile
8
Makefile
|
|
@ -14,20 +14,18 @@ GORUN = env GO111MODULE=on go run
|
||||||
GOPATH = $(shell go env GOPATH)
|
GOPATH = $(shell go env GOPATH)
|
||||||
|
|
||||||
GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
|
GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
|
||||||
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
|
|
||||||
GIT_TAG ?= $(shell git describe --tags `git rev-list --tags="v*" --max-count=1`)
|
|
||||||
|
|
||||||
PACKAGE = github.com/ethereum/go-ethereum
|
PACKAGE = github.com/ethereum/go-ethereum
|
||||||
GO_FLAGS += -buildvcs=false
|
GO_FLAGS += -buildvcs=false
|
||||||
GO_FLAGS += -ldflags "-X ${PACKAGE}/params.GitCommit=${GIT_COMMIT} -X ${PACKAGE}/params.GitBranch=${GIT_BRANCH} -X ${PACKAGE}/params.GitTag=${GIT_TAG}"
|
GO_LDFLAGS += -ldflags "-X ${PACKAGE}/params.GitCommit=${GIT_COMMIT} "
|
||||||
|
|
||||||
TESTALL = $$(go list ./... | grep -v go-ethereum/cmd/)
|
TESTALL = $$(go list ./... | grep -v go-ethereum/cmd/)
|
||||||
TESTE2E = ./tests/...
|
TESTE2E = ./tests/...
|
||||||
GOTEST = GODEBUG=cgocheck=0 go test $(GO_FLAGS) -p 1
|
GOTEST = GODEBUG=cgocheck=0 go test $(GO_FLAGS) $(GO_LDFLAGS) -p 1
|
||||||
|
|
||||||
bor:
|
bor:
|
||||||
mkdir -p $(GOPATH)/bin/
|
mkdir -p $(GOPATH)/bin/
|
||||||
go build -o $(GOBIN)/bor ./cmd/cli/main.go
|
go build -o $(GOBIN)/bor $(GO_LDFLAGS) ./cmd/cli/main.go
|
||||||
cp $(GOBIN)/bor $(GOPATH)/bin/
|
cp $(GOBIN)/bor $(GOPATH)/bin/
|
||||||
@echo "Done building."
|
@echo "Done building."
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ func (c *VersionCommand) Synopsis() string {
|
||||||
|
|
||||||
// Run implements the cli.Command interface
|
// Run implements the cli.Command interface
|
||||||
func (c *VersionCommand) Run(args []string) int {
|
func (c *VersionCommand) Run(args []string) int {
|
||||||
c.UI.Output(params.VersionWithMeta)
|
c.UI.Output(params.VersionWithMetaCommitDetails)
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,10 @@ const (
|
||||||
VersionMeta = "stable" // Version metadata to append to the version string
|
VersionMeta = "stable" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
GitCommit = ""
|
||||||
|
)
|
||||||
|
|
||||||
// Version holds the textual version string.
|
// Version holds the textual version string.
|
||||||
var Version = func() string {
|
var Version = func() string {
|
||||||
return fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch)
|
return fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch)
|
||||||
|
|
@ -41,6 +45,16 @@ var VersionWithMeta = func() string {
|
||||||
return v
|
return v
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
// VersionWithCommitDetails holds the textual version string including the metadata and Git Details.
|
||||||
|
var VersionWithMetaCommitDetails = func() string {
|
||||||
|
v := Version
|
||||||
|
if VersionMeta != "" {
|
||||||
|
v += "-" + VersionMeta
|
||||||
|
}
|
||||||
|
v_git := fmt.Sprintf("Version : %s\nGitCommit : %s\n", v, GitCommit)
|
||||||
|
return v_git
|
||||||
|
}()
|
||||||
|
|
||||||
// ArchiveVersion holds the textual version string used for Geth archives.
|
// ArchiveVersion holds the textual version string used for Geth archives.
|
||||||
// e.g. "1.8.11-dea1ce05" for stable releases, or
|
// e.g. "1.8.11-dea1ce05" for stable releases, or
|
||||||
//
|
//
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue