This repository was archived by the owner on Jul 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +1
-24
lines changed Expand file tree Collapse file tree 3 files changed +1
-24
lines changed Original file line number Diff line number Diff line change 11include vars.mk
22
3- ifeq ($(BUILDTIME ) ,)
4- BUILDTIME := $(shell date -u +"% Y-% m-% dT% H:% M:% SZ" 2> /dev/null)
5- endif
6- ifeq ($(BUILDTIME ) ,)
7- BUILDTIME := unknown
8- $(warning unable to set BUILDTIME. Set the value manually)
9- endif
10-
113LDFLAGS := "-s -w \
124 -X $(PKG_NAME ) /internal.GitCommit=$(COMMIT ) \
13- -X $(PKG_NAME ) /internal.Version=$(TAG ) \
14- -X $(PKG_NAME ) /internal.BuildTime=$(BUILDTIME ) "
5+ -X $(PKG_NAME ) /internal.Version=$(TAG ) "
156
167EXEC_EXT :=
178ifeq ($(OS ) ,Windows_NT)
Original file line number Diff line number Diff line change @@ -4,35 +4,22 @@ import (
44 "fmt"
55 "runtime"
66 "strings"
7- "time"
87)
98
109var (
1110 // Version is the git tag that this was built from.
1211 Version = "unknown"
1312 // GitCommit is the commit that this was built from.
1413 GitCommit = "unknown"
15- // BuildTime is the time at which the binary was built.
16- BuildTime = "unknown"
1714)
1815
1916// FullVersion returns a string of version information.
2017func FullVersion () string {
2118 res := []string {
2219 fmt .Sprintf ("Version: %s" , Version ),
2320 fmt .Sprintf ("Git commit: %s" , GitCommit ),
24- fmt .Sprintf ("Built: %s" , reformatDate (BuildTime )),
2521 fmt .Sprintf ("OS/Arch: %s/%s" , runtime .GOOS , runtime .GOARCH ),
2622 }
2723
2824 return strings .Join (res , "\n " )
2925}
30-
31- // FIXME(chris-crone): use function in docker/cli/cli/command/system/version.go.
32- func reformatDate (buildTime string ) string {
33- t , errTime := time .Parse (time .RFC3339Nano , buildTime )
34- if errTime == nil {
35- return t .Format (time .ANSIC )
36- }
37- return buildTime
38- }
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ ifeq ($(SHELL),sh.exe)
1111 rm = del /F /Q $(subst /,\,$(1 ) ) > nul 2>&1 || (exit 0)
1212 rmdir = rmdir /S /Q $(subst /,\,$(1 ) ) > nul 2>&1 || (exit 0)
1313 chmod =
14- BUILDTIME ?= unknown
1514 NULL := nul
1615else
1716 # The no-op redirection forces make to shell out the commands instead of spawning a process as
You can’t perform that action at this time.
0 commit comments