mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 14:56:29 +00:00
Merge branch 'howeyc-freebsd-build'
This commit is contained in:
commit
a1d71e47f3
@ -1,4 +1,5 @@
|
|||||||
language: go
|
language: go
|
||||||
|
|
||||||
go:
|
go:
|
||||||
- 1.3.3
|
- 1.3.3
|
||||||
- 1.4.2
|
- 1.4.2
|
||||||
@ -15,15 +16,17 @@ notifications:
|
|||||||
on_success: change
|
on_success: change
|
||||||
on_failure: change
|
on_failure: change
|
||||||
|
|
||||||
|
env: GOX_OS="linux darwin openbsd freebsd"
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- go get github.com/mitchellh/gox
|
- go get github.com/mitchellh/gox
|
||||||
- gox -build-toolchain -os "linux darwin openbsd"
|
- gox -build-toolchain -os "$GOX_OS"
|
||||||
- go get -v -t ./...
|
- go get -v -t ./...
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- go build -ldflags "-s" ./...
|
- go build -ldflags "-s" ./...
|
||||||
- go build -ldflags "-s" -o restic ./cmd/restic
|
- 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 ./...
|
- go test -v ./...
|
||||||
- ./testsuite.sh
|
- ./testsuite.sh
|
||||||
- sh -c "cd backend && go test -v -test.sftppath /usr/lib/openssh/sftp-server ./..."
|
- sh -c "cd backend && go test -v -test.sftppath /usr/lib/openssh/sftp-server ./..."
|
||||||
|
4
node.go
4
node.go
@ -341,7 +341,7 @@ func (node *Node) isNewer(path string, fi os.FileInfo) bool {
|
|||||||
|
|
||||||
if node.ModTime != fi.ModTime() ||
|
if node.ModTime != fi.ModTime() ||
|
||||||
node.ChangeTime != changeTime(extendedStat) ||
|
node.ChangeTime != changeTime(extendedStat) ||
|
||||||
node.Inode != inode ||
|
node.Inode != uint64(inode) ||
|
||||||
node.Size != size {
|
node.Size != size {
|
||||||
debug.Log("node.isNewer", "node %v is newer: timestamp, size or inode changed", path)
|
debug.Log("node.isNewer", "node %v is newer: timestamp, size or inode changed", path)
|
||||||
return true
|
return true
|
||||||
@ -396,7 +396,7 @@ func (node *Node) fillExtra(path string, fi os.FileInfo) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
node.Inode = stat.Ino
|
node.Inode = uint64(stat.Ino)
|
||||||
|
|
||||||
node.fillTimes(stat)
|
node.fillTimes(stat)
|
||||||
|
|
||||||
|
20
node_freebsd.go
Normal file
20
node_freebsd.go
Normal 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())
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user