Browse code

dockerversion placeholder for library-import

- Move autogen/dockerversion to version
- Update autogen and "builds" to use this package and a build flag

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Vincent Demeester authored on 2015/10/26 03:18:23
Showing 21 changed files
... ...
@@ -36,3 +36,4 @@ man/man5
36 36
 man/man8
37 37
 pyenv
38 38
 vendor/pkg/
39
+version/version_autogen.go
... ...
@@ -15,9 +15,9 @@ import (
15 15
 
16 16
 	"github.com/Sirupsen/logrus"
17 17
 	"github.com/docker/docker/api"
18
-	"github.com/docker/docker/autogen/dockerversion"
19 18
 	"github.com/docker/docker/pkg/stdcopy"
20 19
 	"github.com/docker/docker/pkg/term"
20
+	"github.com/docker/docker/version"
21 21
 )
22 22
 
23 23
 type tlsClientCon struct {
... ...
@@ -152,7 +152,7 @@ func (cli *DockerCli) hijackWithContentType(method, path, contentType string, se
152 152
 		req.Header.Set(k, v)
153 153
 	}
154 154
 
155
-	req.Header.Set("User-Agent", "Docker-Client/"+dockerversion.VERSION+" ("+runtime.GOOS+")")
155
+	req.Header.Set("User-Agent", "Docker-Client/"+version.VERSION+" ("+runtime.GOOS+")")
156 156
 	req.Header.Set("Content-Type", contentType)
157 157
 	req.Header.Set("Connection", "Upgrade")
158 158
 	req.Header.Set("Upgrade", "tcp")
... ...
@@ -20,7 +20,6 @@ import (
20 20
 	"github.com/Sirupsen/logrus"
21 21
 	"github.com/docker/docker/api"
22 22
 	"github.com/docker/docker/api/types"
23
-	"github.com/docker/docker/autogen/dockerversion"
24 23
 	"github.com/docker/docker/cliconfig"
25 24
 	"github.com/docker/docker/pkg/jsonmessage"
26 25
 	"github.com/docker/docker/pkg/signal"
... ...
@@ -28,6 +27,7 @@ import (
28 28
 	"github.com/docker/docker/pkg/term"
29 29
 	"github.com/docker/docker/registry"
30 30
 	"github.com/docker/docker/utils"
31
+	"github.com/docker/docker/version"
31 32
 )
32 33
 
33 34
 var (
... ...
@@ -77,7 +77,7 @@ func (cli *DockerCli) clientRequest(method, path string, in io.Reader, headers m
77 77
 		req.Header.Set(k, v)
78 78
 	}
79 79
 
80
-	req.Header.Set("User-Agent", "Docker-Client/"+dockerversion.VERSION+" ("+runtime.GOOS+")")
80
+	req.Header.Set("User-Agent", "Docker-Client/"+version.VERSION+" ("+runtime.GOOS+")")
81 81
 	req.URL.Host = cli.addr
82 82
 	req.URL.Scheme = cli.scheme
83 83
 
... ...
@@ -7,10 +7,10 @@ import (
7 7
 
8 8
 	"github.com/docker/docker/api"
9 9
 	"github.com/docker/docker/api/types"
10
-	"github.com/docker/docker/autogen/dockerversion"
11 10
 	Cli "github.com/docker/docker/cli"
12 11
 	flag "github.com/docker/docker/pkg/mflag"
13 12
 	"github.com/docker/docker/utils"
13
+	"github.com/docker/docker/version"
14 14
 )
15 15
 
16 16
 var versionTemplate = `Client:
... ...
@@ -60,11 +60,11 @@ func (cli *DockerCli) CmdVersion(args ...string) (err error) {
60 60
 
61 61
 	vd := versionData{
62 62
 		Client: types.Version{
63
-			Version:      dockerversion.VERSION,
63
+			Version:      version.VERSION,
64 64
 			APIVersion:   api.Version,
65 65
 			GoVersion:    runtime.Version(),
66
-			GitCommit:    dockerversion.GITCOMMIT,
67
-			BuildTime:    dockerversion.BUILDTIME,
66
+			GitCommit:    version.GITCOMMIT,
67
+			BuildTime:    version.BUILDTIME,
68 68
 			Os:           runtime.GOOS,
69 69
 			Arch:         runtime.GOARCH,
70 70
 			Experimental: utils.ExperimentalBuild(),
... ...
@@ -11,9 +11,9 @@ import (
11 11
 	"github.com/Sirupsen/logrus"
12 12
 	"github.com/docker/docker/api"
13 13
 	"github.com/docker/docker/api/server/httputils"
14
-	"github.com/docker/docker/autogen/dockerversion"
15 14
 	"github.com/docker/docker/errors"
16 15
 	"github.com/docker/docker/pkg/version"
16
+	dockerversion "github.com/docker/docker/version"
17 17
 	"golang.org/x/net/context"
18 18
 )
19 19
 
... ...
@@ -10,24 +10,24 @@ import (
10 10
 	"github.com/docker/docker/api"
11 11
 	"github.com/docker/docker/api/server/httputils"
12 12
 	"github.com/docker/docker/api/types"
13
-	"github.com/docker/docker/autogen/dockerversion"
14 13
 	"github.com/docker/docker/pkg/ioutils"
15 14
 	"github.com/docker/docker/pkg/jsonmessage"
16 15
 	"github.com/docker/docker/pkg/parsers/filters"
17 16
 	"github.com/docker/docker/pkg/parsers/kernel"
18 17
 	"github.com/docker/docker/utils"
18
+	"github.com/docker/docker/version"
19 19
 	"golang.org/x/net/context"
20 20
 )
21 21
 
22 22
 func (s *router) getVersion(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
23 23
 	v := &types.Version{
24
-		Version:    dockerversion.VERSION,
24
+		Version:    version.VERSION,
25 25
 		APIVersion: api.Version,
26
-		GitCommit:  dockerversion.GITCOMMIT,
26
+		GitCommit:  version.GITCOMMIT,
27 27
 		GoVersion:  runtime.Version(),
28 28
 		Os:         runtime.GOOS,
29 29
 		Arch:       runtime.GOARCH,
30
-		BuildTime:  dockerversion.BUILDTIME,
30
+		BuildTime:  version.BUILDTIME,
31 31
 	}
32 32
 
33 33
 	version := httputils.VersionFromContext(ctx)
... ...
@@ -12,7 +12,6 @@ import (
12 12
 	"syscall"
13 13
 
14 14
 	"github.com/Sirupsen/logrus"
15
-	"github.com/docker/docker/autogen/dockerversion"
16 15
 	"github.com/docker/docker/daemon/graphdriver"
17 16
 	derr "github.com/docker/docker/errors"
18 17
 	"github.com/docker/docker/pkg/fileutils"
... ...
@@ -22,6 +21,7 @@ import (
22 22
 	"github.com/docker/docker/pkg/sysinfo"
23 23
 	"github.com/docker/docker/runconfig"
24 24
 	"github.com/docker/docker/utils"
25
+	"github.com/docker/docker/version"
25 26
 	"github.com/docker/docker/volume"
26 27
 	"github.com/docker/libnetwork"
27 28
 	nwconfig "github.com/docker/libnetwork/config"
... ...
@@ -286,7 +286,7 @@ func migrateIfDownlevel(driver graphdriver.Driver, root string) error {
286 286
 }
287 287
 
288 288
 func configureSysInit(config *Config, rootUID, rootGID int) (string, error) {
289
-	localCopy := filepath.Join(config.Root, "init", fmt.Sprintf("dockerinit-%s", dockerversion.VERSION))
289
+	localCopy := filepath.Join(config.Root, "init", fmt.Sprintf("dockerinit-%s", version.VERSION))
290 290
 	sysInitPath := utils.DockerInitPath(localCopy)
291 291
 	if sysInitPath == "" {
292 292
 		return "", fmt.Errorf("Could not locate dockerinit: This usually means docker was built incorrectly. See https://docs.docker.com/project/set-up-dev-env/ for official build instructions.")
... ...
@@ -8,9 +8,9 @@ import (
8 8
 	"sync"
9 9
 
10 10
 	"github.com/Sirupsen/logrus"
11
-	"github.com/docker/docker/autogen/dockerversion"
12 11
 	"github.com/docker/docker/daemon/execdriver"
13 12
 	"github.com/docker/docker/pkg/parsers"
13
+	"github.com/docker/docker/version"
14 14
 )
15 15
 
16 16
 // This is a daemon development variable only and should not be
... ...
@@ -24,7 +24,7 @@ var forceKill bool
24 24
 // Define name and version for windows
25 25
 var (
26 26
 	DriverName = "Windows 1854"
27
-	Version    = dockerversion.VERSION + " " + dockerversion.GITCOMMIT
27
+	Version    = version.VERSION + " " + version.GITCOMMIT
28 28
 )
29 29
 
30 30
 type activeContainer struct {
... ...
@@ -16,7 +16,6 @@ import (
16 16
 	"time"
17 17
 
18 18
 	"github.com/Sirupsen/logrus"
19
-	"github.com/docker/docker/autogen/dockerversion"
20 19
 	"github.com/docker/docker/daemon/graphdriver"
21 20
 	"github.com/docker/docker/image"
22 21
 	"github.com/docker/docker/pkg/archive"
... ...
@@ -24,6 +23,7 @@ import (
24 24
 	"github.com/docker/docker/pkg/idtools"
25 25
 	"github.com/docker/docker/pkg/ioutils"
26 26
 	"github.com/docker/docker/pkg/random"
27
+	"github.com/docker/docker/version"
27 28
 	"github.com/microsoft/hcsshim"
28 29
 )
29 30
 
... ...
@@ -440,7 +440,7 @@ func (d *Driver) RestoreCustomImages(tagger graphdriver.Tagger, recorder graphdr
440 440
 			img := &image.Image{
441 441
 				ID:            id,
442 442
 				Created:       imageData.CreatedTime,
443
-				DockerVersion: dockerversion.VERSION,
443
+				DockerVersion: version.VERSION,
444 444
 				Architecture:  runtime.GOARCH,
445 445
 				OS:            runtime.GOOS,
446 446
 				Size:          imageData.Size,
... ...
@@ -7,7 +7,6 @@ import (
7 7
 
8 8
 	"github.com/Sirupsen/logrus"
9 9
 	"github.com/docker/docker/api/types"
10
-	"github.com/docker/docker/autogen/dockerversion"
11 10
 	"github.com/docker/docker/pkg/fileutils"
12 11
 	"github.com/docker/docker/pkg/parsers/kernel"
13 12
 	"github.com/docker/docker/pkg/parsers/operatingsystem"
... ...
@@ -15,6 +14,7 @@ import (
15 15
 	"github.com/docker/docker/pkg/system"
16 16
 	"github.com/docker/docker/registry"
17 17
 	"github.com/docker/docker/utils"
18
+	"github.com/docker/docker/version"
18 19
 )
19 20
 
20 21
 // SystemInfo returns information about the host server the daemon is running on.
... ...
@@ -83,14 +83,14 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
83 83
 		OperatingSystem:    operatingSystem,
84 84
 		IndexServerAddress: registry.IndexServer,
85 85
 		RegistryConfig:     daemon.RegistryService.Config,
86
-		InitSha1:           dockerversion.INITSHA1,
86
+		InitSha1:           version.INITSHA1,
87 87
 		InitPath:           initPath,
88 88
 		NCPU:               runtime.NumCPU(),
89 89
 		MemTotal:           meminfo.MemTotal,
90 90
 		DockerRootDir:      daemon.config().Root,
91 91
 		Labels:             daemon.config().Labels,
92 92
 		ExperimentalBuild:  utils.ExperimentalBuild(),
93
-		ServerVersion:      dockerversion.VERSION,
93
+		ServerVersion:      version.VERSION,
94 94
 		ClusterStore:       daemon.config().ClusterStore,
95 95
 	}
96 96
 
... ...
@@ -14,7 +14,6 @@ import (
14 14
 	"github.com/Sirupsen/logrus"
15 15
 	"github.com/docker/distribution/uuid"
16 16
 	apiserver "github.com/docker/docker/api/server"
17
-	"github.com/docker/docker/autogen/dockerversion"
18 17
 	"github.com/docker/docker/cli"
19 18
 	"github.com/docker/docker/cliconfig"
20 19
 	"github.com/docker/docker/daemon"
... ...
@@ -28,6 +27,7 @@ import (
28 28
 	"github.com/docker/docker/pkg/tlsconfig"
29 29
 	"github.com/docker/docker/registry"
30 30
 	"github.com/docker/docker/utils"
31
+	"github.com/docker/docker/version"
31 32
 )
32 33
 
33 34
 const daemonUsage = "       docker daemon [ --help | ... ]\n"
... ...
@@ -206,7 +206,7 @@ func (cli *DaemonCli) CmdDaemon(args ...string) error {
206 206
 
207 207
 	serverConfig := &apiserver.Config{
208 208
 		Logging: true,
209
-		Version: dockerversion.VERSION,
209
+		Version: version.VERSION,
210 210
 	}
211 211
 	serverConfig = setPlatformServerConfig(serverConfig, cli.Config)
212 212
 
... ...
@@ -279,8 +279,8 @@ func (cli *DaemonCli) CmdDaemon(args ...string) error {
279 279
 	logrus.Info("Daemon has completed initialization")
280 280
 
281 281
 	logrus.WithFields(logrus.Fields{
282
-		"version":     dockerversion.VERSION,
283
-		"commit":      dockerversion.GITCOMMIT,
282
+		"version":     version.VERSION,
283
+		"commit":      version.GITCOMMIT,
284 284
 		"execdriver":  d.ExecutionDriver().Name(),
285 285
 		"graphdriver": d.GraphDriver().String(),
286 286
 	}).Info("Docker daemon")
... ...
@@ -6,12 +6,12 @@ import (
6 6
 
7 7
 	"github.com/Sirupsen/logrus"
8 8
 	"github.com/docker/docker/api/client"
9
-	"github.com/docker/docker/autogen/dockerversion"
10 9
 	"github.com/docker/docker/cli"
11 10
 	flag "github.com/docker/docker/pkg/mflag"
12 11
 	"github.com/docker/docker/pkg/reexec"
13 12
 	"github.com/docker/docker/pkg/term"
14 13
 	"github.com/docker/docker/utils"
14
+	"github.com/docker/docker/version"
15 15
 )
16 16
 
17 17
 func main() {
... ...
@@ -77,8 +77,8 @@ func main() {
77 77
 
78 78
 func showVersion() {
79 79
 	if utils.ExperimentalBuild() {
80
-		fmt.Printf("Docker version %s, build %s, experimental\n", dockerversion.VERSION, dockerversion.GITCOMMIT)
80
+		fmt.Printf("Docker version %s, build %s, experimental\n", version.VERSION, version.GITCOMMIT)
81 81
 	} else {
82
-		fmt.Printf("Docker version %s, build %s\n", dockerversion.VERSION, dockerversion.GITCOMMIT)
82
+		fmt.Printf("Docker version %s, build %s\n", version.VERSION, version.GITCOMMIT)
83 83
 	}
84 84
 }
... ...
@@ -17,7 +17,6 @@ import (
17 17
 
18 18
 	"github.com/Sirupsen/logrus"
19 19
 	"github.com/docker/distribution/digest"
20
-	"github.com/docker/docker/autogen/dockerversion"
21 20
 	"github.com/docker/docker/daemon/graphdriver"
22 21
 	"github.com/docker/docker/image"
23 22
 	"github.com/docker/docker/pkg/archive"
... ...
@@ -27,6 +26,7 @@ import (
27 27
 	"github.com/docker/docker/pkg/stringid"
28 28
 	"github.com/docker/docker/pkg/truncindex"
29 29
 	"github.com/docker/docker/runconfig"
30
+	"github.com/docker/docker/version"
30 31
 	"github.com/vbatts/tar-split/tar/asm"
31 32
 	"github.com/vbatts/tar-split/tar/storage"
32 33
 )
... ...
@@ -247,7 +247,7 @@ func (graph *Graph) Create(layerData io.Reader, containerID, containerImage, com
247 247
 		ID:            stringid.GenerateRandomID(),
248 248
 		Comment:       comment,
249 249
 		Created:       time.Now().UTC(),
250
-		DockerVersion: dockerversion.VERSION,
250
+		DockerVersion: version.VERSION,
251 251
 		Author:        author,
252 252
 		Config:        config,
253 253
 		Architecture:  runtime.GOARCH,
... ...
@@ -9,10 +9,10 @@ import (
9 9
 	"testing"
10 10
 	"time"
11 11
 
12
-	"github.com/docker/docker/autogen/dockerversion"
13 12
 	"github.com/docker/docker/daemon/graphdriver"
14 13
 	"github.com/docker/docker/image"
15 14
 	"github.com/docker/docker/pkg/stringid"
15
+	"github.com/docker/docker/version"
16 16
 )
17 17
 
18 18
 func TestMount(t *testing.T) {
... ...
@@ -106,8 +106,8 @@ func TestGraphCreate(t *testing.T) {
106 106
 	if img.Comment != "Testing" {
107 107
 		t.Fatalf("Wrong comment: should be '%s', not '%s'", "Testing", img.Comment)
108 108
 	}
109
-	if img.DockerVersion != dockerversion.VERSION {
110
-		t.Fatalf("Wrong docker_version: should be '%s', not '%s'", dockerversion.VERSION, img.DockerVersion)
109
+	if img.DockerVersion != version.VERSION {
110
+		t.Fatalf("Wrong docker_version: should be '%s', not '%s'", version.VERSION, img.DockerVersion)
111 111
 	}
112 112
 	images := graph.Map()
113 113
 	if l := len(images); l != 1 {
... ...
@@ -146,7 +146,7 @@ fi
146 146
 EXTLDFLAGS_STATIC='-static'
147 147
 # ORIG_BUILDFLAGS is necessary for the cross target which cannot always build
148 148
 # with options like -race.
149
-ORIG_BUILDFLAGS=( -a -tags "netgo static_build sqlite_omit_load_extension $DOCKER_BUILDTAGS" -installsuffix netgo )
149
+ORIG_BUILDFLAGS=( -a -tags "autogen netgo static_build sqlite_omit_load_extension $DOCKER_BUILDTAGS" -installsuffix netgo )
150 150
 # see https://github.com/golang/go/issues/9369#issuecomment-69864440 for why -installsuffix is necessary here
151 151
 BUILDFLAGS=( $BUILDFLAGS "${ORIG_BUILDFLAGS[@]}" )
152 152
 # Test timeout.
... ...
@@ -2,12 +2,14 @@
2 2
 
3 3
 rm -rf autogen
4 4
 
5
-mkdir -p autogen/dockerversion
6
-cat > autogen/dockerversion/dockerversion.go <<DVEOF
7
-// AUTOGENERATED FILE; see $BASH_SOURCE
8
-package dockerversion
9
-
10
-var (
5
+cat > version/version_autogen.go <<DVEOF
6
+// +build autogen
7
+// Package version is auto-generated at build-time
8
+package version
9
+
10
+// Default build-time variable for library-import.
11
+// This file is overridden on build with build-time informations.
12
+const (
11 13
 	GITCOMMIT string = "$GITCOMMIT"
12 14
 	VERSION   string = "$VERSION"
13 15
 	BUILDTIME string = "$BUILDTIME"
... ...
@@ -16,6 +18,7 @@ var (
16 16
 	INITSHA1  string = "$DOCKER_INITSHA1"
17 17
 	INITPATH  string = "$DOCKER_INITPATH"
18 18
 )
19
+// AUTOGENERATED FILE; see $BASH_SOURCE
19 20
 DVEOF
20 21
 
21 22
 # Compile the Windows resources into the sources
... ...
@@ -5,8 +5,8 @@ import (
5 5
 	"net/http"
6 6
 
7 7
 	"github.com/docker/docker/api/types"
8
-	"github.com/docker/docker/autogen/dockerversion"
9 8
 	"github.com/docker/docker/pkg/integration/checker"
9
+	"github.com/docker/docker/version"
10 10
 	"github.com/go-check/check"
11 11
 )
12 12
 
... ...
@@ -19,5 +19,5 @@ func (s *DockerSuite) TestGetVersion(c *check.C) {
19 19
 
20 20
 	c.Assert(json.Unmarshal(body, &v), checker.IsNil)
21 21
 
22
-	c.Assert(v.Version, checker.Equals, dockerversion.VERSION, check.Commentf("Version mismatch"))
22
+	c.Assert(v.Version, checker.Equals, version.VERSION, check.Commentf("Version mismatch"))
23 23
 }
... ...
@@ -9,9 +9,9 @@ import (
9 9
 	"path/filepath"
10 10
 	"runtime"
11 11
 
12
-	"github.com/docker/docker/autogen/dockerversion"
13 12
 	"github.com/docker/docker/pkg/homedir"
14 13
 	"github.com/docker/docker/pkg/integration/checker"
14
+	"github.com/docker/docker/version"
15 15
 	"github.com/go-check/check"
16 16
 )
17 17
 
... ...
@@ -54,7 +54,7 @@ func (s *DockerSuite) TestConfigHttpHeader(c *check.C) {
54 54
 
55 55
 	c.Assert(headers["User-Agent"], checker.NotNil, check.Commentf("Missing User-Agent"))
56 56
 
57
-	c.Assert(headers["User-Agent"][0], checker.Equals, "Docker-Client/"+dockerversion.VERSION+" ("+runtime.GOOS+")", check.Commentf("Badly formatted User-Agent,out:%v", out))
57
+	c.Assert(headers["User-Agent"][0], checker.Equals, "Docker-Client/"+version.VERSION+" ("+runtime.GOOS+")", check.Commentf("Badly formatted User-Agent,out:%v", out))
58 58
 
59 59
 	c.Assert(headers["Myheader"], checker.NotNil)
60 60
 	c.Assert(headers["Myheader"][0], checker.Equals, "MyValue", check.Commentf("Missing/bad header,out:%v", out))
... ...
@@ -20,10 +20,10 @@ import (
20 20
 	"github.com/docker/distribution/registry/api/v2"
21 21
 	"github.com/docker/distribution/registry/client"
22 22
 	"github.com/docker/distribution/registry/client/transport"
23
-	"github.com/docker/docker/autogen/dockerversion"
24 23
 	"github.com/docker/docker/pkg/parsers/kernel"
25 24
 	"github.com/docker/docker/pkg/tlsconfig"
26 25
 	"github.com/docker/docker/pkg/useragent"
26
+	"github.com/docker/docker/version"
27 27
 )
28 28
 
29 29
 var (
... ...
@@ -39,9 +39,9 @@ var dockerUserAgent string
39 39
 
40 40
 func init() {
41 41
 	httpVersion := make([]useragent.VersionInfo, 0, 6)
42
-	httpVersion = append(httpVersion, useragent.VersionInfo{"docker", dockerversion.VERSION})
42
+	httpVersion = append(httpVersion, useragent.VersionInfo{"docker", version.VERSION})
43 43
 	httpVersion = append(httpVersion, useragent.VersionInfo{"go", runtime.Version()})
44
-	httpVersion = append(httpVersion, useragent.VersionInfo{"git-commit", dockerversion.GITCOMMIT})
44
+	httpVersion = append(httpVersion, useragent.VersionInfo{"git-commit", version.GITCOMMIT})
45 45
 	if kernelVersion, err := kernel.GetKernelVersion(); err == nil {
46 46
 		httpVersion = append(httpVersion, useragent.VersionInfo{"kernel", kernelVersion.String()})
47 47
 	}
... ...
@@ -14,10 +14,10 @@ import (
14 14
 	"strings"
15 15
 
16 16
 	"github.com/docker/distribution/registry/api/errcode"
17
-	"github.com/docker/docker/autogen/dockerversion"
18 17
 	"github.com/docker/docker/pkg/archive"
19 18
 	"github.com/docker/docker/pkg/fileutils"
20 19
 	"github.com/docker/docker/pkg/stringid"
20
+	"github.com/docker/docker/version"
21 21
 )
22 22
 
23 23
 // SelfPath figures out the absolute path of our own binary (if it's still around).
... ...
@@ -60,7 +60,7 @@ func isValidDockerInitPath(target string, selfPath string) bool { // target and
60 60
 	if target == "" {
61 61
 		return false
62 62
 	}
63
-	if dockerversion.IAMSTATIC == "true" {
63
+	if version.IAMSTATIC == "true" {
64 64
 		if selfPath == "" {
65 65
 			return false
66 66
 		}
... ...
@@ -77,7 +77,7 @@ func isValidDockerInitPath(target string, selfPath string) bool { // target and
77 77
 		}
78 78
 		return os.SameFile(targetFileInfo, selfPathFileInfo)
79 79
 	}
80
-	return dockerversion.INITSHA1 != "" && dockerInitSha1(target) == dockerversion.INITSHA1
80
+	return version.INITSHA1 != "" && dockerInitSha1(target) == version.INITSHA1
81 81
 }
82 82
 
83 83
 // DockerInitPath figures out the path of our dockerinit (which may be SelfPath())
... ...
@@ -89,7 +89,7 @@ func DockerInitPath(localCopy string) string {
89 89
 	}
90 90
 	var possibleInits = []string{
91 91
 		localCopy,
92
-		dockerversion.INITPATH,
92
+		version.INITPATH,
93 93
 		filepath.Join(filepath.Dir(selfPath), "dockerinit"),
94 94
 
95 95
 		// FHS 3.0 Draft: "/usr/libexec includes internal binaries that are not intended to be executed directly by users or shell scripts. Applications may use a single subdirectory under /usr/libexec."
96 96
new file mode 100644
... ...
@@ -0,0 +1,16 @@
0
+// +build !autogen
1
+
2
+// Package version is auto-generated at build-time
3
+package version
4
+
5
+// Default build-time variable for library-import.
6
+// This file is overridden on build with build-time informations.
7
+const (
8
+	GITCOMMIT string = "library-import"
9
+	VERSION   string = "library-import"
10
+	BUILDTIME string = "library-import"
11
+
12
+	IAMSTATIC string = "library-import"
13
+	INITSHA1  string = "library-import"
14
+	INITPATH  string = "library-import"
15
+)