Fix and reorganize for build for FreeBSD

- the xattr handling of namespaces is different on BSD with the
xattr package, the user namespace is implicit
- Don't backup/exclude files with flag nodump on BSD/Darwin
This commit is contained in:
2023-10-04 23:01:19 -05:00
parent f931d3e9f1
commit c782def49b
8 changed files with 232 additions and 144 deletions

View File

@@ -121,6 +121,11 @@ func (entry *Entry) ReadAttributes(top string) {
x.f.Close()
}
func excludedByAttribute(attributes map[string][]byte) bool {
_, ok := attributes["user.duplicacy_exclude"]
return ok
}
func (entry *Entry) SetAttributesToFile(fullPath string) {
x := xattrHandle{nil, fullPath}
if !entry.IsLink() {
@@ -235,8 +240,3 @@ func (entry *Entry) RestoreSpecial(fullPath string) error {
}
return syscall.Mknod(fullPath, mode, int(entry.GetRdev()))
}
func excludedByAttribute(attributes map[string][]byte) bool {
_, ok := attributes["user.duplicacy_exclude"]
return ok
}