Skip to content

Commit

Permalink
fuse: Parse OSX fuse version properly
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
  • Loading branch information
Kubuxu committed Nov 22, 2016
1 parent 9094cc8 commit 359323e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
14 changes: 11 additions & 3 deletions fuse/node/mount_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"syscall"

core "github.com/ipfs/go-ipfs/core"

"gx/ipfs/QmU1N5xVAUXgo3XRTt6GhJ2SuJEbxj2zRgMS7FpjSR2U83/semver"
)

func init() {
Expand Down Expand Up @@ -138,11 +140,17 @@ func darwinFuseCheckVersion(node *core.IpfsNode) error {
}

log.Debug("mount: osxfuse version:", ov)
if strings.HasPrefix(ov, "2.7.") || strings.HasPrefix(ov, "2.8.") {
return nil

min := semver.MustParse("2.7.2")
curr, err := semver.Make(ov)
if err != nil {
return err
}

return fmt.Errorf(errStrUpgradeFuse, ov)
if curr.LT(min) {
return fmt.Errorf(errStrUpgradeFuse, ov)
}
return nil
}

func tryGFV() (string, error) {
Expand Down
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@
"hash": "QmXuBJ7DR6k3rmUEKtvVMhwjmXDuJgXXPUt4LQXKBMsU93",
"name": "go-os-helper",
"version": "0.0.0"
},
{
"author": "blang",
"hash": "QmU1N5xVAUXgo3XRTt6GhJ2SuJEbxj2zRgMS7FpjSR2U83",
"name": "semver",
"version": "3.3.0"
}
],
"gxVersion": "0.4.0",
Expand All @@ -301,3 +307,4 @@
"name": "go-ipfs",
"version": "0.4.5-dev"
}

0 comments on commit 359323e

Please sign in to comment.