From 866c2c8915933af105eee246e2bb1a019a7f3e10 Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet Date: Tue, 4 Nov 2014 18:58:15 -0800 Subject: [PATCH] updates + config: moved location of current version number --- cmd/ipfs/init.go | 1 - cmd/ipfs/version.go | 7 ++++--- config/version.go | 3 +++ net/handshake/handshake1.go | 4 ++-- updates/updates.go | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cmd/ipfs/init.go b/cmd/ipfs/init.go index 2c4446c58..fc21f2bc1 100644 --- a/cmd/ipfs/init.go +++ b/cmd/ipfs/init.go @@ -11,7 +11,6 @@ import ( config "github.com/jbenet/go-ipfs/config" ci "github.com/jbenet/go-ipfs/crypto" peer "github.com/jbenet/go-ipfs/peer" - updates "github.com/jbenet/go-ipfs/updates" u "github.com/jbenet/go-ipfs/util" ) diff --git a/cmd/ipfs/version.go b/cmd/ipfs/version.go index 1c02bf69f..b0e5edcff 100644 --- a/cmd/ipfs/version.go +++ b/cmd/ipfs/version.go @@ -1,9 +1,10 @@ package main import ( - "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander" - updates "github.com/jbenet/go-ipfs/updates" + config "github.com/jbenet/go-ipfs/config" u "github.com/jbenet/go-ipfs/util" + + "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander" ) var cmdIpfsVersion = &commander.Command{ @@ -25,6 +26,6 @@ func versionCmd(c *commander.Command, _ []string) error { if !number { u.POut("ipfs version ") } - u.POut("%s\n", updates.Version) + u.POut("%s\n", config.CurrentVersionNumber) return nil } diff --git a/config/version.go b/config/version.go index 8fab91f2c..bbdcece3a 100644 --- a/config/version.go +++ b/config/version.go @@ -7,6 +7,9 @@ import ( "time" ) +// CurrentVersionNumber is the current application's version literal +const CurrentVersionNumber = "0.1.5" + // Version regulates checking if the most recent version is run type Version struct { // Current is the ipfs version for which config was generated diff --git a/net/handshake/handshake1.go b/net/handshake/handshake1.go index 4cfd89e3c..306c93390 100644 --- a/net/handshake/handshake1.go +++ b/net/handshake/handshake1.go @@ -4,15 +4,15 @@ import ( "errors" "fmt" + config "github.com/jbenet/go-ipfs/config" pb "github.com/jbenet/go-ipfs/net/handshake/pb" - updates "github.com/jbenet/go-ipfs/updates" semver "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/coreos/go-semver/semver" ) // ipfsVersion holds the current protocol version for a client running this code var ipfsVersion *semver.Version -var clientVersion = "go-ipfs/" + updates.Version +var clientVersion = "go-ipfs/" + config.CurrentVersionNumber func init() { var err error diff --git a/updates/updates.go b/updates/updates.go index c5315d947..e7b6054d9 100644 --- a/updates/updates.go +++ b/updates/updates.go @@ -5,7 +5,7 @@ import ( "os" "time" - "github.com/jbenet/go-ipfs/config" + config "github.com/jbenet/go-ipfs/config" u "github.com/jbenet/go-ipfs/util" semver "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/coreos/go-semver/semver" @@ -15,7 +15,7 @@ import ( const ( // Version is the current application's version literal - Version = "0.1.5" + Version = config.CurrentVersionNumber updateEndpointURL = "https://api.equinox.io/1/Updates" updateAppID = "ap_YM8nz6rGm1UPg_bf63Lw6Vjz49"