mirror of https://github.com/restic/restic.git
Merge pull request #1848 from iquiw/netbsd-support
Support NetBSD without fuse
This commit is contained in:
commit
1824168aa3
|
@ -1,3 +1,4 @@
|
||||||
|
// +build !netbsd
|
||||||
// +build !openbsd
|
// +build !openbsd
|
||||||
// +build !solaris
|
// +build !solaris
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// +build !netbsd
|
||||||
// +build !openbsd
|
// +build !openbsd
|
||||||
// +build !solaris
|
// +build !solaris
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
|
@ -66,7 +66,7 @@ func isSymlink(fi os.FileInfo) bool {
|
||||||
|
|
||||||
func sameModTime(fi1, fi2 os.FileInfo) bool {
|
func sameModTime(fi1, fi2 os.FileInfo) bool {
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "darwin", "freebsd", "openbsd":
|
case "darwin", "freebsd", "openbsd", "netbsd":
|
||||||
if isSymlink(fi1) && isSymlink(fi2) {
|
if isSymlink(fi1) && isSymlink(fi2) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build freebsd darwin
|
// +build freebsd darwin netbsd
|
||||||
|
|
||||||
package fs
|
package fs
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build !windows,!darwin,!freebsd
|
// +build !windows,!darwin,!freebsd,!netbsd
|
||||||
|
|
||||||
package fs
|
package fs
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// +build !netbsd
|
||||||
// +build !openbsd
|
// +build !openbsd
|
||||||
// +build !solaris
|
// +build !solaris
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// +build !netbsd
|
||||||
// +build !openbsd
|
// +build !openbsd
|
||||||
// +build !solaris
|
// +build !solaris
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// +build !netbsd
|
||||||
// +build !openbsd
|
// +build !openbsd
|
||||||
// +build !solaris
|
// +build !solaris
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// +build !netbsd
|
||||||
// +build !openbsd
|
// +build !openbsd
|
||||||
// +build !solaris
|
// +build !solaris
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// +build !netbsd
|
||||||
// +build !openbsd
|
// +build !openbsd
|
||||||
// +build !solaris
|
// +build !solaris
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// +build !netbsd
|
||||||
// +build !openbsd
|
// +build !openbsd
|
||||||
// +build !solaris
|
// +build !solaris
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// +build !netbsd
|
||||||
// +build !openbsd
|
// +build !openbsd
|
||||||
// +build !solaris
|
// +build !solaris
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// +build !netbsd
|
||||||
// +build !openbsd
|
// +build !openbsd
|
||||||
// +build !solaris
|
// +build !solaris
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// +build !netbsd
|
||||||
// +build !openbsd
|
// +build !openbsd
|
||||||
// +build !solaris
|
// +build !solaris
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
package restic
|
||||||
|
|
||||||
|
import "syscall"
|
||||||
|
|
||||||
|
func (node Node) restoreSymlinkTimestamps(path string, utimes [2]syscall.Timespec) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s statUnix) atim() syscall.Timespec { return s.Atimespec }
|
||||||
|
func (s statUnix) mtim() syscall.Timespec { return s.Mtimespec }
|
||||||
|
func (s statUnix) ctim() syscall.Timespec { return s.Ctimespec }
|
||||||
|
|
||||||
|
// Getxattr retrieves extended attribute data associated with path.
|
||||||
|
func Getxattr(path, name string) ([]byte, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Listxattr retrieves a list of names of extended attributes associated with the
|
||||||
|
// given path in the file system.
|
||||||
|
func Listxattr(path string) ([]string, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setxattr associates name and data together as an attribute of path.
|
||||||
|
func Setxattr(path, name string, data []byte) error {
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -210,7 +210,7 @@ func TestNodeRestoreAt(t *testing.T) {
|
||||||
"%v: GID doesn't match (%v != %v)", test.Type, test.GID, n2.GID)
|
"%v: GID doesn't match (%v != %v)", test.Type, test.GID, n2.GID)
|
||||||
if test.Type != "symlink" {
|
if test.Type != "symlink" {
|
||||||
// On OpenBSD only root can set sticky bit (see sticky(8)).
|
// On OpenBSD only root can set sticky bit (see sticky(8)).
|
||||||
if runtime.GOOS != "openbsd" && test.Name == "testSticky" {
|
if runtime.GOOS != "openbsd" && runtime.GOOS != "netbsd" && test.Name == "testSticky" {
|
||||||
rtest.Assert(t, test.Mode == n2.Mode,
|
rtest.Assert(t, test.Mode == n2.Mode,
|
||||||
"%v: mode doesn't match (0%o != 0%o)", test.Type, test.Mode, n2.Mode)
|
"%v: mode doesn't match (0%o != 0%o)", test.Type, test.Mode, n2.Mode)
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,7 @@ func AssertFsTimeEqual(t *testing.T, label string, nodeType string, t1 time.Time
|
||||||
// Go currently doesn't support setting timestamps of symbolic links on darwin and bsd
|
// Go currently doesn't support setting timestamps of symbolic links on darwin and bsd
|
||||||
if nodeType == "symlink" {
|
if nodeType == "symlink" {
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "darwin", "freebsd", "openbsd":
|
case "darwin", "freebsd", "openbsd", "netbsd":
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// +build !netbsd
|
||||||
// +build !openbsd
|
// +build !openbsd
|
||||||
// +build !solaris
|
// +build !solaris
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
|
@ -134,6 +134,7 @@ func (env *TravisEnvironment) Prepare() error {
|
||||||
"darwin/386", "darwin/amd64",
|
"darwin/386", "darwin/amd64",
|
||||||
"freebsd/386", "freebsd/amd64",
|
"freebsd/386", "freebsd/amd64",
|
||||||
"openbsd/386", "openbsd/amd64",
|
"openbsd/386", "openbsd/amd64",
|
||||||
|
"netbsd/386", "netbsd/amd64",
|
||||||
"linux/arm", "freebsd/arm",
|
"linux/arm", "freebsd/arm",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue