- Reverted changes to exclude mechanism of .duplicacy directory.

This commit is contained in:
a-s-z-home
2018-11-05 22:39:11 +01:00
parent e1fa39008d
commit 5e8baab4ec
2 changed files with 4 additions and 12 deletions

View File

@@ -481,6 +481,9 @@ func ListEntries(top string, path string, fileList *[]*Entry, patterns []string,
entries := make([]*Entry, 0, 4) entries := make([]*Entry, 0, 4)
for _, f := range files { for _, f := range files {
if f.Name() == DUPLICACY_DIRECTORY {
continue
}
entry := CreateEntryFromFileInfo(f, normalizedPath) entry := CreateEntryFromFileInfo(f, normalizedPath)
if len(patterns) > 0 && !MatchPath(entry.Path, patterns) { if len(patterns) > 0 && !MatchPath(entry.Path, patterns) {
continue continue

View File

@@ -12,7 +12,6 @@ import (
"os" "os"
"path" "path"
"path/filepath" "path/filepath"
"regexp"
"strconv" "strconv"
"strings" "strings"
"time" "time"
@@ -123,17 +122,7 @@ func AppendPattern(patterns []string, new_pattern string) (new_patterns []string
return new_patterns return new_patterns
} }
func ProcessFilters() (patterns []string) { func ProcessFilters() (patterns []string) {
patternFileLines := []string{ patterns = ProcessFilterFile(joinPath(GetDuplicacyPreferencePath(), "filters"), make([]string, 0))
`# ============================ 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))
LOG_DEBUG("REGEX_DEBUG", "There are %d compiled regular expressions stored", len(RegexMap)) LOG_DEBUG("REGEX_DEBUG", "There are %d compiled regular expressions stored", len(RegexMap))