Skip to content

Commit

Permalink
Sigh, namespacing of xattr works differently on *BSD.
Browse files Browse the repository at this point in the history
Tested on FreeBSD.
  • Loading branch information
jkl1337 committed Oct 5, 2023
1 parent bd28491 commit d81eab6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/duplicacy_entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,12 @@ func TestEntryExcludeByAttribute(t *testing.T) {
if runtime.GOOS == "darwin" {
excludeAttrName = "com.apple.metadata:com_apple_backup_excludeItem"
excludeAttrValue = []byte("com.apple.backupd")
} else if runtime.GOOS == "linux" || runtime.GOOS == "freebsd" || runtime.GOOS == "netbsd" || runtime.GOOS == "solaris" {
} else if runtime.GOOS == "linux" {
excludeAttrName = "user.duplicacy_exclude"
} else if runtime.GOOS == "freebsd" || runtime.GOOS == "netbsd" {
excludeAttrName = "duplicacy_exclude"
} else {
t.Skip("skipping test, not darwin, linux, freebsd, netbsd, or solaris")
t.Skip("skipping test, not darwin, linux, freebsd, or netbsd")
}

testDir := filepath.Join(os.TempDir(), "duplicacy_test")
Expand Down
5 changes: 0 additions & 5 deletions src/duplicacy_utils_posix.go → src/duplicacy_utils_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
// Free for personal use and commercial trial
// Commercial use requires per-user licenses available from https://duplicacy.com

// +build freebsd netbsd linux solaris

package duplicacy

import (
)

func excludedByAttribute(attributes map[string][]byte) bool {
_, ok := attributes["user.duplicacy_exclude"]
return ok
Expand Down
13 changes: 13 additions & 0 deletions src/duplicacy_utils_xbsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Acrosync LLC. All rights reserved.
// Free for personal use and commercial trial
// Commercial use requires per-user licenses available from https://duplicacy.com

//go:build freebsd netbsd
// +build freebsd netbsd

package duplicacy

func excludedByAttribute(attributes map[string][]byte) bool {
_, ok := attributes["duplicacy_exclude"]
return ok
}

0 comments on commit d81eab6

Please sign in to comment.