mc: Fix release build flags after recent refactor. (#1794)

This commit is contained in:
Harshavardhana
2016-08-13 13:49:18 -07:00
committed by GitHub
parent c9c95f2e9e
commit f5ff7e15cf
12 changed files with 34 additions and 43 deletions
+8 -8
View File
@@ -17,12 +17,12 @@
package command
var (
// mcVersion - version time.RFC3339.
mcVersion = "DEVELOPMENT.GOGET"
// mcReleaseTag - release tag in TAG.%Y-%m-%dT%H-%M-%SZ.
mcReleaseTag = "DEVELOPMENT.GOGET"
// mcCommitID - latest commit id.
mcCommitID = "DEVELOPMENT.GOGET"
// mcShortCommitID - first 12 characters from mcCommitID.
mcShortCommitID = mcCommitID[:12]
// MCVersion - version time.RFC3339.
MCVersion = "DEVELOPMENT.GOGET"
// MCReleaseTag - release tag in TAG.%Y-%m-%dT%H-%M-%SZ.
MCReleaseTag = "DEVELOPMENT.GOGET"
// MCCommitID - latest commit id.
MCCommitID = "DEVELOPMENT.GOGET"
// MCShortCommitID - first 12 characters from MCCommitID.
MCShortCommitID = MCCommitID[:12]
)
+1 -2
View File
@@ -155,11 +155,10 @@ func newClientFromAlias(alias string, urlStr string) (Client, *probe.Error) {
s3Config.Signature = hostCfg.API
s3Config.AppName = "mc"
s3Config.AppVersion = mcVersion
s3Config.AppVersion = MCVersion
s3Config.AppComments = []string{os.Args[0], runtime.GOOS, runtime.GOARCH}
s3Config.HostURL = urlStr
s3Config.Debug = globalDebug
s3Client, err := s3New(s3Config)
if err != nil {
return nil, err.Trace(alias, urlStr)
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
// This package contains all the global variables and constants. ONLY TO BE ACCESSED VIA GET/SET FUNCTIONS.
// Package command contains all the global variables and constants. ONLY TO BE ACCESSED VIA GET/SET FUNCTIONS.
package command
import (
+3 -3
View File
@@ -56,7 +56,7 @@ GLOBAL FLAGS:
{{range .Flags}}{{.}}
{{end}}{{end}}
VERSION:
` + mcVersion +
` + MCVersion +
`{{ "\n"}}{{range $key, $value := ExtraInfo}}
{{$key}}:
{{$value}}
@@ -76,8 +76,8 @@ func Main() {
}
probe.Init() // Set project's root source path.
probe.SetAppInfo("Release-Tag", mcReleaseTag)
probe.SetAppInfo("Commit", mcShortCommitID)
probe.SetAppInfo("Release-Tag", MCReleaseTag)
probe.SetAppInfo("Commit", MCShortCommitID)
app := registerApp()
app.Before = registerBefore
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Minio Client, (C) 2015 Minio, Inc.
* Minio Client, (C) 2015, 2016 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
// Session V2 - Version 2 stores session header and session data in
// Package command - session V7 - Version 7 stores session header and session data in
// two separate files. Session data contains fully prepared URL list.
package command
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
* Minio Client (C) 2014, 2015, 2016 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
// This file implements a simple trie tree to be used for 'mc' cli commands.
// Package command - This file implements a simple trie tree to be used for 'mc' cli commands.
package command
// This package borrows idea from - https://godoc.org/golang.org/x/text/internal/triegen.
+3 -3
View File
@@ -164,12 +164,12 @@ func getReleaseUpdate(updateURL string) {
data, e := client.Get(newUpdateURL)
fatalIf(probe.NewError(e), "Unable to read from update URL ‘"+newUpdateURL+"’.")
if strings.HasPrefix(mcVersion, "DEVELOPMENT.GOGET") {
if strings.HasPrefix(MCVersion, "DEVELOPMENT.GOGET") {
fatalIf(errDummy().Trace(newUpdateURL),
"Update mechanism is not supported for ‘go get’ based binary builds. Please download official releases from https://minio.io/#minio")
}
current, e := time.Parse(time.RFC3339, mcVersion)
current, e := time.Parse(time.RFC3339, MCVersion)
fatalIf(probe.NewError(e), "Unable to parse version string as time.")
if current.IsZero() {
@@ -190,7 +190,7 @@ func getReleaseUpdate(updateURL string) {
updateMsg := updateMessage{
Download: downloadURL,
Version: mcVersion,
Version: MCVersion,
}
if latest.After(current) {
updateMsg.Update = true
+3 -3
View File
@@ -89,9 +89,9 @@ func mainVersion(ctx *cli.Context) {
console.SetColor("CommitID", color.New(color.FgGreen))
verMsg := versionMessage{}
verMsg.CommitID = mcCommitID
verMsg.ReleaseTag = mcReleaseTag
verMsg.Version.Value = mcVersion
verMsg.CommitID = MCCommitID
verMsg.ReleaseTag = MCReleaseTag
verMsg.Version.Value = MCVersion
verMsg.Version.Format = "RFC3339"
printMsg(verMsg)
+1 -1
View File
@@ -24,6 +24,6 @@ import (
)
func (s *TestSuite) TestVersion(c *C) {
_, e := time.Parse(mcVersion, http.TimeFormat)
_, e := time.Parse(MCVersion, http.TimeFormat)
c.Assert(e, NotNil)
}