@cryptotaxi247 / kubo / commits / 7496df76d

vendor binary deps in test/dependencies

License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>

Jeromy committed Sep 10, 2015 at 18:09 UTC 7496df76d2ae6c731be12443312d3bdd9699850b
11 files changed +20 -18
Godeps/Godeps.json
+1 -9
@@ -1,6 +1,6 @@
1 {
2 "ImportPath": "github.com/ipfs/go-ipfs",
3 - "GoVersion": "go1.4.2",
3 + "GoVersion": "go1.5",
4 "Packages": [
5 "./..."
6 ],
@@ -43,10 +43,6 @@
43 "ImportPath": "github.com/cheggaaa/pb",
44 "Rev": "d7729fd7ec1372c15b83db39834bf842bf2d69fb"
45 },
46 - {
47 - "ImportPath": "github.com/chriscool/go-sleep",
48 - "Rev": "743ab5f1bb487edf1772bc29ca0bdf572b40785e"
49 - },
46 {
47 "ImportPath": "github.com/codahale/hdrhistogram",
48 "Rev": "5fd85ec0b4e2dd5d4158d257d943f2e586d86b62"
@@ -286,10 +282,6 @@
282 "ImportPath": "github.com/whyrusleeping/go-metrics",
283 "Rev": "1cd8009604ec2238b5a71305a0ecd974066e0e16"
284 },
289 - {
290 - "ImportPath": "github.com/whyrusleeping/iptb",
291 - "Rev": "3970c95a864f1a40037f796ff596607ce8ae43be"
292 - },
285 {
286 "ImportPath": "github.com/whyrusleeping/multiaddr-filter",
287 "Rev": "9e26222151125ecd3fc1fd190179b6bdd55f5608"
test/Makefile
+2 -2
@@ -5,9 +5,9 @@ IPFS_CMD = ../cmd/ipfs
5 RANDOM_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-random
6 RANDOM_FILES_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-random-files
7 MULTIHASH_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-multihash
8 -IPTB_SRC = ../Godeps/_workspace/src/github.com/whyrusleeping/iptb
8 +IPTB_SRC = ./dependencies/iptb
9 POLLENDPOINT_SRC= ../thirdparty/pollEndpoint
10 -GOSLEEP_SRC = ../Godeps/_workspace/src/github.com/chriscool/go-sleep
10 +GOSLEEP_SRC = ./dependencies/go-sleep
11
12 # User might want to override those on the command line
13 GOFLAGS =
test/dependencies/go-sleep/.gitignore new
+1
@@ -0,0 +1 @@
1 +go-sleep
test/dependencies/go-sleep/LICENSE renamed
test/dependencies/go-sleep/README.md renamed
test/dependencies/go-sleep/go-sleep.go renamed
test/dependencies/iptb/LICENSE renamed
test/dependencies/iptb/README.md renamed
+2
@@ -12,6 +12,8 @@ easy!
12 - -n=[number of nodes]
13 - -f : force overwriting of existing nodes
14 - -bootstrap : select bootstrapping style for cluster choices: star, none
15 + - -mdns=[true||false] : defaults to false
16 + - -p=[start port] : port to start allocations from
17 - start
18 - starts up all testbed nodes
19 - Options:
test/dependencies/iptb/lib/todo.go new
+3
@@ -0,0 +1,3 @@
1 +package iptb
2 +
3 +// TODO: move code here to be used as a lib
test/dependencies/iptb/main.go renamed
+11 -2
@@ -12,13 +12,15 @@ import (
12 "os/exec"
13 "path"
14 "strconv"
15 + "strings"
16 "sync"
17 "syscall"
18 "time"
19
20 + serial "github.com/ipfs/go-ipfs/repo/fsrepo/serialize"
21 +
22 ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
23 manet "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net"
21 - serial "github.com/ipfs/go-ipfs/repo/fsrepo/serialize"
24 )
25
26 // GetNumNodes returns the number of testbed nodes configured in the testbed directory
@@ -70,6 +72,7 @@ type initCfg struct {
72 Force bool
73 Bootstrap string
74 PortStart int
75 + Mdns bool
76 }
77
78 func (c *initCfg) swarmAddrForPeer(i int) string {
@@ -144,6 +147,7 @@ func starBootstrap(icfg *initCfg) error {
147 bcfg.Addresses.Swarm = []string{icfg.swarmAddrForPeer(0)}
148 bcfg.Addresses.API = icfg.apiAddrForPeer(0)
149 bcfg.Addresses.Gateway = ""
150 + bcfg.Discovery.MDNS.Enabled = icfg.Mdns
151 err = serial.WriteConfigFile(cfgpath, bcfg)
152 if err != nil {
153 return err
@@ -156,8 +160,11 @@ func starBootstrap(icfg *initCfg) error {
160 return err
161 }
162
159 - cfg.Bootstrap = []string{fmt.Sprintf("%s/ipfs/%s", bcfg.Addresses.Swarm[0], bcfg.Identity.PeerID)}
163 + ba := fmt.Sprintf("%s/ipfs/%s", bcfg.Addresses.Swarm[0], bcfg.Identity.PeerID)
164 + ba = strings.Replace(ba, "0.0.0.0", "127.0.0.1", -1)
165 + cfg.Bootstrap = []string{ba}
166 cfg.Addresses.Gateway = ""
167 + cfg.Discovery.MDNS.Enabled = icfg.Mdns
168 cfg.Addresses.Swarm = []string{
169 icfg.swarmAddrForPeer(i),
170 }
@@ -182,6 +189,7 @@ func clearBootstrapping(icfg *initCfg) error {
189 cfg.Addresses.Gateway = ""
190 cfg.Addresses.Swarm = []string{icfg.swarmAddrForPeer(i)}
191 cfg.Addresses.API = icfg.apiAddrForPeer(i)
192 + cfg.Discovery.MDNS.Enabled = icfg.Mdns
193 err = serial.WriteConfigFile(cfgpath, cfg)
194 if err != nil {
195 return err
@@ -440,6 +448,7 @@ func main() {
448 flag.IntVar(&cfg.Count, "n", 0, "number of ipfs nodes to initialize")
449 flag.IntVar(&cfg.PortStart, "p", 4002, "port to start allocations from")
450 flag.BoolVar(&cfg.Force, "f", false, "force initialization (overwrite existing configs)")
451 + flag.BoolVar(&cfg.Mdns, "mdns", false, "turn on mdns for nodes")
452 flag.StringVar(&cfg.Bootstrap, "bootstrap", "star", "select bootstrapping style for cluster")
453
454 wait := flag.Bool("wait", false, "wait for nodes to come fully online before exiting")
util/sadhack/godep.go
-5
@@ -4,11 +4,6 @@ package util
4 // Godep will drop it if we dont use it in ipfs. There should be a better way to do this.
5 import _ "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/dustin/go-humanize"
6
7 -// similar to the above, only used in the tests makefile
8 -import _ "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/whyrusleeping/iptb"
9 -
10 -import _ "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/chriscool/go-sleep"
11 -
7 // imported by chegga/pb on windows, this is here so running godeps on non-windows doesnt
8 // drop it from our vendoring
9 import _ "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/olekukonko/ts"