Skip to content

Commit e30bf3b

Browse files
committed
Sigh, namespacing of xattr works differently on *BSD.
Tested on FreeBSD.
1 parent bd28491 commit e30bf3b

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

src/duplicacy_entry_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,12 @@ func TestEntryExcludeByAttribute(t *testing.T) {
240240
if runtime.GOOS == "darwin" {
241241
excludeAttrName = "com.apple.metadata:com_apple_backup_excludeItem"
242242
excludeAttrValue = []byte("com.apple.backupd")
243-
} else if runtime.GOOS == "linux" || runtime.GOOS == "freebsd" || runtime.GOOS == "netbsd" || runtime.GOOS == "solaris" {
243+
} else if runtime.GOOS == "linux" {
244244
excludeAttrName = "user.duplicacy_exclude"
245+
} else if runtime.GOOS == "freebsd" || runtime.GOOS == "netbsd" {
246+
excludeAttrName = "duplicacy_exclude"
245247
} else {
246-
t.Skip("skipping test, not darwin, linux, freebsd, netbsd, or solaris")
248+
t.Skip("skipping test, not darwin, linux, freebsd, or netbsd")
247249
}
248250

249251
testDir := filepath.Join(os.TempDir(), "duplicacy_test")

src/duplicacy_utils_posix.go renamed to src/duplicacy_utils_linux.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22
// Free for personal use and commercial trial
33
// Commercial use requires per-user licenses available from https://duplicacy.com
44

5-
// +build freebsd netbsd linux solaris
6-
75
package duplicacy
86

9-
import (
10-
)
11-
127
func excludedByAttribute(attributes map[string][]byte) bool {
138
_, ok := attributes["user.duplicacy_exclude"]
149
return ok

src/duplicacy_utils_xbsd.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) Acrosync LLC. All rights reserved.
2+
// Free for personal use and commercial trial
3+
// Commercial use requires per-user licenses available from https://duplicacy.com
4+
5+
//go:build freebsd || netbsd
6+
// +build freebsd netbsd
7+
8+
package duplicacy
9+
10+
func excludedByAttribute(attributes map[string][]byte) bool {
11+
_, ok := attributes["duplicacy_exclude"]
12+
return ok
13+
}

0 commit comments

Comments
 (0)