@cryptotaxi247 / kubo / commits / 025271002

remove Godeps

fixes #2722 License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>

Steven Allen committed Sep 7, 2018 at 15:01 UTC 0252710020e4b90aaf6a2f6e71486664e169a89b
43 files changed +42 -1884
Godeps/Godeps.json deleted
-53
@@ -1,53 +0,0 @@
1 -{
2 - "ImportPath": "github.com/ipfs/go-ipfs",
3 - "GoVersion": "go1.5.2",
4 - "Packages": [
5 - "./..."
6 - ],
7 - "Deps": [
8 - {
9 - "ImportPath": "bazil.org/fuse",
10 - "Rev": "e4fcc9a2c7567d1c42861deebeb483315d222262"
11 - },
12 - {
13 - "ImportPath": "github.com/camlistore/lock",
14 - "Rev": "ae27720f340952636b826119b58130b9c1a847a0"
15 - },
16 - {
17 - "ImportPath": "github.com/codahale/hdrhistogram",
18 - "Rev": "5fd85ec0b4e2dd5d4158d257d943f2e586d86b62"
19 - },
20 - {
21 - "ImportPath": "github.com/codahale/metrics",
22 - "Rev": "7c37910bc765e705301b159683480bdd44555c91"
23 - },
24 - {
25 - "ImportPath": "github.com/hashicorp/golang-lru",
26 - "Rev": "253b2dc1ca8bae42c3b5b6e53dd2eab1a7551116"
27 - },
28 - {
29 - "ImportPath": "github.com/jbenet/go-os-rename",
30 - "Rev": "3ac97f61ef67a6b87b95c1282f6c317ed0e693c2"
31 - },
32 - {
33 - "ImportPath": "github.com/jbenet/go-random",
34 - "Rev": "cd535bd25356746b9b1e824871dda7da932460e2"
35 - },
36 - {
37 - "ImportPath": "github.com/jbenet/go-random-files",
38 - "Rev": "737479700b40b4b50e914e963ce8d9d44603e3c8"
39 - },
40 - {
41 - "ImportPath": "github.com/mitchellh/go-homedir",
42 - "Rev": "1f6da4a72e57d4e7edd4a7295a585e0a3999a2d4"
43 - },
44 - {
45 - "ImportPath": "github.com/syndtr/gosnappy/snappy",
46 - "Rev": "156a073208e131d7d2e212cb749feae7c339e846"
47 - },
48 - {
49 - "ImportPath": "github.com/texttheater/golang-levenshtein/levenshtein",
50 - "Rev": "dfd657628c58d3eeaa26391097853b2473c8b94e"
51 - }
52 - ]
53 -}
Godeps/_workspace/src/github.com/hashicorp/golang-lru/.gitignore deleted
-23
@@ -1,23 +0,0 @@
1 -# Compiled Object files, Static and Dynamic libs (Shared Objects)
2 -*.o
3 -*.a
4 -*.so
5 -
6 -# Folders
7 -_obj
8 -_test
9 -
10 -# Architecture specific extensions/prefixes
11 -*.[568vq]
12 -[568vq].out
13 -
14 -*.cgo1.go
15 -*.cgo2.c
16 -_cgo_defun.c
17 -_cgo_gotypes.go
18 -_cgo_export.*
19 -
20 -_testmain.go
21 -
22 -*.exe
23 -*.test
Godeps/_workspace/src/github.com/hashicorp/golang-lru/LICENSE deleted
-362
@@ -1,362 +0,0 @@
1 -Mozilla Public License, version 2.0
2 -
3 -1. Definitions
4 -
5 -1.1. "Contributor"
6 -
7 - means each individual or legal entity that creates, contributes to the
8 - creation of, or owns Covered Software.
9 -
10 -1.2. "Contributor Version"
11 -
12 - means the combination of the Contributions of others (if any) used by a
13 - Contributor and that particular Contributor's Contribution.
14 -
15 -1.3. "Contribution"
16 -
17 - means Covered Software of a particular Contributor.
18 -
19 -1.4. "Covered Software"
20 -
21 - means Source Code Form to which the initial Contributor has attached the
22 - notice in Exhibit A, the Executable Form of such Source Code Form, and
23 - Modifications of such Source Code Form, in each case including portions
24 - thereof.
25 -
26 -1.5. "Incompatible With Secondary Licenses"
27 - means
28 -
29 - a. that the initial Contributor has attached the notice described in
30 - Exhibit B to the Covered Software; or
31 -
32 - b. that the Covered Software was made available under the terms of
33 - version 1.1 or earlier of the License, but not also under the terms of
34 - a Secondary License.
35 -
36 -1.6. "Executable Form"
37 -
38 - means any form of the work other than Source Code Form.
39 -
40 -1.7. "Larger Work"
41 -
42 - means a work that combines Covered Software with other material, in a
43 - separate file or files, that is not Covered Software.
44 -
45 -1.8. "License"
46 -
47 - means this document.
48 -
49 -1.9. "Licensable"
50 -
51 - means having the right to grant, to the maximum extent possible, whether
52 - at the time of the initial grant or subsequently, any and all of the
53 - rights conveyed by this License.
54 -
55 -1.10. "Modifications"
56 -
57 - means any of the following:
58 -
59 - a. any file in Source Code Form that results from an addition to,
60 - deletion from, or modification of the contents of Covered Software; or
61 -
62 - b. any new file in Source Code Form that contains any Covered Software.
63 -
64 -1.11. "Patent Claims" of a Contributor
65 -
66 - means any patent claim(s), including without limitation, method,
67 - process, and apparatus claims, in any patent Licensable by such
68 - Contributor that would be infringed, but for the grant of the License,
69 - by the making, using, selling, offering for sale, having made, import,
70 - or transfer of either its Contributions or its Contributor Version.
71 -
72 -1.12. "Secondary License"
73 -
74 - means either the GNU General Public License, Version 2.0, the GNU Lesser
75 - General Public License, Version 2.1, the GNU Affero General Public
76 - License, Version 3.0, or any later versions of those licenses.
77 -
78 -1.13. "Source Code Form"
79 -
80 - means the form of the work preferred for making modifications.
81 -
82 -1.14. "You" (or "Your")
83 -
84 - means an individual or a legal entity exercising rights under this
85 - License. For legal entities, "You" includes any entity that controls, is
86 - controlled by, or is under common control with You. For purposes of this
87 - definition, "control" means (a) the power, direct or indirect, to cause
88 - the direction or management of such entity, whether by contract or
89 - otherwise, or (b) ownership of more than fifty percent (50%) of the
90 - outstanding shares or beneficial ownership of such entity.
91 -
92 -
93 -2. License Grants and Conditions
94 -
95 -2.1. Grants
96 -
97 - Each Contributor hereby grants You a world-wide, royalty-free,
98 - non-exclusive license:
99 -
100 - a. under intellectual property rights (other than patent or trademark)
101 - Licensable by such Contributor to use, reproduce, make available,
102 - modify, display, perform, distribute, and otherwise exploit its
103 - Contributions, either on an unmodified basis, with Modifications, or
104 - as part of a Larger Work; and
105 -
106 - b. under Patent Claims of such Contributor to make, use, sell, offer for
107 - sale, have made, import, and otherwise transfer either its
108 - Contributions or its Contributor Version.
109 -
110 -2.2. Effective Date
111 -
112 - The licenses granted in Section 2.1 with respect to any Contribution
113 - become effective for each Contribution on the date the Contributor first
114 - distributes such Contribution.
115 -
116 -2.3. Limitations on Grant Scope
117 -
118 - The licenses granted in this Section 2 are the only rights granted under
119 - this License. No additional rights or licenses will be implied from the
120 - distribution or licensing of Covered Software under this License.
121 - Notwithstanding Section 2.1(b) above, no patent license is granted by a
122 - Contributor:
123 -
124 - a. for any code that a Contributor has removed from Covered Software; or
125 -
126 - b. for infringements caused by: (i) Your and any other third party's
127 - modifications of Covered Software, or (ii) the combination of its
128 - Contributions with other software (except as part of its Contributor
129 - Version); or
130 -
131 - c. under Patent Claims infringed by Covered Software in the absence of
132 - its Contributions.
133 -
134 - This License does not grant any rights in the trademarks, service marks,
135 - or logos of any Contributor (except as may be necessary to comply with
136 - the notice requirements in Section 3.4).
137 -
138 -2.4. Subsequent Licenses
139 -
140 - No Contributor makes additional grants as a result of Your choice to
141 - distribute the Covered Software under a subsequent version of this
142 - License (see Section 10.2) or under the terms of a Secondary License (if
143 - permitted under the terms of Section 3.3).
144 -
145 -2.5. Representation
146 -
147 - Each Contributor represents that the Contributor believes its
148 - Contributions are its original creation(s) or it has sufficient rights to
149 - grant the rights to its Contributions conveyed by this License.
150 -
151 -2.6. Fair Use
152 -
153 - This License is not intended to limit any rights You have under
154 - applicable copyright doctrines of fair use, fair dealing, or other
155 - equivalents.
156 -
157 -2.7. Conditions
158 -
159 - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
160 - Section 2.1.
161 -
162 -
163 -3. Responsibilities
164 -
165 -3.1. Distribution of Source Form
166 -
167 - All distribution of Covered Software in Source Code Form, including any
168 - Modifications that You create or to which You contribute, must be under
169 - the terms of this License. You must inform recipients that the Source
170 - Code Form of the Covered Software is governed by the terms of this
171 - License, and how they can obtain a copy of this License. You may not
172 - attempt to alter or restrict the recipients' rights in the Source Code
173 - Form.
174 -
175 -3.2. Distribution of Executable Form
176 -
177 - If You distribute Covered Software in Executable Form then:
178 -
179 - a. such Covered Software must also be made available in Source Code Form,
180 - as described in Section 3.1, and You must inform recipients of the
181 - Executable Form how they can obtain a copy of such Source Code Form by
182 - reasonable means in a timely manner, at a charge no more than the cost
183 - of distribution to the recipient; and
184 -
185 - b. You may distribute such Executable Form under the terms of this
186 - License, or sublicense it under different terms, provided that the
187 - license for the Executable Form does not attempt to limit or alter the
188 - recipients' rights in the Source Code Form under this License.
189 -
190 -3.3. Distribution of a Larger Work
191 -
192 - You may create and distribute a Larger Work under terms of Your choice,
193 - provided that You also comply with the requirements of this License for
194 - the Covered Software. If the Larger Work is a combination of Covered
195 - Software with a work governed by one or more Secondary Licenses, and the
196 - Covered Software is not Incompatible With Secondary Licenses, this
197 - License permits You to additionally distribute such Covered Software
198 - under the terms of such Secondary License(s), so that the recipient of
199 - the Larger Work may, at their option, further distribute the Covered
200 - Software under the terms of either this License or such Secondary
201 - License(s).
202 -
203 -3.4. Notices
204 -
205 - You may not remove or alter the substance of any license notices
206 - (including copyright notices, patent notices, disclaimers of warranty, or
207 - limitations of liability) contained within the Source Code Form of the
208 - Covered Software, except that You may alter any license notices to the
209 - extent required to remedy known factual inaccuracies.
210 -
211 -3.5. Application of Additional Terms
212 -
213 - You may choose to offer, and to charge a fee for, warranty, support,
214 - indemnity or liability obligations to one or more recipients of Covered
215 - Software. However, You may do so only on Your own behalf, and not on
216 - behalf of any Contributor. You must make it absolutely clear that any
217 - such warranty, support, indemnity, or liability obligation is offered by
218 - You alone, and You hereby agree to indemnify every Contributor for any
219 - liability incurred by such Contributor as a result of warranty, support,
220 - indemnity or liability terms You offer. You may include additional
221 - disclaimers of warranty and limitations of liability specific to any
222 - jurisdiction.
223 -
224 -4. Inability to Comply Due to Statute or Regulation
225 -
226 - If it is impossible for You to comply with any of the terms of this License
227 - with respect to some or all of the Covered Software due to statute,
228 - judicial order, or regulation then You must: (a) comply with the terms of
229 - this License to the maximum extent possible; and (b) describe the
230 - limitations and the code they affect. Such description must be placed in a
231 - text file included with all distributions of the Covered Software under
232 - this License. Except to the extent prohibited by statute or regulation,
233 - such description must be sufficiently detailed for a recipient of ordinary
234 - skill to be able to understand it.
235 -
236 -5. Termination
237 -
238 -5.1. The rights granted under this License will terminate automatically if You
239 - fail to comply with any of its terms. However, if You become compliant,
240 - then the rights granted under this License from a particular Contributor
241 - are reinstated (a) provisionally, unless and until such Contributor
242 - explicitly and finally terminates Your grants, and (b) on an ongoing
243 - basis, if such Contributor fails to notify You of the non-compliance by
244 - some reasonable means prior to 60 days after You have come back into
245 - compliance. Moreover, Your grants from a particular Contributor are
246 - reinstated on an ongoing basis if such Contributor notifies You of the
247 - non-compliance by some reasonable means, this is the first time You have
248 - received notice of non-compliance with this License from such
249 - Contributor, and You become compliant prior to 30 days after Your receipt
250 - of the notice.
251 -
252 -5.2. If You initiate litigation against any entity by asserting a patent
253 - infringement claim (excluding declaratory judgment actions,
254 - counter-claims, and cross-claims) alleging that a Contributor Version
255 - directly or indirectly infringes any patent, then the rights granted to
256 - You by any and all Contributors for the Covered Software under Section
257 - 2.1 of this License shall terminate.
258 -
259 -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
260 - license agreements (excluding distributors and resellers) which have been
261 - validly granted by You or Your distributors under this License prior to
262 - termination shall survive termination.
263 -
264 -6. Disclaimer of Warranty
265 -
266 - Covered Software is provided under this License on an "as is" basis,
267 - without warranty of any kind, either expressed, implied, or statutory,
268 - including, without limitation, warranties that the Covered Software is free
269 - of defects, merchantable, fit for a particular purpose or non-infringing.
270 - The entire risk as to the quality and performance of the Covered Software
271 - is with You. Should any Covered Software prove defective in any respect,
272 - You (not any Contributor) assume the cost of any necessary servicing,
273 - repair, or correction. This disclaimer of warranty constitutes an essential
274 - part of this License. No use of any Covered Software is authorized under
275 - this License except under this disclaimer.
276 -
277 -7. Limitation of Liability
278 -
279 - Under no circumstances and under no legal theory, whether tort (including
280 - negligence), contract, or otherwise, shall any Contributor, or anyone who
281 - distributes Covered Software as permitted above, be liable to You for any
282 - direct, indirect, special, incidental, or consequential damages of any
283 - character including, without limitation, damages for lost profits, loss of
284 - goodwill, work stoppage, computer failure or malfunction, or any and all
285 - other commercial damages or losses, even if such party shall have been
286 - informed of the possibility of such damages. This limitation of liability
287 - shall not apply to liability for death or personal injury resulting from
288 - such party's negligence to the extent applicable law prohibits such
289 - limitation. Some jurisdictions do not allow the exclusion or limitation of
290 - incidental or consequential damages, so this exclusion and limitation may
291 - not apply to You.
292 -
293 -8. Litigation
294 -
295 - Any litigation relating to this License may be brought only in the courts
296 - of a jurisdiction where the defendant maintains its principal place of
297 - business and such litigation shall be governed by laws of that
298 - jurisdiction, without reference to its conflict-of-law provisions. Nothing
299 - in this Section shall prevent a party's ability to bring cross-claims or
300 - counter-claims.
301 -
302 -9. Miscellaneous
303 -
304 - This License represents the complete agreement concerning the subject
305 - matter hereof. If any provision of this License is held to be
306 - unenforceable, such provision shall be reformed only to the extent
307 - necessary to make it enforceable. Any law or regulation which provides that
308 - the language of a contract shall be construed against the drafter shall not
309 - be used to construe this License against a Contributor.
310 -
311 -
312 -10. Versions of the License
313 -
314 -10.1. New Versions
315 -
316 - Mozilla Foundation is the license steward. Except as provided in Section
317 - 10.3, no one other than the license steward has the right to modify or
318 - publish new versions of this License. Each version will be given a
319 - distinguishing version number.
320 -
321 -10.2. Effect of New Versions
322 -
323 - You may distribute the Covered Software under the terms of the version
324 - of the License under which You originally received the Covered Software,
325 - or under the terms of any subsequent version published by the license
326 - steward.
327 -
328 -10.3. Modified Versions
329 -
330 - If you create software not governed by this License, and you want to
331 - create a new license for such software, you may create and use a
332 - modified version of this License if you rename the license and remove
333 - any references to the name of the license steward (except to note that
334 - such modified license differs from this License).
335 -
336 -10.4. Distributing Source Code Form that is Incompatible With Secondary
337 - Licenses If You choose to distribute Source Code Form that is
338 - Incompatible With Secondary Licenses under the terms of this version of
339 - the License, the notice described in Exhibit B of this License must be
340 - attached.
341 -
342 -Exhibit A - Source Code Form License Notice
343 -
344 - This Source Code Form is subject to the
345 - terms of the Mozilla Public License, v.
346 - 2.0. If a copy of the MPL was not
347 - distributed with this file, You can
348 - obtain one at
349 - http://mozilla.org/MPL/2.0/.
350 -
351 -If it is not possible or desirable to put the notice in a particular file,
352 -then You may include the notice in a location (such as a LICENSE file in a
353 -relevant directory) where a recipient would be likely to look for such a
354 -notice.
355 -
356 -You may add additional accurate notices of copyright ownership.
357 -
358 -Exhibit B - "Incompatible With Secondary Licenses" Notice
359 -
360 - This Source Code Form is "Incompatible
361 - With Secondary Licenses", as defined by
362 - the Mozilla Public License, v. 2.0.
Godeps/_workspace/src/github.com/hashicorp/golang-lru/README.md deleted
-25
@@ -1,25 +0,0 @@
1 -golang-lru
2 -==========
3 -
4 -This provides the `lru` package which implements a fixed-size
5 -thread safe LRU cache. It is based on the cache in Groupcache.
6 -
7 -Documentation
8 -=============
9 -
10 -Full docs are available on [Godoc](http://godoc.org/github.com/hashicorp/golang-lru)
11 -
12 -Example
13 -=======
14 -
15 -Using the LRU is very simple:
16 -
17 -```go
18 -l, _ := New(128)
19 -for i := 0; i < 256; i++ {
20 - l.Add(i, nil)
21 -}
22 -if l.Len() != 128 {
23 - panic("bad len: %v", l.Len())
24 -}
25 -```
Godeps/_workspace/src/github.com/hashicorp/golang-lru/lru.go deleted
-134
@@ -1,134 +0,0 @@
1 -// This package provides a simple LRU cache. It is based on the
2 -// LRU implementation in groupcache:
3 -// https://github.com/golang/groupcache/tree/master/lru
4 -package lru
5 -
6 -import (
7 - "container/list"
8 - "errors"
9 - "sync"
10 -)
11 -
12 -// Cache is a thread-safe fixed size LRU cache.
13 -type Cache struct {
14 - size int
15 - evictList *list.List
16 - items map[interface{}]*list.Element
17 - lock sync.Mutex
18 -}
19 -
20 -// entry is used to hold a value in the evictList
21 -type entry struct {
22 - key interface{}
23 - value interface{}
24 -}
25 -
26 -// New creates an LRU of the given size
27 -func New(size int) (*Cache, error) {
28 - if size <= 0 {
29 - return nil, errors.New("Must provide a positive size")
30 - }
31 - c := &Cache{
32 - size: size,
33 - evictList: list.New(),
34 - items: make(map[interface{}]*list.Element, size),
35 - }
36 - return c, nil
37 -}
38 -
39 -// Purge is used to completely clear the cache
40 -func (c *Cache) Purge() {
41 - c.lock.Lock()
42 - defer c.lock.Unlock()
43 - c.evictList = list.New()
44 - c.items = make(map[interface{}]*list.Element, c.size)
45 -}
46 -
47 -// Add adds a value to the cache.
48 -func (c *Cache) Add(key, value interface{}) {
49 - c.lock.Lock()
50 - defer c.lock.Unlock()
51 -
52 - // Check for existing item
53 - if ent, ok := c.items[key]; ok {
54 - c.evictList.MoveToFront(ent)
55 - ent.Value.(*entry).value = value
56 - return
57 - }
58 -
59 - // Add new item
60 - ent := &entry{key, value}
61 - entry := c.evictList.PushFront(ent)
62 - c.items[key] = entry
63 -
64 - // Verify size not exceeded
65 - if c.evictList.Len() > c.size {
66 - c.removeOldest()
67 - }
68 -}
69 -
70 -// Get looks up a key's value from the cache.
71 -func (c *Cache) Get(key interface{}) (value interface{}, ok bool) {
72 - c.lock.Lock()
73 - defer c.lock.Unlock()
74 -
75 - if ent, ok := c.items[key]; ok {
76 - c.evictList.MoveToFront(ent)
77 - return ent.Value.(*entry).value, true
78 - }
79 - return
80 -}
81 -
82 -// Remove removes the provided key from the cache.
83 -func (c *Cache) Remove(key interface{}) {
84 - c.lock.Lock()
85 - defer c.lock.Unlock()
86 -
87 - if ent, ok := c.items[key]; ok {
88 - c.removeElement(ent)
89 - }
90 -}
91 -
92 -// RemoveOldest removes the oldest item from the cache.
93 -func (c *Cache) RemoveOldest() {
94 - c.lock.Lock()
95 - defer c.lock.Unlock()
96 - c.removeOldest()
97 -}
98 -
99 -// Keys returns a slice of the keys in the cache.
100 -func (c *Cache) Keys() []interface{} {
101 - c.lock.Lock()
102 - defer c.lock.Unlock()
103 -
104 - keys := make([]interface{}, len(c.items))
105 - i := 0
106 - for k := range c.items {
107 - keys[i] = k
108 - i++
109 - }
110 -
111 - return keys
112 -}
113 -
114 -// removeOldest removes the oldest item from the cache.
115 -func (c *Cache) removeOldest() {
116 - ent := c.evictList.Back()
117 - if ent != nil {
118 - c.removeElement(ent)
119 - }
120 -}
121 -
122 -// removeElement is used to remove a given list element from the cache
123 -func (c *Cache) removeElement(e *list.Element) {
124 - c.evictList.Remove(e)
125 - kv := e.Value.(*entry)
126 - delete(c.items, kv.key)
127 -}
128 -
129 -// Len returns the number of items in the cache.
130 -func (c *Cache) Len() int {
131 - c.lock.Lock()
132 - defer c.lock.Unlock()
133 - return c.evictList.Len()
134 -}
Godeps/_workspace/src/github.com/hashicorp/golang-lru/lru_test.go deleted
-48
@@ -1,48 +0,0 @@
1 -package lru
2 -
3 -import "testing"
4 -
5 -func TestLRU(t *testing.T) {
6 - l, err := New(128)
7 - if err != nil {
8 - t.Fatalf("err: %v", err)
9 - }
10 - for i := 0; i < 256; i++ {
11 - l.Add(i, i)
12 - }
13 - if l.Len() != 128 {
14 - t.Fatalf("bad len: %v", l.Len())
15 - }
16 - for _, k := range l.Keys() {
17 - if v, ok := l.Get(k); !ok || v != k {
18 - t.Fatalf("bad key: %v", k)
19 - }
20 - }
21 - for i := 0; i < 128; i++ {
22 - _, ok := l.Get(i)
23 - if ok {
24 - t.Fatalf("should be evicted")
25 - }
26 - }
27 - for i := 128; i < 256; i++ {
28 - _, ok := l.Get(i)
29 - if !ok {
30 - t.Fatalf("should not be evicted")
31 - }
32 - }
33 - for i := 128; i < 192; i++ {
34 - l.Remove(i)
35 - _, ok := l.Get(i)
36 - if ok {
37 - t.Fatalf("should be deleted")
38 - }
39 - }
40 -
41 - l.Purge()
42 - if l.Len() != 0 {
43 - t.Fatalf("bad len: %v", l.Len())
44 - }
45 - if _, ok := l.Get(200); ok {
46 - t.Fatalf("should contain nothing")
47 - }
48 -}
Godeps/_workspace/src/github.com/jbenet/go-random-files/LICENSE deleted
-21
@@ -1,21 +0,0 @@
1 -The MIT License (MIT)
2 -
3 -Copyright (c) 2014 Juan Batiz-Benet
4 -
5 -Permission is hereby granted, free of charge, to any person obtaining a copy
6 -of this software and associated documentation files (the "Software"), to deal
7 -in the Software without restriction, including without limitation the rights
8 -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 -copies of the Software, and to permit persons to whom the Software is
10 -furnished to do so, subject to the following conditions:
11 -
12 -The above copyright notice and this permission notice shall be included in
13 -all copies or substantial portions of the Software.
14 -
15 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 -THE SOFTWARE.
Godeps/_workspace/src/github.com/jbenet/go-random-files/Makefile deleted
-5
@@ -1,5 +0,0 @@
1 -build:
2 - cd random-files && go build
3 -
4 -install:
5 - cd random-files && go install
Godeps/_workspace/src/github.com/jbenet/go-random-files/README.md deleted
-108
@@ -1,108 +0,0 @@
1 -# go-random-files - create random fs hierarchies
2 -
3 -Useful for testing filesystems.
4 -
5 -
6 -```
7 -# library
8 -go get -u github.com/jbenet/go-random-files
9 -
10 -# binary
11 -go get -u github.com/jbenet/go-random-files/random-files
12 -```
13 -
14 -### Library godoc: https://godoc.org/github.com/jbenet/go-random-files
15 -
16 -# random-files - create random fs hierarchies
17 -
18 -See more about the binary at: github.com/jbenet/go-random-files/tree/master/random-files
19 -
20 -Useful for testing filesystems.
21 -
22 -## Install
23 -
24 -```
25 -go get -u github.com/jbenet/go-random-files/random-files
26 -```
27 -
28 -## Usage
29 -
30 -```sh
31 -> random-files --help
32 -usage: random-files [options] <path>...
33 -Write a random filesystem hierarchy to each <path>
34 -
35 -Options:
36 - -alphabet="easy": alphabet for filenames {easy, hard}
37 - -depth=2: fanout depth - how deep the hierarchy goes
38 - -dirs=5: fanout dirs - number of dirs per dir (or max)
39 - -files=10: fanout files - number of files per dir (or max
40 - -filesize=4096: filesize - how big to make each file (or max)
41 - -q=false: quiet output
42 - -random-crypto=false: use cryptographic randomness for files
43 - -random-fanout=false: randomize fanout numbers
44 - -random-size=true: randomize filesize
45 - -seed=0: random seed - 0 for current time
46 -```
47 -
48 -### Examples
49 -
50 -```sh
51 -> random-files --depth=2 --files=3 foo
52 -foo/h20uo3jrpihb
53 -foo/x6tef1
54 -foo/jh0c2vdci
55 -foo/fden012m368
56 -foo/fden012m368/p6n0chy4kg
57 -foo/fden012m368/h92_
58 -foo/fden012m368/kvjiya98p3
59 -foo/e_i6hwav1tb
60 -foo/e_i6hwav1tb/oj0-a
61 -foo/e_i6hwav1tb/1-pfgvim
62 -foo/e_i6hwav1tb/s_unf
63 -foo/bgvy8x-_hsm
64 -foo/bgvy8x-_hsm/98zcoz-9ng
65 -foo/bgvy8x-_hsm/j0see3qv
66 -foo/bgvy8x-_hsm/qntuf0r
67 -foo/6zjkw3ejm2awwt
68 -foo/6zjkw3ejm2awwt/iba52dh1lhnewh
69 -foo/6zjkw3ejm2awwt/n1bwcv5zpe
70 -foo/6zjkw3ejm2awwt/o8k89cc
71 -foo/efp_6
72 -foo/efp_6/qfap2
73 -foo/efp_6/v_kl_wlefsaa
74 -foo/efp_6/r7sdbph
75 -```
76 -
77 -It made:
78 -
79 -```
80 -> tree foo
81 -foo
82 -├── 6zjkw3ejm2awwt
83 -│   ├── iba52dh1lhnewh
84 -│   ├── n1bwcv5zpe
85 -│   └── o8k89cc
86 -├── bgvy8x-_hsm
87 -│   ├── 98zcoz-9ng
88 -│   ├── j0see3qv
89 -│   └── qntuf0r
90 -├── e_i6hwav1tb
91 -│   ├── 1-pfgvim
92 -│   ├── oj0-a
93 -│   └── s_unf
94 -├── efp_6
95 -│   ├── qfap2
96 -│   ├── r7sdbph
97 -│   └── v_kl_wlefsaa
98 -├── fden012m368
99 -│   ├── h92_
100 -│   ├── kvjiya98p3
101 -│   └── p6n0chy4kg
102 -├── h20uo3jrpihb
103 -├── jh0c2vdci
104 -└── x6tef1
105 -
106 -5 directories, 18 files
107 -```
108 -
Godeps/_workspace/src/github.com/jbenet/go-random-files/lib.go deleted
-110
@@ -1,110 +0,0 @@
1 -package randomfiles
2 -
3 -import (
4 - "fmt"
5 - "io"
6 - "math/rand"
7 - "os"
8 - "path"
9 -)
10 -
11 -type Options struct {
12 - Out io.Writer // output progress
13 - Source io.Reader // randomness source
14 -
15 - FileSize int // the size per file.
16 - Alphabet []rune // for filenames
17 -
18 - FanoutDepth int // how deep the hierarchy goes
19 - FanoutFiles int // how many files per dir
20 - FanoutDirs int // how many dirs per dir
21 -
22 - RandomSeed int64 // use a random seed. if 0, use a random seed
23 - RandomSize bool // randomize file sizes
24 - RandomFanout bool // randomize fanout numbers
25 -}
26 -
27 -func WriteRandomFiles(root string, depth int, opts *Options) error {
28 -
29 - numfiles := opts.FanoutFiles
30 - if opts.RandomFanout {
31 - numfiles = rand.Intn(numfiles) + 1
32 - }
33 -
34 - for i := 0; i < numfiles; i++ {
35 - if err := WriteRandomFile(root, opts); err != nil {
36 - return err
37 - }
38 - }
39 -
40 - if depth+1 <= opts.FanoutDepth {
41 - numdirs := opts.FanoutDirs
42 - if opts.RandomFanout {
43 - numdirs = rand.Intn(numdirs) + 1
44 - }
45 -
46 - for i := 0; i < numdirs; i++ {
47 - if err := WriteRandomDir(root, depth+1, opts); err != nil {
48 - return err
49 - }
50 - }
51 - }
52 -
53 - return nil
54 -}
55 -
56 -var FilenameSize = 16
57 -var RunesEasy = []rune("abcdefghijklmnopqrstuvwxyz01234567890-_")
58 -var RunesHard = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890!@#$%^&*()-_+= ;.,<>'\"[]{}() ")
59 -
60 -func RandomFilename(length int, alphabet []rune) string {
61 - b := make([]rune, length)
62 - for i := range b {
63 - b[i] = alphabet[rand.Intn(len(alphabet))]
64 - }
65 - return string(b)
66 -}
67 -
68 -func WriteRandomFile(root string, opts *Options) error {
69 - filesize := int64(opts.FileSize)
70 - if opts.RandomSize {
71 - filesize = rand.Int63n(filesize) + 1
72 - }
73 -
74 - n := rand.Intn(FilenameSize-4) + 4
75 - name := RandomFilename(n, opts.Alphabet)
76 - filepath := path.Join(root, name)
77 - f, err := os.Create(filepath)
78 - if err != nil {
79 - return err
80 - }
81 -
82 - if _, err := io.CopyN(f, opts.Source, filesize); err != nil {
83 - return err
84 - }
85 -
86 - if opts.Out != nil {
87 - fmt.Fprintln(opts.Out, filepath)
88 - }
89 -
90 - return f.Close()
91 -}
92 -
93 -func WriteRandomDir(root string, depth int, opts *Options) error {
94 - if depth > opts.FanoutDepth {
95 - return nil
96 - }
97 -
98 - n := rand.Intn(FilenameSize-4) + 4
99 - name := RandomFilename(n, opts.Alphabet)
100 - root = path.Join(root, name)
101 - if err := os.MkdirAll(root, 0755); err != nil {
102 - return err
103 - }
104 -
105 - if opts.Out != nil {
106 - fmt.Fprintln(opts.Out, root)
107 - }
108 -
109 - return WriteRandomFiles(root, depth, opts)
110 -}
Godeps/_workspace/src/github.com/jbenet/go-random-files/random-files/.gitignore deleted
-1
@@ -1 +0,0 @@
1 -random-files
Godeps/_workspace/src/github.com/jbenet/go-random-files/random-files/README.md deleted
-90
@@ -1,90 +0,0 @@
1 -# random-files - create random fs hierarchies
2 -
3 -random-files creates random fs hierarchies. Useful for testing filesystems.
4 -
5 -## Install
6 -
7 -```
8 -go get -u github.com/jbenet/go-random-files/random-files
9 -```
10 -
11 -## Usage
12 -
13 -```sh
14 -> random-files --help
15 -usage: random-files [options] <path>...
16 -Write a random filesystem hierarchy to each <path>
17 -
18 -Options:
19 - -alphabet="easy": alphabet for filenames {easy, hard}
20 - -depth=2: fanout depth - how deep the hierarchy goes
21 - -dirs=5: fanout dirs - number of dirs per dir (or max)
22 - -files=10: fanout files - number of files per dir (or max
23 - -filesize=4096: filesize - how big to make each file (or max)
24 - -q=false: quiet output
25 - -random-crypto=false: use cryptographic randomness for files
26 - -random-fanout=false: randomize fanout numbers
27 - -random-size=true: randomize filesize
28 - -seed=0: random seed - 0 for current time
29 -```
30 -
31 -## Examples
32 -
33 -```sh
34 -> random-files --depth=2 --files=3 foo
35 -foo/h20uo3jrpihb
36 -foo/x6tef1
37 -foo/jh0c2vdci
38 -foo/fden012m368
39 -foo/fden012m368/p6n0chy4kg
40 -foo/fden012m368/h92_
41 -foo/fden012m368/kvjiya98p3
42 -foo/e_i6hwav1tb
43 -foo/e_i6hwav1tb/oj0-a
44 -foo/e_i6hwav1tb/1-pfgvim
45 -foo/e_i6hwav1tb/s_unf
46 -foo/bgvy8x-_hsm
47 -foo/bgvy8x-_hsm/98zcoz-9ng
48 -foo/bgvy8x-_hsm/j0see3qv
49 -foo/bgvy8x-_hsm/qntuf0r
50 -foo/6zjkw3ejm2awwt
51 -foo/6zjkw3ejm2awwt/iba52dh1lhnewh
52 -foo/6zjkw3ejm2awwt/n1bwcv5zpe
53 -foo/6zjkw3ejm2awwt/o8k89cc
54 -foo/efp_6
55 -foo/efp_6/qfap2
56 -foo/efp_6/v_kl_wlefsaa
57 -foo/efp_6/r7sdbph
58 -```
59 -
60 -It made:
61 -
62 -```
63 -> tree foo
64 -foo
65 -├── 6zjkw3ejm2awwt
66 -│   ├── iba52dh1lhnewh
67 -│   ├── n1bwcv5zpe
68 -│   └── o8k89cc
69 -├── bgvy8x-_hsm
70 -│   ├── 98zcoz-9ng
71 -│   ├── j0see3qv
72 -│   └── qntuf0r
73 -├── e_i6hwav1tb
74 -│   ├── 1-pfgvim
75 -│   ├── oj0-a
76 -│   └── s_unf
77 -├── efp_6
78 -│   ├── qfap2
79 -│   ├── r7sdbph
80 -│   └── v_kl_wlefsaa
81 -├── fden012m368
82 -│   ├── h92_
83 -│   ├── kvjiya98p3
84 -│   └── p6n0chy4kg
85 -├── h20uo3jrpihb
86 -├── jh0c2vdci
87 -└── x6tef1
88 -
89 -5 directories, 18 files
90 -```
Godeps/_workspace/src/github.com/jbenet/go-random-files/random-files/main.go deleted
-119
@@ -1,119 +0,0 @@
1 -package main
2 -
3 -import (
4 - crand "crypto/rand"
5 - "errors"
6 - "flag"
7 - "fmt"
8 - "math/rand"
9 - "os"
10 - "time"
11 -
12 - randomfiles "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-random-files"
13 - ringreader "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-random-files/ringreader"
14 -)
15 -
16 -var usage = `usage: %s [options] <path>...
17 -Write a random filesystem hierarchy to each <path>
18 -
19 -Options:
20 -`
21 -
22 -// flags
23 -var opts randomfiles.Options
24 -var quiet bool
25 -var alphabet string
26 -var paths []string
27 -var cryptorand bool
28 -
29 -func init() {
30 - flag.Usage = func() {
31 - fmt.Fprintf(os.Stderr, usage, os.Args[0])
32 - flag.PrintDefaults()
33 - }
34 -
35 - flag.BoolVar(&quiet, "q", false, "quiet output")
36 - flag.BoolVar(&cryptorand, "random-crypto", false, "use cryptographic randomness for files")
37 - flag.StringVar(&alphabet, "alphabet", "easy", "alphabet for filenames {easy, hard}")
38 - flag.IntVar(&opts.FileSize, "filesize", 4096, "filesize - how big to make each file (or max)")
39 -
40 - flag.IntVar(&opts.FanoutDepth, "depth", 2, "fanout depth - how deep the hierarchy goes")
41 - flag.IntVar(&opts.FanoutDirs, "dirs", 5, "fanout dirs - number of dirs per dir (or max)")
42 - flag.IntVar(&opts.FanoutFiles, "files", 10, "fanout files - number of files per dir (or max")
43 -
44 - flag.Int64Var(&opts.RandomSeed, "seed", 0, "random seed - 0 for current time")
45 - flag.BoolVar(&opts.RandomFanout, "random-fanout", false, "randomize fanout numbers")
46 - flag.BoolVar(&opts.RandomSize, "random-size", true, "randomize filesize")
47 -}
48 -
49 -func parseArgs() error {
50 - flag.Parse()
51 -
52 - switch alphabet {
53 - case "easy":
54 - opts.Alphabet = randomfiles.RunesEasy
55 - case "hard":
56 - opts.Alphabet = randomfiles.RunesHard
57 - default:
58 - return errors.New("alphabet must be one of: easy, hard")
59 - }
60 -
61 - paths = flag.Args()
62 - if len(paths) < 1 {
63 - flag.Usage()
64 - os.Exit(0)
65 - }
66 -
67 - if !quiet {
68 - opts.Out = os.Stdout
69 - }
70 -
71 - switch opts.RandomSeed {
72 - case 0:
73 - rand.Seed(time.Now().UnixNano())
74 - default:
75 - rand.Seed(opts.RandomSeed)
76 - }
77 -
78 - // prepare randomn source.
79 - if cryptorand {
80 - opts.Source = crand.Reader
81 - } else {
82 - // if not crypto, we don't need a lot of random
83 - // data. we just need to sample from a sequence.
84 - s := 16777216 // 16MB
85 - r, err := ringreader.NewReader(s)
86 - if err != nil {
87 - return err
88 - }
89 - opts.Source = r
90 - }
91 -
92 - return nil
93 -}
94 -
95 -func run() error {
96 - if err := parseArgs(); err != nil {
97 - return err
98 - }
99 -
100 - for _, root := range paths {
101 - if err := os.MkdirAll(root, 0755); err != nil {
102 - return err
103 - }
104 -
105 - err := randomfiles.WriteRandomFiles(root, 1, &opts)
106 - if err != nil {
107 - return err
108 - }
109 - }
110 -
111 - return nil
112 -}
113 -
114 -func main() {
115 - if err := run(); err != nil {
116 - fmt.Fprintln(os.Stderr, "error:", err)
117 - os.Exit(1)
118 - }
119 -}
Godeps/_workspace/src/github.com/jbenet/go-random-files/ringreader/ringreader.go deleted
-40
@@ -1,40 +0,0 @@
1 -package ringreader
2 -
3 -import (
4 - "bytes"
5 - "fmt"
6 - "math/rand"
7 -
8 - random "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-random"
9 -)
10 -
11 -type Reader struct {
12 - Buf []byte
13 -}
14 -
15 -func NewReader(bufsize int) (*Reader, error) {
16 - buf := bytes.NewBuffer(nil)
17 - err := random.WritePseudoRandomBytes(int64(bufsize), buf, rand.Int63())
18 - return &Reader{Buf: buf.Bytes()}, err
19 -}
20 -
21 -func (r *Reader) Read(buf []byte) (n int, err error) {
22 - ibufl := len(r.Buf)
23 - left := len(buf)
24 - copied := 0
25 -
26 - for copied < left {
27 - pos1 := rand.Intn(len(r.Buf))
28 - pos2 := pos1 + left
29 - if pos2 > ibufl {
30 - pos2 = ibufl
31 - }
32 - copied += copy(buf[copied:], r.Buf[pos1:pos2])
33 - }
34 -
35 - if copied != left {
36 - err := fmt.Errorf("copied a different ammount: %d != %d", copied, left)
37 - panic(err.Error())
38 - }
39 - return copied, nil
40 -}
Godeps/_workspace/src/github.com/jbenet/go-random-files/ringreader/ringreader_test.go deleted
-22
@@ -1,22 +0,0 @@
1 -package ringreader
2 -
3 -import (
4 - "testing"
5 -)
6 -
7 -func TestRingReader(t *testing.T) {
8 - r, _ := NewReader(256)
9 - t.Log("buffer:", r.Buf)
10 -
11 - for i := 1; i < 1048576; i = i * 2 {
12 - buf := make([]byte, i)
13 - n, err := r.Read(buf)
14 - if err != nil {
15 - t.Error(err)
16 - }
17 - if n != len(buf) {
18 - t.Error("did not read %d bytes", n)
19 - }
20 - t.Log("read:", buf)
21 - }
22 -}
Godeps/_workspace/src/github.com/jbenet/go-random/.travis.yml deleted
-12
@@ -1,12 +0,0 @@
1 -language: go
2 -
3 -go:
4 - - 1.3
5 - - release
6 - - tip
7 -
8 -script:
9 - - go test -race -cpu=5 -v ./...
10 - - cd random && go build
11 -
12 -env: TEST_VERBOSE=1
Godeps/_workspace/src/github.com/jbenet/go-random/LICENSE deleted
-21
@@ -1,21 +0,0 @@
1 -The MIT License (MIT)
2 -
3 -Copyright (c) 2014 Juan Batiz-Benet
4 -
5 -Permission is hereby granted, free of charge, to any person obtaining a copy
6 -of this software and associated documentation files (the "Software"), to deal
7 -in the Software without restriction, including without limitation the rights
8 -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 -copies of the Software, and to permit persons to whom the Software is
10 -furnished to do so, subject to the following conditions:
11 -
12 -The above copyright notice and this permission notice shall be included in
13 -all copies or substantial portions of the Software.
14 -
15 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 -THE SOFTWARE.
Godeps/_workspace/src/github.com/jbenet/go-random/README.md deleted
-29
@@ -1,29 +0,0 @@
1 -# go-random outputs randomness
2 -
3 -This is a unix util that outputs randomness.
4 -It is a thin wrapper around `crypto/rand`.
5 -It aims to be portable (though it may not yet be).
6 -
7 -### Install
8 -
9 -```sh
10 -go install github.com/jbenet/go-random/random
11 -```
12 -
13 -(The extra /random is there because go get is stupidly too proscriptive about
14 -package/repository names and I don't yet know how to change the default binary
15 -output name)
16 -
17 -### Usage:
18 -
19 -```
20 -> random
21 -Usage: random <int>
22 -Print <int> random bytes (from Go's crypto/rand)
23 -> random 6
24 -2q���#
25 -```
26 -
27 -### License
28 -
29 -MIT
Godeps/_workspace/src/github.com/jbenet/go-random/lib.go deleted
-47
@@ -1,47 +0,0 @@
1 -package random
2 -
3 -import (
4 - "bytes"
5 - randcrypto "crypto/rand"
6 - "io"
7 - randmath "math/rand"
8 -)
9 -
10 -func WriteRandomBytes(count int64, w io.Writer) error {
11 - r := &io.LimitedReader{R: randcrypto.Reader, N: count}
12 - _, err := io.Copy(w, r)
13 - return err
14 -}
15 -
16 -func WritePseudoRandomBytes(count int64, w io.Writer, seed int64) error {
17 - randmath.Seed(seed)
18 -
19 - // Configurable buffer size
20 - bufsize := int64(1024 * 1024 * 4)
21 - b := make([]byte, bufsize)
22 -
23 - for count > 0 {
24 - if bufsize > count {
25 - bufsize = count
26 - b = b[:bufsize]
27 - }
28 -
29 - var n uint32
30 - for i := int64(0); i < bufsize; {
31 - n = randmath.Uint32()
32 - for j := 0; j < 4 && i < bufsize; j++ {
33 - b[i] = byte(n & 0xff)
34 - n >>= 8
35 - i++
36 - }
37 - }
38 - count = count - bufsize
39 -
40 - r := bytes.NewReader(b)
41 - _, err := io.Copy(w, r)
42 - if err != nil {
43 - return err
44 - }
45 - }
46 - return nil
47 -}
Godeps/_workspace/src/github.com/jbenet/go-random/random/.gitignore deleted
-1
@@ -1 +0,0 @@
1 -random
Godeps/_workspace/src/github.com/jbenet/go-random/random/random.go deleted
-49
@@ -1,49 +0,0 @@
1 -package main
2 -
3 -import (
4 - "fmt"
5 - "os"
6 - "strconv"
7 -
8 - random "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-random"
9 - "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize"
10 -)
11 -
12 -func main() {
13 - l := len(os.Args)
14 - if l != 2 && l != 3 {
15 - usageError()
16 - }
17 -
18 - countuint64, err := humanize.ParseBytes(os.Args[1])
19 - if err != nil {
20 - usageError()
21 - }
22 - count := int64(countuint64)
23 -
24 - if l == 2 {
25 - err = random.WriteRandomBytes(count, os.Stdout)
26 - } else {
27 - seed, err2 := strconv.ParseInt(os.Args[2], 10, 64)
28 - if err2 != nil {
29 - usageError()
30 - }
31 - err = random.WritePseudoRandomBytes(count, os.Stdout, seed)
32 - }
33 -
34 - if err != nil {
35 - die(err)
36 - }
37 -}
38 -
39 -func usageError() {
40 - fmt.Fprintf(os.Stderr, "Usage: %s <count> [<seed>]\n", os.Args[0])
41 - fmt.Fprintf(os.Stderr, "If <seed> is given, output <count> pseudo random bytes made from <seed> (from Go's math/rand)\n")
42 - fmt.Fprintf(os.Stderr, "Otherwise, output <count> random bytes (from Go's crypto/rand)\n")
43 - os.Exit(-1)
44 -}
45 -
46 -func die(err error) {
47 - fmt.Fprintf(os.Stderr, "Error: %v", err)
48 - os.Exit(-1)
49 -}
Godeps/_workspace/src/github.com/jbenet/go-random/random_test.go deleted
-96
@@ -1,96 +0,0 @@
1 -package random
2 -
3 -import (
4 - "bytes"
5 - "io/ioutil"
6 - "testing"
7 - "time"
8 -)
9 -
10 -func TestPseudoRandom(t *testing.T) {
11 -
12 - var testCases = []int{
13 - 1024,
14 - 187654,
15 - 1048576,
16 - 4932132,
17 - }
18 -
19 - for _, size := range testCases {
20 - var buf bytes.Buffer
21 - err := WritePseudoRandomBytes(int64(size), &buf, int64(time.Now().UnixNano()))
22 - if err != nil {
23 - t.Fatal(err)
24 - }
25 -
26 - if buf.Len() != size {
27 - t.Fatal("buffer not of the right size: %d != %d", buf.Len(), size)
28 - }
29 - }
30 -}
31 -
32 -func TestPseudoRandomSeed(t *testing.T) {
33 -
34 - var first []byte
35 - var size = int64(1024 * 4)
36 - seed := time.Now().UnixNano()
37 -
38 - for i := 0; i < 100; i++ {
39 - var bufs bytes.Buffer
40 - var bufr bytes.Buffer
41 -
42 - if err := WritePseudoRandomBytes(size, &bufs, seed); err != nil {
43 - t.Fatal(err)
44 - }
45 -
46 - if err := WritePseudoRandomBytes(size, &bufr, time.Now().UnixNano()); err != nil {
47 - t.Fatal(err)
48 - }
49 -
50 - if bufs.Len() != int(size) {
51 - t.Fatal("buffer not of the right size: %d != %d", bufs.Len(), size)
52 - }
53 - if bufr.Len() != int(size) {
54 - t.Fatal("buffer not of the right size: %d != %d", bufr.Len(), size)
55 - }
56 -
57 - if first == nil {
58 - first = bufs.Bytes()
59 - } else if !bytes.Equal(first, bufs.Bytes()) {
60 - t.Fatal("seeded constructed different bytes")
61 - }
62 -
63 - if bytes.Equal(first, bufr.Bytes()) {
64 - t.Fatal("non-seeded constructed same bytes")
65 - }
66 - }
67 -}
68 -
69 -func TestCryptoRandom(t *testing.T) {
70 -
71 - var testCases = []int{
72 - 1024,
73 - 187654,
74 - 1048576,
75 - }
76 -
77 - for _, size := range testCases {
78 - var buf bytes.Buffer
79 - err := WriteRandomBytes(int64(size), &buf)
80 - if err != nil {
81 - t.Fatal(err)
82 - }
83 -
84 - if buf.Len() != size {
85 - t.Fatal("buffer not of the right size: %d != %d", buf.Len(), size)
86 - }
87 - }
88 -}
89 -
90 -func BenchmarkCryptoRandom(b *testing.B) {
91 - WriteRandomBytes(int64(b.N), ioutil.Discard)
92 -}
93 -
94 -func BenchmarkPseudoRandom(b *testing.B) {
95 - WritePseudoRandomBytes(int64(b.N), ioutil.Discard, time.Now().UnixNano())
96 -}
Godeps/_workspace/src/github.com/mitchellh/go-homedir/LICENSE deleted
-21
@@ -1,21 +0,0 @@
1 -The MIT License (MIT)
2 -
3 -Copyright (c) 2013 Mitchell Hashimoto
4 -
5 -Permission is hereby granted, free of charge, to any person obtaining a copy
6 -of this software and associated documentation files (the "Software"), to deal
7 -in the Software without restriction, including without limitation the rights
8 -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 -copies of the Software, and to permit persons to whom the Software is
10 -furnished to do so, subject to the following conditions:
11 -
12 -The above copyright notice and this permission notice shall be included in
13 -all copies or substantial portions of the Software.
14 -
15 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 -THE SOFTWARE.
Godeps/_workspace/src/github.com/mitchellh/go-homedir/README.md deleted
-14
@@ -1,14 +0,0 @@
1 -# go-homedir
2 -
3 -This is a Go library for detecting the user's home directory without
4 -the use of cgo, so the library can be used in cross-compilation environments.
5 -
6 -Usage is incredibly simple, just call `homedir.Dir()` to get the home directory
7 -for a user, and `homedir.Expand()` to expand the `~` in a path to the home
8 -directory.
9 -
10 -**Why not just use `os/user`?** The built-in `os/user` package requires
11 -cgo on Darwin systems. This means that any Go code that uses that package
12 -cannot cross compile. But 99% of the time the use for `os/user` is just to
13 -retrieve the home directory, which we can do for the current user without
14 -cgo. This library does that, enabling cross-compilation.
Godeps/_workspace/src/github.com/mitchellh/go-homedir/homedir.go deleted
-84
@@ -1,84 +0,0 @@
1 -package homedir
2 -
3 -import (
4 - "bytes"
5 - "errors"
6 - "os"
7 - "os/exec"
8 - "path/filepath"
9 - "runtime"
10 - "strings"
11 -)
12 -
13 -// Dir returns the home directory for the executing user.
14 -//
15 -// This uses an OS-specific method for discovering the home directory.
16 -// An error is returned if a home directory cannot be detected.
17 -func Dir() (string, error) {
18 - if runtime.GOOS == "windows" {
19 - return dirWindows()
20 - }
21 -
22 - // Unix-like system, so just assume Unix
23 - return dirUnix()
24 -}
25 -
26 -// Expand expands the path to include the home directory if the path
27 -// is prefixed with `~`. If it isn't prefixed with `~`, the path is
28 -// returned as-is.
29 -func Expand(path string) (string, error) {
30 - if len(path) == 0 {
31 - return path, nil
32 - }
33 -
34 - if path[0] != '~' {
35 - return path, nil
36 - }
37 -
38 - if len(path) > 1 && path[1] != '/' && path[1] != '\\' {
39 - return "", errors.New("cannot expand user-specific home dir")
40 - }
41 -
42 - dir, err := Dir()
43 - if err != nil {
44 - return "", err
45 - }
46 -
47 - return filepath.Join(dir, path[1:]), nil
48 -}
49 -
50 -func dirUnix() (string, error) {
51 - // First prefer the HOME environmental variable
52 - if home := os.Getenv("HOME"); home != "" {
53 - return home, nil
54 - }
55 -
56 - // If that fails, try the shell
57 - var stdout bytes.Buffer
58 - cmd := exec.Command("sh", "-c", "eval echo ~$USER")
59 - cmd.Stdout = &stdout
60 - if err := cmd.Run(); err != nil {
61 - return "", err
62 - }
63 -
64 - result := strings.TrimSpace(stdout.String())
65 - if result == "" {
66 - return "", errors.New("blank output when reading home directory")
67 - }
68 -
69 - return result, nil
70 -}
71 -
72 -func dirWindows() (string, error) {
73 - drive := os.Getenv("HOMEDRIVE")
74 - path := os.Getenv("HOMEPATH")
75 - home := drive + path
76 - if drive == "" || path == "" {
77 - home = os.Getenv("USERPROFILE")
78 - }
79 - if home == "" {
80 - return "", errors.New("HOMEDRIVE, HOMEPATH, and USERPROFILE are blank")
81 - }
82 -
83 - return home, nil
84 -}
Godeps/_workspace/src/github.com/mitchellh/go-homedir/homedir_test.go deleted
-98
@@ -1,98 +0,0 @@
1 -package homedir
2 -
3 -import (
4 - "fmt"
5 - "os"
6 - "os/user"
7 - "testing"
8 -)
9 -
10 -func patchEnv(key, value string) func() {
11 - bck := os.Getenv(key)
12 - deferFunc := func() {
13 - os.Setenv(key, bck)
14 - }
15 -
16 - os.Setenv(key, value)
17 - return deferFunc
18 -}
19 -
20 -func TestDir(t *testing.T) {
21 - u, err := user.Current()
22 - if err != nil {
23 - t.Fatalf("err: %s", err)
24 - }
25 -
26 - dir, err := Dir()
27 - if err != nil {
28 - t.Fatalf("err: %s", err)
29 - }
30 -
31 - if u.HomeDir != dir {
32 - t.Fatalf("%#v != %#v", u.HomeDir, dir)
33 - }
34 -}
35 -
36 -func TestExpand(t *testing.T) {
37 - u, err := user.Current()
38 - if err != nil {
39 - t.Fatalf("err: %s", err)
40 - }
41 -
42 - cases := []struct {
43 - Input string
44 - Output string
45 - Err bool
46 - }{
47 - {
48 - "/foo",
49 - "/foo",
50 - false,
51 - },
52 -
53 - {
54 - "~/foo",
55 - fmt.Sprintf("%s/foo", u.HomeDir),
56 - false,
57 - },
58 -
59 - {
60 - "",
61 - "",
62 - false,
63 - },
64 -
65 - {
66 - "~",
67 - u.HomeDir,
68 - false,
69 - },
70 -
71 - {
72 - "~foo/foo",
73 - "",
74 - true,
75 - },
76 - }
77 -
78 - for _, tc := range cases {
79 - actual, err := Expand(tc.Input)
80 - if (err != nil) != tc.Err {
81 - t.Fatalf("Input: %#v\n\nErr: %s", tc.Input, err)
82 - }
83 -
84 - if actual != tc.Output {
85 - t.Fatalf("Input: %#v\n\nOutput: %#v", tc.Input, actual)
86 - }
87 - }
88 -
89 - defer patchEnv("HOME", "/custom/path/")()
90 - expected := "/custom/path/foo/bar"
91 - actual, err := Expand("~/foo/bar")
92 -
93 - if err != nil {
94 - t.Errorf("No error is expected, got: %v", err)
95 - } else if actual != "/custom/path/foo/bar" {
96 - t.Errorf("Expected: %v; actual: %v", expected, actual)
97 - }
98 -}
Godeps/_workspace/src/github.com/texttheater/golang-levenshtein/levenshtein/levenshtein.go deleted
-166
@@ -1,166 +0,0 @@
1 -package levenshtein
2 -
3 -import (
4 - "fmt"
5 - "os"
6 -)
7 -
8 -type EditOperation int
9 -
10 -const (
11 - Ins = iota
12 - Del
13 - Sub
14 - Match
15 -)
16 -
17 -type EditScript []EditOperation
18 -
19 -type MatchFunction func(rune, rune) bool
20 -
21 -type Options struct {
22 - InsCost int
23 - DelCost int
24 - SubCost int
25 - Matches MatchFunction
26 -}
27 -
28 -// DefaultOptions is the default options: insertion cost is 1, deletion cost is
29 -// 1, substitution cost is 2, and two runes match iff they are the same.
30 -var DefaultOptions Options = Options{
31 - InsCost: 1,
32 - DelCost: 1,
33 - SubCost: 2,
34 - Matches: func(sourceCharacter rune, targetCharacter rune) bool {
35 - return sourceCharacter == targetCharacter
36 - },
37 -}
38 -
39 -func (operation EditOperation) String() string {
40 - if operation == Match {
41 - return "match"
42 - } else if operation == Ins {
43 - return "ins"
44 - } else if operation == Sub {
45 - return "sub"
46 - }
47 - return "del"
48 -}
49 -
50 -// DistanceForStrings returns the edit distance between source and target.
51 -func DistanceForStrings(source []rune, target []rune, op Options) int {
52 - return DistanceForMatrix(MatrixForStrings(source, target, op))
53 -}
54 -
55 -// DistanceForMatrix reads the edit distance off the given Levenshtein matrix.
56 -func DistanceForMatrix(matrix [][]int) int {
57 - return matrix[len(matrix)-1][len(matrix[0])-1]
58 -}
59 -
60 -// MatrixForStrings generates a 2-D array representing the dynamic programming
61 -// table used by the Levenshtein algorithm, as described e.g. here:
62 -// http://www.let.rug.nl/kleiweg/lev/
63 -// The reason for putting the creation of the table into a separate function is
64 -// that it cannot only be used for reading of the edit distance between two
65 -// strings, but also e.g. to backtrace an edit script that provides an
66 -// alignment between the characters of both strings.
67 -func MatrixForStrings(source []rune, target []rune, op Options) [][]int {
68 - // Make a 2-D matrix. Rows correspond to prefixes of source, columns to
69 - // prefixes of target. Cells will contain edit distances.
70 - // Cf. http://www.let.rug.nl/~kleiweg/lev/levenshtein.html
71 - height := len(source) + 1
72 - width := len(target) + 1
73 - matrix := make([][]int, height)
74 -
75 - // Initialize trivial distances (from/to empty string). That is, fill
76 - // the left column and the top row with row/column indices.
77 - for i := 0; i < height; i++ {
78 - matrix[i] = make([]int, width)
79 - matrix[i][0] = i
80 - }
81 - for j := 1; j < width; j++ {
82 - matrix[0][j] = j
83 - }
84 -
85 - // Fill in the remaining cells: for each prefix pair, choose the
86 - // (edit history, operation) pair with the lowest cost.
87 - for i := 1; i < height; i++ {
88 - for j := 1; j < width; j++ {
89 - delCost := matrix[i-1][j] + op.DelCost
90 - matchSubCost := matrix[i-1][j-1]
91 - if !op.Matches(source[i-1], target[j-1]) {
92 - matchSubCost += op.SubCost
93 - }
94 - insCost := matrix[i][j-1] + op.InsCost
95 - matrix[i][j] = min(delCost, min(matchSubCost,
96 - insCost))
97 - }
98 - }
99 - //LogMatrix(source, target, matrix)
100 - return matrix
101 -}
102 -
103 -// EditScriptForStrings returns an optimal edit script to turn source into
104 -// target.
105 -func EditScriptForStrings(source []rune, target []rune, op Options) EditScript {
106 - return backtrace(len(source), len(target),
107 - MatrixForStrings(source, target, op), op)
108 -}
109 -
110 -// EditScriptForMatrix returns an optimal edit script based on the given
111 -// Levenshtein matrix.
112 -func EditScriptForMatrix(matrix [][]int, op Options) EditScript {
113 - return backtrace(len(matrix[0])-1, len(matrix)-1, matrix, op)
114 -}
115 -
116 -// LogMatrix outputs a visual representation of the given matrix for the given
117 -// strings on os.Stderr.
118 -func LogMatrix(source []rune, target []rune, matrix [][]int) {
119 - fmt.Fprintf(os.Stderr, " ")
120 - for _, targetRune := range target {
121 - fmt.Fprintf(os.Stderr, " %c", targetRune)
122 - }
123 - fmt.Fprintf(os.Stderr, "\n")
124 - fmt.Fprintf(os.Stderr, " %2d", matrix[0][0])
125 - for j, _ := range target {
126 - fmt.Fprintf(os.Stderr, " %2d", matrix[0][j+1])
127 - }
128 - fmt.Fprintf(os.Stderr, "\n")
129 - for i, sourceRune := range source {
130 - fmt.Fprintf(os.Stderr, "%c %2d", sourceRune, matrix[i+1][0])
131 - for j, _ := range target {
132 - fmt.Fprintf(os.Stderr, " %2d", matrix[i+1][j+1])
133 - }
134 - fmt.Fprintf(os.Stderr, "\n")
135 - }
136 -}
137 -
138 -func backtrace(i int, j int, matrix [][]int, op Options) EditScript {
139 - if i > 0 && matrix[i-1][j]+op.DelCost == matrix[i][j] {
140 - return append(backtrace(i-1, j, matrix, op), Del)
141 - }
142 - if j > 0 && matrix[i][j-1]+op.InsCost == matrix[i][j] {
143 - return append(backtrace(i, j-1, matrix, op), Ins)
144 - }
145 - if i > 0 && j > 0 && matrix[i-1][j-1]+op.SubCost == matrix[i][j] {
146 - return append(backtrace(i-1, j-1, matrix, op), Sub)
147 - }
148 - if i > 0 && j > 0 && matrix[i-1][j-1] == matrix[i][j] {
149 - return append(backtrace(i-1, j-1, matrix, op), Match)
150 - }
151 - return []EditOperation{}
152 -}
153 -
154 -func min(a int, b int) int {
155 - if b < a {
156 - return b
157 - }
158 - return a
159 -}
160 -
161 -func max(a int, b int) int {
162 - if b > a {
163 - return b
164 - }
165 - return a
166 -}
Godeps/_workspace/src/github.com/texttheater/golang-levenshtein/levenshtein/levenshtein_test.go deleted
-46
@@ -1,46 +0,0 @@
1 -package levenshtein_test
2 -
3 -import (
4 - "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/texttheater/golang-levenshtein/levenshtein"
5 - "testing"
6 -)
7 -
8 -var testCases = []struct {
9 - source string
10 - target string
11 - distance int
12 -}{
13 - {"", "a", 1},
14 - {"a", "aa", 1},
15 - {"a", "aaa", 2},
16 - {"", "", 0},
17 - {"a", "b", 2},
18 - {"aaa", "aba", 2},
19 - {"aaa", "ab", 3},
20 - {"a", "a", 0},
21 - {"ab", "ab", 0},
22 - {"a", "", 1},
23 - {"aa", "a", 1},
24 - {"aaa", "a", 2},
25 -}
26 -
27 -func TestLevenshtein(t *testing.T) {
28 - for _, testCase := range testCases {
29 - distance := levenshtein.DistanceForStrings(
30 - []rune(testCase.source),
31 - []rune(testCase.target),
32 - levenshtein.DefaultOptions)
33 - if distance != testCase.distance {
34 - t.Log(
35 - "Distance between",
36 - testCase.source,
37 - "and",
38 - testCase.target,
39 - "computed as",
40 - distance,
41 - ", should be",
42 - testCase.distance)
43 - t.Fail()
44 - }
45 - }
46 -}
cmd/ipfs/Rules.mk
+1 -1
@@ -42,7 +42,7 @@ CLEAN += $(COVER_BIN_$(d))
42
43 $(COVER_BIN_$(d)): GOTAGS += testrunmain
44 $(COVER_BIN_$(d)): $(d) $$(DEPS_GO) ALWAYS
45 - $(eval TMP_PKGS := $(shell $(GOCC) list -f '{{range .Deps}}{{.}} {{end}}' $(go-flags-with-tags) ./cmd/ipfs | sed 's/ /\n/g' | grep ipfs/go-ipfs | grep -v ipfs/go-ipfs/Godeps) $(call go-pkg-name,$<))
45 + $(eval TMP_PKGS := $(shell $(GOCC) list -f '{{range .Deps}}{{.}} {{end}}' $(go-flags-with-tags) ./cmd/ipfs | sed 's/ /\n/g' | grep ipfs/go-ipfs) $(call go-pkg-name,$<))
46 $(eval TMP_LIST := $(call join-with,$(comma),$(TMP_PKGS)))
47 @echo $(GOCC) test $@ -c -covermode atomic -coverpkg ... $(go-flags-with-tags) ./$(@D) # for info
48 @$(GOCC) test -o $@ -c -covermode atomic -coverpkg $(TMP_LIST) $(go-flags-with-tags) ./$(@D) 2>&1 | (grep -v 'warning: no packages being tested' || true)
cmd/ipfswatch/main.go
+2 -3
@@ -14,11 +14,10 @@ import (
14 corehttp "github.com/ipfs/go-ipfs/core/corehttp"
15 coreunix "github.com/ipfs/go-ipfs/core/coreunix"
16 fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
17 - config "gx/ipfs/QmYVqYJTVjetcf1guieEgWpK1PZtHPytP624vKzTF1P3r2/go-ipfs-config"
18 -
19 - homedir "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/mitchellh/go-homedir"
17
18 process "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess"
19 + config "gx/ipfs/QmYVqYJTVjetcf1guieEgWpK1PZtHPytP624vKzTF1P3r2/go-ipfs-config"
20 + homedir "gx/ipfs/QmdcULN1WCzgoQmcCaUAmEhwcxHYsDrbZ2LvRJKCL8dMrK/go-homedir"
21 fsnotify "gx/ipfs/QmfNjggF4Pt6erqg3NDafD3MdvDHk1qqCVr8pL5hnPucS8/fsnotify"
22 )
23
coverage/Rules.mk
+2 -2
@@ -10,13 +10,13 @@ endif
10 .PHONY: $(d)/coverage_deps
11
12 # unit tests coverage
13 -UTESTS_$(d) := $(shell go list -f '{{if (len .TestGoFiles)}}{{.ImportPath}}{{end}}' $(go-flags-with-tags) ./... | grep -v go-ipfs/vendor | grep -v go-ipfs/Godeps)
13 +UTESTS_$(d) := $(shell go list -f '{{if (len .TestGoFiles)}}{{.ImportPath}}{{end}}' $(go-flags-with-tags) ./...)
14
15 UCOVER_$(d) := $(addsuffix .coverprofile,$(addprefix $(d)/unitcover/, $(subst /,_,$(UTESTS_$(d)))))
16
17 $(UCOVER_$(d)): $(d)/coverage_deps ALWAYS
18 $(eval TMP_PKG := $(subst _,/,$(basename $(@F))))
19 - $(eval TMP_DEPS := $(shell go list -f '{{range .Deps}}{{.}} {{end}}' $(go-flags-with-tags) $(TMP_PKG) | sed 's/ /\n/g' | grep ipfs/go-ipfs | grep -v ipfs/go-ipfs/Godeps) $(TMP_PKG))
19 + $(eval TMP_DEPS := $(shell go list -f '{{range .Deps}}{{.}} {{end}}' $(go-flags-with-tags) $(TMP_PKG) | sed 's/ /\n/g' | grep ipfs/go-ipfs) $(TMP_PKG))
20 $(eval TMP_DEPS_LIST := $(call join-with,$(comma),$(TMP_DEPS)))
21 go test $(go-flags-with-tags) $(GOTFLAGS) -covermode=atomic -coverpkg=$(TMP_DEPS_LIST) -coverprofile=$@ $(TMP_PKG)
22
mk/golang.mk
+2 -2
@@ -19,7 +19,7 @@ CHECK_GO :=
19 go-pkg-name=$(shell $(GOCC) list $(go-tags) github.com/ipfs/go-ipfs/$(1))
20 go-main-name=$(notdir $(call go-pkg-name,$(1)))$(?exe)
21 go-curr-pkg-tgt=$(d)/$(call go-main-name,$(d))
22 -go-pkgs-novendor=$(shell $(GOCC) list github.com/ipfs/go-ipfs/... | grep -v /Godeps/)
22 +go-pkgs=$(shell $(GOCC) list github.com/ipfs/go-ipfs/...)
23
24 go-tags=$(if $(GOTAGS), -tags="$(call join-with,$(space),$(GOTAGS))")
25 go-flags-with-tags=$(GOFLAGS)$(go-tags)
@@ -55,7 +55,7 @@ TEST_GO += test_go_fmt
55
56 test_go_megacheck:
57 @$(GOCC) get honnef.co/go/tools/cmd/megacheck
58 - @for pkg in $(go-pkgs-novendor); do megacheck "$$pkg"; done
58 + @for pkg in $(go-pkgs); do megacheck "$$pkg"; done
59 .PHONY: megacheck
60
61 test_go: $(TEST_GO)
package.json
+17
@@ -551,6 +551,23 @@
551 "hash": "QmRgFWjY1idcimoGvSAzNenfptnciZnPHuW3P2yq9VgaqA",
552 "name": "go-libp2p-quic-transport",
553 "version": "0.2.4"
554 + },
555 + {
556 + "author": "mitchellh",
557 + "hash": "QmdcULN1WCzgoQmcCaUAmEhwcxHYsDrbZ2LvRJKCL8dMrK",
558 + "name": "go-homedir",
559 + "version": "1.0.0"
560 + },
561 + {
562 + "hash": "QmSJ9n2s9NUoA9D849W5jj5SJ94nMcZpj1jCgQJieiNqSt",
563 + "name": "go-random",
564 + "version": "1.0.0"
565 + },
566 + {
567 + "author": "jbenet",
568 + "hash": "QmbyJLe6SdVR5VLjtcoLdKhUuV4RT9a1FxX28zaWnY34d8",
569 + "name": "go-random-files",
570 + "version": "1.0.0"
571 }
572 ],
573 "gxVersion": "0.10.0",
pin/internal/pb/doc.go
-3
@@ -1,6 +1,3 @@
1 package pb
2
3 //go:generate protoc --gogo_out=. header.proto
4 -
5 -// kludge to get vendoring right in protobuf output
6 -//go:generate sed -i s,github.com/,github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/,g header.pb.go
repo/fsrepo/fsrepo.go
+1 -2
@@ -18,8 +18,6 @@ import (
18 mfsr "github.com/ipfs/go-ipfs/repo/fsrepo/migrations"
19 dir "github.com/ipfs/go-ipfs/thirdparty/dir"
20
21 - "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/mitchellh/go-homedir"
22 -
21 util "gx/ipfs/QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A/go-ipfs-util"
22 logging "gx/ipfs/QmRREK2CAZ5Re2Bd9zZFG6FeYDppUWt5cMgsoUEp3ktgSr/go-log"
23 ds "gx/ipfs/QmSpg1CvpXQQow5ernt1gNBXaXV6yxyNqi7XoeerWfzB5w/go-datastore"
@@ -28,6 +26,7 @@ import (
26 ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr"
27 lockfile "gx/ipfs/QmZzgxSj8QpR58KmdeNj97eD66X6xeDAFNjpP2xTY9oKeQ/go-fs-lock"
28 measure "gx/ipfs/QmcUJcDvigNo8epy9STuJRuMUpjz6UxH5BSgMNSJAfzTem/go-ds-measure"
29 + homedir "gx/ipfs/QmdcULN1WCzgoQmcCaUAmEhwcxHYsDrbZ2LvRJKCL8dMrK/go-homedir"
30 )
31
32 // LockFile is the filename of the repo lock, relative to config dir
repo/fsrepo/misc.go
+1 -2
@@ -3,9 +3,8 @@ package fsrepo
3 import (
4 "os"
5
6 - homedir "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/mitchellh/go-homedir"
7 -
6 config "gx/ipfs/QmYVqYJTVjetcf1guieEgWpK1PZtHPytP624vKzTF1P3r2/go-ipfs-config"
7 + homedir "gx/ipfs/QmdcULN1WCzgoQmcCaUAmEhwcxHYsDrbZ2LvRJKCL8dMrK/go-homedir"
8 )
9
10 // BestKnownPath returns the best known fsrepo path. If the ENV override is
test/3nodetest/Makefile
+2 -2
@@ -1,4 +1,3 @@
1 -RANDOMSRC = ../../Godeps/_workspace/src/github.com/jbenet/go-random
1 IMAGE_NAME = ipfs-test-latest
2 IPFS_ROOT = ../..
3
@@ -20,7 +19,8 @@ data/filerand: bin/random
19 ./bin/random 50000000 > ./data/filerand
20
21 bin/random: $(RANDOMSRC)/**/*.go
23 - go build -o ./bin/random $(RANDOMSRC)/random
22 + go get github.com/jbenet/go-random
23 + go build -o ./bin/random github.com/jbenet/go-random/random
24
25 # just build it every time... this part isn't
26 # even the lengthy part, and it decreases pain.
test/bench/bench_cli_ipfs_add/main.go
+1 -1
@@ -10,9 +10,9 @@ import (
10 "path"
11 "testing"
12
13 - "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-random"
13 "github.com/ipfs/go-ipfs/thirdparty/unit"
14
15 + random "gx/ipfs/QmSJ9n2s9NUoA9D849W5jj5SJ94nMcZpj1jCgQJieiNqSt/go-random"
16 config "gx/ipfs/QmYVqYJTVjetcf1guieEgWpK1PZtHPytP624vKzTF1P3r2/go-ipfs-config"
17 )
18
test/bench/offline_add/main.go
+1 -1
@@ -9,9 +9,9 @@ import (
9 "path"
10 "testing"
11
12 - "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-random"
12 "github.com/ipfs/go-ipfs/thirdparty/unit"
13
14 + random "gx/ipfs/QmSJ9n2s9NUoA9D849W5jj5SJ94nMcZpj1jCgQJieiNqSt/go-random"
15 config "gx/ipfs/QmYVqYJTVjetcf1guieEgWpK1PZtHPytP624vKzTF1P3r2/go-ipfs-config"
16 )
17
test/bin/Rules.mk
+10 -8
@@ -2,14 +2,6 @@ include mk/header.mk
2
3 TGTS_$(d) :=
4
5 -$(d)/random: Godeps/_workspace/src/github.com/jbenet/go-random/random
6 - $(go-build)
7 -TGTS_$(d) += $(d)/random
8 -
9 -$(d)/random-files: Godeps/_workspace/src/github.com/jbenet/go-random-files/random-files
10 - $(go-build)
11 -TGTS_$(d) += $(d)/random-files
12 -
5 $(d)/pollEndpoint: thirdparty/pollEndpoint
6 $(go-build)
7 TGTS_$(d) += $(d)/pollEndpoint
@@ -44,6 +36,16 @@ $(d)/cid-fmt:
36 go build -i $(go-flags-with-tags) -o "$@" "gx/ipfs/$(shell gx deps find go-cidutil)/go-cidutil/cid-fmt"
37 TGTS_$(d) += $(d)/cid-fmt
38
39 +# random is also special
40 +$(d)/random:
41 + go build -i $(go-flags-with-tags) -o "$@" "gx/ipfs/$(shell gx deps find go-random)/go-random/random"
42 +TGTS_$(d) += $(d)/random
43 +
44 +# random-files is also special
45 +$(d)/random-files:
46 + go build -i $(go-flags-with-tags) -o "$@" "gx/ipfs/$(shell gx deps find go-random-files)/go-random-files/random-files"
47 +TGTS_$(d) += $(d)/random-files
48 +
49
50 $(TGTS_$(d)): $$(DEPS_GO)
51
test/bin/verify-go-fmt.sh
+1 -1
@@ -5,7 +5,7 @@
5 verify_gofmt() {
6 GOFMT="gofmt -s"
7 cd "$(git rev-parse --show-toplevel)"
8 - bad_files=$($GOFMT -l . | grep -v Godeps)
8 + bad_files=$($GOFMT -l .)
9 cd -
10 if [[ -n $bad_files ]]; then
11 echo "You have to run '$GOFMT' on these files:"
test/integration/addcat_test.go
+1 -2
@@ -11,8 +11,6 @@ import (
11 "testing"
12 "time"
13
14 - random "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-random"
15 -
14 "github.com/ipfs/go-ipfs/core"
15 coreunix "github.com/ipfs/go-ipfs/core/coreunix"
16 mock "github.com/ipfs/go-ipfs/core/mock"
@@ -20,6 +18,7 @@ import (
18
19 testutil "gx/ipfs/QmRNhSdqzMcuRxX9A1egBeQ3BhDTguDV5HPwi8wRykkPU8/go-testutil"
20 logging "gx/ipfs/QmRREK2CAZ5Re2Bd9zZFG6FeYDppUWt5cMgsoUEp3ktgSr/go-log"
21 + random "gx/ipfs/QmSJ9n2s9NUoA9D849W5jj5SJ94nMcZpj1jCgQJieiNqSt/go-random"
22 mocknet "gx/ipfs/QmUEqyXr97aUbNmQADHYNknjwjjdVpJXEt1UZXmSG81EV4/go-libp2p/p2p/net/mock"
23 pstore "gx/ipfs/Qmda4cPRvSRyox3SqgJN6DfSZGU5TtHufPTp9uXjFj71X6/go-libp2p-peerstore"
24 )
test/sharness/lib/random-dep.go deleted
-9
@@ -1,9 +0,0 @@
1 -// package randomdep is here to introduce a dependency in random for godep to
2 -// function properly. this way we can keep go-random vendored and not
3 -// accidentally break our tests when we change it.
4 -package randomdep
5 -
6 -import (
7 - _ "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-random"
8 - _ "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-random-files"
9 -)