@@ -11,6 +11,7 @@ import (
1111 "github.com/dotcloud/docker/api"
1212 "github.com/dotcloud/docker/archive"
1313 "github.com/dotcloud/docker/auth"
14+ "github.com/dotcloud/docker/dockerversion"
1415 "github.com/dotcloud/docker/engine"
1516 flag "github.com/dotcloud/docker/pkg/mflag"
1617 "github.com/dotcloud/docker/pkg/sysinfo"
@@ -383,12 +384,12 @@ func (cli *DockerCli) CmdVersion(args ...string) error {
383384 cmd .Usage ()
384385 return nil
385386 }
386- if VERSION != "" {
387- fmt .Fprintf (cli .out , "Client version: %s\n " , VERSION )
387+ if dockerversion . VERSION != "" {
388+ fmt .Fprintf (cli .out , "Client version: %s\n " , dockerversion . VERSION )
388389 }
389390 fmt .Fprintf (cli .out , "Go version (client): %s\n " , runtime .Version ())
390- if GITCOMMIT != "" {
391- fmt .Fprintf (cli .out , "Git commit (client): %s\n " , GITCOMMIT )
391+ if dockerversion . GITCOMMIT != "" {
392+ fmt .Fprintf (cli .out , "Git commit (client): %s\n " , dockerversion . GITCOMMIT )
392393 }
393394
394395 body , _ , err := readBody (cli .call ("GET" , "/version" , nil , false ))
@@ -413,7 +414,7 @@ func (cli *DockerCli) CmdVersion(args ...string) error {
413414 release := utils .GetReleaseVersion ()
414415 if release != "" {
415416 fmt .Fprintf (cli .out , "Last stable version: %s" , release )
416- if (VERSION != "" || remoteVersion .Exists ("Version" )) && (strings .Trim (VERSION , "-dev" ) != release || strings .Trim (remoteVersion .Get ("Version" ), "-dev" ) != release ) {
417+ if (dockerversion . VERSION != "" || remoteVersion .Exists ("Version" )) && (strings .Trim (dockerversion . VERSION , "-dev" ) != release || strings .Trim (remoteVersion .Get ("Version" ), "-dev" ) != release ) {
417418 fmt .Fprintf (cli .out , ", please update docker" )
418419 }
419420 fmt .Fprintf (cli .out , "\n " )
@@ -2298,7 +2299,7 @@ func (cli *DockerCli) call(method, path string, data interface{}, passAuthInfo b
22982299 }
22992300 }
23002301 }
2301- req .Header .Set ("User-Agent" , "Docker-Client/" + VERSION )
2302+ req .Header .Set ("User-Agent" , "Docker-Client/" + dockerversion . VERSION )
23022303 req .Host = cli .addr
23032304 if data != nil {
23042305 req .Header .Set ("Content-Type" , "application/json" )
@@ -2355,7 +2356,7 @@ func (cli *DockerCli) stream(method, path string, in io.Reader, out io.Writer, h
23552356 if err != nil {
23562357 return err
23572358 }
2358- req .Header .Set ("User-Agent" , "Docker-Client/" + VERSION )
2359+ req .Header .Set ("User-Agent" , "Docker-Client/" + dockerversion . VERSION )
23592360 req .Host = cli .addr
23602361 if method == "POST" {
23612362 req .Header .Set ("Content-Type" , "plain/text" )
@@ -2419,7 +2420,7 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea
24192420 if err != nil {
24202421 return err
24212422 }
2422- req .Header .Set ("User-Agent" , "Docker-Client/" + VERSION )
2423+ req .Header .Set ("User-Agent" , "Docker-Client/" + dockerversion . VERSION )
24232424 req .Header .Set ("Content-Type" , "plain/text" )
24242425 req .Host = cli .addr
24252426
0 commit comments