diff --git a/.travis.yml b/.travis.yml index ed1293deb..e1793c187 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: go + go: - 1.3.3 - 1.4.2 @@ -15,15 +16,17 @@ notifications: on_success: change on_failure: change +env: GOX_OS="linux darwin openbsd freebsd" + install: - go get github.com/mitchellh/gox - - gox -build-toolchain -os "linux darwin openbsd" + - gox -build-toolchain -os "$GOX_OS" - go get -v -t ./... script: - go build -ldflags "-s" ./... - go build -ldflags "-s" -o restic ./cmd/restic - - sh -c "cd cmd/restic && gox -verbose -os 'linux darwin openbsd' && ls -al" + - sh -c 'cd cmd/restic && gox -verbose -os "$GOX_OS" && ls -al' - go test -v ./... - ./testsuite.sh - sh -c "cd backend && go test -v -test.sftppath /usr/lib/openssh/sftp-server ./..." diff --git a/node.go b/node.go index 8f1ce8de5..c39bc4941 100644 --- a/node.go +++ b/node.go @@ -341,7 +341,7 @@ func (node *Node) isNewer(path string, fi os.FileInfo) bool { if node.ModTime != fi.ModTime() || node.ChangeTime != changeTime(extendedStat) || - node.Inode != inode || + node.Inode != uint64(inode) || node.Size != size { debug.Log("node.isNewer", "node %v is newer: timestamp, size or inode changed", path) return true @@ -396,7 +396,7 @@ func (node *Node) fillExtra(path string, fi os.FileInfo) error { return nil } - node.Inode = stat.Ino + node.Inode = uint64(stat.Ino) node.fillTimes(stat) diff --git a/node_freebsd.go b/node_freebsd.go new file mode 100644 index 000000000..a757e3ec9 --- /dev/null +++ b/node_freebsd.go @@ -0,0 +1,20 @@ +package restic + +import ( + "os" + "syscall" + "time" +) + +func (node *Node) OpenForReading() (*os.File, error) { + return os.OpenFile(node.path, os.O_RDONLY, 0) +} + +func (node *Node) fillTimes(stat *syscall.Stat_t) { + node.ChangeTime = time.Unix(stat.Ctimespec.Unix()) + node.AccessTime = time.Unix(stat.Atimespec.Unix()) +} + +func changeTime(stat *syscall.Stat_t) time.Time { + return time.Unix(stat.Ctimespec.Unix()) +}