From ecd6f3b00c9a9f69b9c6c5f79bbed01057923337 Mon Sep 17 00:00:00 2001
From: Peter Borzov <peter@sowingo.com>
Date: Mon, 6 Oct 2014 15:48:57 -0400
Subject: [PATCH] Add Updates.Check field to Config

---
 .gitignore       | 2 ++
 cmd/ipfs/ipfs.go | 3 ++-
 config/config.go | 6 ++++++
 cpu.prof         | 0
 4 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100644 cpu.prof

diff --git a/.gitignore b/.gitignore
index fcbdfe803..db3980277 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
+cpu.prof # ipfs can generate profiling dump files
+
 *.swp
 .ipfsconfig
 *.out
diff --git a/cmd/ipfs/ipfs.go b/cmd/ipfs/ipfs.go
index e3d362913..f2a75c73a 100644
--- a/cmd/ipfs/ipfs.go
+++ b/cmd/ipfs/ipfs.go
@@ -67,7 +67,8 @@ var log = u.Logger("cmd/ipfs")
 func init() {
 	config, err := config.PathRoot()
 	if err != nil {
-		config = ""
+		u.POut("Failure initializing the default Config Directory: ", err)
+		os.Exit(1)
 	}
 	CmdIpfs.Flag.String("c", config, "specify config directory")
 }
diff --git a/config/config.go b/config/config.go
index 5acc23c4d..5ddc6bc2c 100644
--- a/config/config.go
+++ b/config/config.go
@@ -45,12 +45,18 @@ func (bp *BootstrapPeer) String() string {
 	return bp.Address + "/" + bp.PeerID
 }
 
+// Updates regulates checking and downloading for application's most recent version
+type Updates struct {
+	Check string // "ignore" for do not check, "warn" and "error" for reacting when obsolete
+}
+
 // Config is used to load IPFS config files.
 type Config struct {
 	Identity  Identity         // local node's peer identity
 	Datastore Datastore        // local node's storage
 	Addresses Addresses        // local node's addresses
 	Mounts    Mounts           // local node's mount points
+	Updates   Updates          // local node's version management
 	Bootstrap []*BootstrapPeer // local nodes's bootstrap peers
 }
 
diff --git a/cpu.prof b/cpu.prof
new file mode 100644
index 000000000..e69de29bb
-- 
GitLab