From 5e8baab4ecf273599a53b794d3babfc7b5c3de81 Mon Sep 17 00:00:00 2001 From: a-s-z-home Date: Mon, 5 Nov 2018 22:39:11 +0100 Subject: [PATCH] - Reverted changes to exclude mechanism of .duplicacy directory. --- src/duplicacy_entry.go | 3 +++ src/duplicacy_snapshot.go | 13 +------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/duplicacy_entry.go b/src/duplicacy_entry.go index c640865..1f1b795 100644 --- a/src/duplicacy_entry.go +++ b/src/duplicacy_entry.go @@ -481,6 +481,9 @@ func ListEntries(top string, path string, fileList *[]*Entry, patterns []string, entries := make([]*Entry, 0, 4) for _, f := range files { + if f.Name() == DUPLICACY_DIRECTORY { + continue + } entry := CreateEntryFromFileInfo(f, normalizedPath) if len(patterns) > 0 && !MatchPath(entry.Path, patterns) { continue diff --git a/src/duplicacy_snapshot.go b/src/duplicacy_snapshot.go index 956c250..49b8cbc 100644 --- a/src/duplicacy_snapshot.go +++ b/src/duplicacy_snapshot.go @@ -12,7 +12,6 @@ import ( "os" "path" "path/filepath" - "regexp" "strconv" "strings" "time" @@ -123,17 +122,7 @@ func AppendPattern(patterns []string, new_pattern string) (new_patterns []string return new_patterns } func ProcessFilters() (patterns []string) { - patternFileLines := []string{ - `# ============================ exclude the internal files and directories in all ".duplicacy" subfolders`, - `e:(?i)(^|/)` + regexp.QuoteMeta(DUPLICACY_DIRECTORY) + `/cache/`, - `e:(?i)(^|/)` + regexp.QuoteMeta(DUPLICACY_DIRECTORY) + `/temporary$`, - `# ============================ exclude the internal files and directories in toplevel ".duplicacy" subfolder`, - `e:(?i)^` + regexp.QuoteMeta(DUPLICACY_DIRECTORY) + `/incomplete$`, - `e:(?i)^` + regexp.QuoteMeta(DUPLICACY_DIRECTORY) + `/logs/`, - "@" + joinPath(GetDuplicacyPreferencePath(), "filters"), - } - LOG_DEBUG("SNAPSHOT_FILTER", "Adding standard filters ...") - patterns = ProcessFilterLines(patternFileLines, make([]string, 0)) + patterns = ProcessFilterFile(joinPath(GetDuplicacyPreferencePath(), "filters"), make([]string, 0)) LOG_DEBUG("REGEX_DEBUG", "There are %d compiled regular expressions stored", len(RegexMap))