mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
@@ -10,8 +10,7 @@ GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g")
|
||||
RUNC_IMAGE := runc_dev$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
|
||||
PROJECT := github.com/opencontainers/runc
|
||||
BUILDTAGS ?= seccomp
|
||||
COMMIT_NO := $(shell git rev-parse HEAD 2> /dev/null || true)
|
||||
COMMIT ?= $(if $(shell git status --porcelain --untracked-files=no),"$(COMMIT_NO)-dirty","$(COMMIT_NO)")
|
||||
COMMIT ?= $(shell git describe --dirty --long --always)
|
||||
VERSION := $(shell cat ./VERSION)
|
||||
|
||||
# TODO: rm -mod=vendor once go 1.13 is unsupported
|
||||
|
||||
@@ -15,9 +15,9 @@ import (
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
// version will be populated by the Makefile, read from
|
||||
// VERSION file of the source code.
|
||||
var version = ""
|
||||
// version must be set from the contents of VERSION file by go build's
|
||||
// -X main.version= option in the Makefile.
|
||||
var version = "unknown"
|
||||
|
||||
// gitCommit will be the hash that the binary was built from
|
||||
// and will be populated by the Makefile
|
||||
@@ -55,10 +55,8 @@ func main() {
|
||||
app.Name = "runc"
|
||||
app.Usage = usage
|
||||
|
||||
var v []string
|
||||
if version != "" {
|
||||
v = append(v, version)
|
||||
}
|
||||
v := []string{version}
|
||||
|
||||
if gitCommit != "" {
|
||||
v = append(v, "commit: "+gitCommit)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user