1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-23 16:26:11 +00:00

Merge branch 'howeyc-freebsd-build'

This commit is contained in:
Alexander Neumann 2015-05-06 20:43:04 +02:00
commit a1d71e47f3
3 changed files with 27 additions and 4 deletions

View file

@ -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 ./..."

View file

@ -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)

20
node_freebsd.go Normal file
View file

@ -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())
}