Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
3e315191
Unverified
提交
3e315191
authored
3月 28, 2019
作者:
Steven Allen
提交者:
GitHub
3月 28, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6135 from anacrolix/fuse-fixes
Fuse fixes
上级
d25819d8
ef903f6d
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
34 行增加
和
11 行删除
+34
-11
bootstrap.go
core/bootstrap.go
+1
-1
ipns_test.go
fuse/ipns/ipns_test.go
+7
-1
mount_darwin.go
fuse/node/mount_darwin.go
+13
-7
mount_test.go
fuse/node/mount_test.go
+6
-1
ipfs_test.go
fuse/readonly/ipfs_test.go
+7
-1
没有找到文件。
core/bootstrap.go
浏览文件 @
3e315191
...
...
@@ -80,7 +80,7 @@ func Bootstrap(n *IpfsNode, cfg BootstrapConfig) (io.Closer, error) {
if
len
(
cfg
.
BootstrapPeers
())
==
0
{
// We *need* to bootstrap but we have no bootstrap peers
// configured *at all*, inform the user.
log
.
Error
(
"no bootstrap nodes configured: go-ipfs may have difficulty connecting to the network"
)
log
.
Warning
(
"no bootstrap nodes configured: go-ipfs may have difficulty connecting to the network"
)
}
// the periodic bootstrap function -- the connection supervisor
...
...
fuse/ipns/ipns_test.go
浏览文件 @
3e315191
...
...
@@ -12,6 +12,8 @@ import (
"sync"
"testing"
"bazil.org/fuse"
core
"github.com/ipfs/go-ipfs/core"
fstest
"bazil.org/fuse/fs/fstestutil"
...
...
@@ -106,6 +108,7 @@ func (m *mountWrap) Close() error {
}
func
setupIpnsTest
(
t
*
testing
.
T
,
node
*
core
.
IpfsNode
)
(
*
core
.
IpfsNode
,
*
mountWrap
)
{
t
.
Helper
()
maybeSkipFuseTests
(
t
)
var
err
error
...
...
@@ -126,8 +129,11 @@ func setupIpnsTest(t *testing.T, node *core.IpfsNode) (*core.IpfsNode, *mountWra
t
.
Fatal
(
err
)
}
mnt
,
err
:=
fstest
.
MountedT
(
t
,
fs
,
nil
)
if
err
==
fuse
.
ErrOSXFUSENotFound
{
t
.
Skip
(
err
)
}
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
f
(
"error mounting at temporary directory: %v"
,
err
)
}
return
node
,
&
mountWrap
{
...
...
fuse/node/mount_darwin.go
浏览文件 @
3e315191
...
...
@@ -22,10 +22,10 @@ func init() {
// dontCheckOSXFUSEConfigKey is a key used to let the user tell us to
// skip fuse checks.
var
dontCheckOSXFUSEConfigKey
=
"DontCheckOSXFUSE"
const
dontCheckOSXFUSEConfigKey
=
"DontCheckOSXFUSE"
// fuseVersionPkg is the go pkg url for fuse-version
var
fuseVersionPkg
=
"github.com/jbenet/go-fuse-version/fuse-version"
const
fuseVersionPkg
=
"github.com/jbenet/go-fuse-version/fuse-version"
// errStrFuseRequired is returned when we're sure the user does not have fuse.
var
errStrFuseRequired
=
`OSXFUSE not found.
...
...
@@ -58,7 +58,12 @@ For more help, see:
https://github.com/ipfs/go-ipfs/issues/177
`
var
errStrNeedFuseVersion
=
`unable to check fuse version.
type
errNeedFuseVersion
struct
{
cause
string
}
func
(
me
errNeedFuseVersion
)
Error
()
string
{
return
fmt
.
Sprintf
(
`unable to check fuse version.
Dear User,
...
...
@@ -79,7 +84,8 @@ version you have by running:
[1]: https://github.com/ipfs/go-ipfs/issues/177
[2]: https://github.com/ipfs/go-ipfs/pull/533
[3]: %s
`
`
,
fuseVersionPkg
,
dontCheckOSXFUSEConfigKey
,
me
.
cause
)
}
var
errStrFailedToRunFuseVersion
=
`unable to check fuse version.
...
...
@@ -197,7 +203,7 @@ func ensureFuseVersionIsInstalled() error {
// try installing it...
log
.
Debug
(
"fuse-version: no fuse-version. attempting to install."
)
cmd
:=
exec
.
Command
(
"go"
,
"
get
"
,
"github.com/jbenet/go-fuse-version/fuse-version"
)
cmd
:=
exec
.
Command
(
"go"
,
"
install
"
,
"github.com/jbenet/go-fuse-version/fuse-version"
)
cmdout
:=
new
(
bytes
.
Buffer
)
cmd
.
Stdout
=
cmdout
cmd
.
Stderr
=
cmdout
...
...
@@ -211,13 +217,13 @@ func ensureFuseVersionIsInstalled() error {
log
.
Debug
(
"fuse-version: failed to install."
)
s
:=
err
.
Error
()
+
"
\n
"
+
cmdoutstr
return
fmt
.
Errorf
(
errStrNeedFuseVersion
,
fuseVersionPkg
,
dontCheckOSXFUSEConfigKey
,
s
)
return
errNeedFuseVersion
{
s
}
}
// ok, try again...
if
_
,
err
:=
exec
.
LookPath
(
"fuse-version"
);
err
!=
nil
{
log
.
Debug
(
"fuse-version: failed to install?"
)
return
fmt
.
Errorf
(
errStrNeedFuseVersion
,
fuseVersionPkg
,
dontCheckOSXFUSEConfigKey
,
err
)
return
errNeedFuseVersion
{
err
.
Error
()}
}
log
.
Debug
(
"fuse-version: install success"
)
...
...
fuse/node/mount_test.go
浏览文件 @
3e315191
...
...
@@ -8,6 +8,8 @@ import (
"testing"
"time"
"bazil.org/fuse"
"context"
core
"github.com/ipfs/go-ipfs/core"
...
...
@@ -61,8 +63,11 @@ func TestExternalUnmount(t *testing.T) {
mkdir
(
t
,
ipnsDir
)
err
=
Mount
(
node
,
ipfsDir
,
ipnsDir
)
if
_
,
ok
:=
err
.
(
errNeedFuseVersion
);
ok
||
err
==
fuse
.
ErrOSXFUSENotFound
{
t
.
Skip
(
err
)
}
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
f
(
"error mounting: %v"
,
err
)
}
// Run shell command to externally unmount the directory
...
...
fuse/readonly/ipfs_test.go
浏览文件 @
3e315191
...
...
@@ -15,6 +15,8 @@ import (
"sync"
"testing"
"bazil.org/fuse"
core
"github.com/ipfs/go-ipfs/core"
coreapi
"github.com/ipfs/go-ipfs/core/coreapi"
coremock
"github.com/ipfs/go-ipfs/core/mock"
...
...
@@ -50,6 +52,7 @@ func randObj(t *testing.T, nd *core.IpfsNode, size int64) (ipld.Node, []byte) {
}
func
setupIpfsTest
(
t
*
testing
.
T
,
node
*
core
.
IpfsNode
)
(
*
core
.
IpfsNode
,
*
fstest
.
Mount
)
{
t
.
Helper
()
maybeSkipFuseTests
(
t
)
var
err
error
...
...
@@ -62,8 +65,11 @@ func setupIpfsTest(t *testing.T, node *core.IpfsNode) (*core.IpfsNode, *fstest.M
fs
:=
NewFileSystem
(
node
)
mnt
,
err
:=
fstest
.
MountedT
(
t
,
fs
,
nil
)
if
err
==
fuse
.
ErrOSXFUSENotFound
{
t
.
Skip
(
err
)
}
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
f
(
"error mounting temporary directory: %v"
,
err
)
}
return
node
,
mnt
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论