mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Update doublestar to fix #38
This commit is contained in:
2
go.mod
2
go.mod
@@ -3,7 +3,7 @@ module github.com/stashapp/stash
|
|||||||
require (
|
require (
|
||||||
github.com/99designs/gqlgen v0.9.0
|
github.com/99designs/gqlgen v0.9.0
|
||||||
github.com/PuerkitoBio/goquery v1.5.0
|
github.com/PuerkitoBio/goquery v1.5.0
|
||||||
github.com/bmatcuk/doublestar v1.1.1
|
github.com/bmatcuk/doublestar v1.1.5
|
||||||
github.com/disintegration/imaging v1.6.0
|
github.com/disintegration/imaging v1.6.0
|
||||||
github.com/fsnotify/fsnotify v1.4.7
|
github.com/fsnotify/fsnotify v1.4.7
|
||||||
github.com/go-chi/chi v4.0.2+incompatible
|
github.com/go-chi/chi v4.0.2+incompatible
|
||||||
|
|||||||
2
go.sum
2
go.sum
@@ -47,6 +47,8 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce
|
|||||||
github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k=
|
github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k=
|
||||||
github.com/bmatcuk/doublestar v1.1.1 h1:YroD6BJCZBYx06yYFEWvUuKVWQn3vLLQAVmDmvTSaiQ=
|
github.com/bmatcuk/doublestar v1.1.1 h1:YroD6BJCZBYx06yYFEWvUuKVWQn3vLLQAVmDmvTSaiQ=
|
||||||
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
|
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
|
||||||
|
github.com/bmatcuk/doublestar v1.1.5 h1:2bNwBOmhyFEFcoB3tGvTD5xanq+4kyOZlB8wFYbMjkk=
|
||||||
|
github.com/bmatcuk/doublestar v1.1.5/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
|
||||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
|
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
|
||||||
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
|
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
|
||||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||||
|
|||||||
3
vendor/github.com/bmatcuk/doublestar/.gitignore
generated
vendored
3
vendor/github.com/bmatcuk/doublestar/.gitignore
generated
vendored
@@ -27,3 +27,6 @@ _testmain.go
|
|||||||
*.exe
|
*.exe
|
||||||
*.test
|
*.test
|
||||||
*.prof
|
*.prof
|
||||||
|
|
||||||
|
# test directory
|
||||||
|
test/
|
||||||
|
|||||||
6
vendor/github.com/bmatcuk/doublestar/.travis.yml
generated
vendored
6
vendor/github.com/bmatcuk/doublestar/.travis.yml
generated
vendored
@@ -1,10 +1,8 @@
|
|||||||
language: go
|
language: go
|
||||||
|
|
||||||
go:
|
go:
|
||||||
- 1.3
|
- 1.11
|
||||||
- 1.4
|
- 1.12
|
||||||
- 1.5
|
|
||||||
- 1.6
|
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- go get -t -v ./...
|
- go get -t -v ./...
|
||||||
|
|||||||
97
vendor/github.com/bmatcuk/doublestar/doublestar.go
generated
vendored
97
vendor/github.com/bmatcuk/doublestar/doublestar.go
generated
vendored
@@ -9,35 +9,49 @@ import (
|
|||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// ErrBadPattern indicates a pattern was malformed.
|
||||||
var ErrBadPattern = path.ErrBadPattern
|
var ErrBadPattern = path.ErrBadPattern
|
||||||
|
|
||||||
// Split a path on the given separator, respecting escaping.
|
// Split a path on the given separator, respecting escaping.
|
||||||
func splitPathOnSeparator(path string, separator rune) []string {
|
func splitPathOnSeparator(path string, separator rune) (ret []string) {
|
||||||
// if the separator is '\\', then we can just split...
|
idx := 0
|
||||||
if separator == '\\' {
|
if separator == '\\' {
|
||||||
return strings.Split(path, string(separator))
|
// if the separator is '\\', then we can just split...
|
||||||
|
ret = strings.Split(path, string(separator))
|
||||||
|
idx = len(ret)
|
||||||
|
} else {
|
||||||
|
// otherwise, we need to be careful of situations where the separator was escaped
|
||||||
|
cnt := strings.Count(path, string(separator))
|
||||||
|
if cnt == 0 {
|
||||||
|
return []string{path}
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = make([]string, cnt+1)
|
||||||
|
pathlen := len(path)
|
||||||
|
separatorLen := utf8.RuneLen(separator)
|
||||||
|
emptyEnd := false
|
||||||
|
for start := 0; start < pathlen; {
|
||||||
|
end := indexRuneWithEscaping(path[start:], separator)
|
||||||
|
if end == -1 {
|
||||||
|
emptyEnd = false
|
||||||
|
end = pathlen
|
||||||
|
} else {
|
||||||
|
emptyEnd = true
|
||||||
|
end += start
|
||||||
|
}
|
||||||
|
ret[idx] = path[start:end]
|
||||||
|
start = end + separatorLen
|
||||||
|
idx++
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the last rune is a path separator, we need to append an empty string to
|
||||||
|
// represent the last, empty path component. By default, the strings from
|
||||||
|
// make([]string, ...) will be empty, so we just need to icrement the count
|
||||||
|
if emptyEnd {
|
||||||
|
idx++
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise, we need to be careful of situations where the separator was escaped
|
|
||||||
cnt := strings.Count(path, string(separator))
|
|
||||||
if cnt == 0 {
|
|
||||||
return []string{path}
|
|
||||||
}
|
|
||||||
ret := make([]string, cnt+1)
|
|
||||||
pathlen := len(path)
|
|
||||||
separatorLen := utf8.RuneLen(separator)
|
|
||||||
idx := 0
|
|
||||||
for start := 0; start < pathlen; {
|
|
||||||
end := indexRuneWithEscaping(path[start:], separator)
|
|
||||||
if end == -1 {
|
|
||||||
end = pathlen
|
|
||||||
} else {
|
|
||||||
end += start
|
|
||||||
}
|
|
||||||
ret[idx] = path[start:end]
|
|
||||||
start = end + separatorLen
|
|
||||||
idx++
|
|
||||||
}
|
|
||||||
return ret[:idx]
|
return ret[:idx]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,8 +79,8 @@ func indexRuneWithEscaping(s string, r rune) int {
|
|||||||
// { term }
|
// { term }
|
||||||
// term:
|
// term:
|
||||||
// '*' matches any sequence of non-path-separators
|
// '*' matches any sequence of non-path-separators
|
||||||
// '**' matches any sequence of characters, including
|
// '**' matches any sequence of characters, including
|
||||||
// path separators.
|
// path separators.
|
||||||
// '?' matches any single non-path-separator character
|
// '?' matches any single non-path-separator character
|
||||||
// '[' [ '^' ] { character-range } ']'
|
// '[' [ '^' ] { character-range } ']'
|
||||||
// character class (must be non-empty)
|
// character class (must be non-empty)
|
||||||
@@ -160,13 +174,14 @@ func doMatching(patternComponents, nameComponents []string) (matched bool, err e
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false, nil
|
return false, nil
|
||||||
} else {
|
|
||||||
// try matching components
|
|
||||||
matched, err = matchComponent(patternComponents[patIdx], nameComponents[nameIdx])
|
|
||||||
if !matched || err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// try matching components
|
||||||
|
matched, err = matchComponent(patternComponents[patIdx], nameComponents[nameIdx])
|
||||||
|
if !matched || err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
patIdx++
|
patIdx++
|
||||||
nameIdx++
|
nameIdx++
|
||||||
}
|
}
|
||||||
@@ -194,14 +209,20 @@ func Glob(pattern string) (matches []string, err error) {
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// On Windows systems, this will return the drive name ('C:'), on others,
|
// On Windows systems, this will return the drive name ('C:') for filesystem
|
||||||
// it will return an empty string.
|
// paths, or \\<server>\<share> for UNC paths. On other systems, it will
|
||||||
|
// return an empty string. Since absolute paths on non-Windows systems start
|
||||||
|
// with a slash, patternComponent[0] == volumeName will return true for both
|
||||||
|
// absolute Windows paths and absolute non-Windows paths, but we need a
|
||||||
|
// separate check for UNC paths.
|
||||||
volumeName := filepath.VolumeName(pattern)
|
volumeName := filepath.VolumeName(pattern)
|
||||||
|
isWindowsUNC := strings.HasPrefix(pattern, `\\`)
|
||||||
// If the first pattern component is equal to the volume name, then the
|
if isWindowsUNC || patternComponents[0] == volumeName {
|
||||||
// pattern is an absolute path.
|
startComponentIndex := 1
|
||||||
if patternComponents[0] == volumeName {
|
if isWindowsUNC {
|
||||||
return doGlob(fmt.Sprintf("%s%s", volumeName, string(os.PathSeparator)), patternComponents[1:], matches)
|
startComponentIndex = 4
|
||||||
|
}
|
||||||
|
return doGlob(fmt.Sprintf("%s%s", volumeName, string(os.PathSeparator)), patternComponents[startComponentIndex:], matches)
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise, it's a relative pattern
|
// otherwise, it's a relative pattern
|
||||||
|
|||||||
2
vendor/github.com/bmatcuk/doublestar/go.mod
generated
vendored
2
vendor/github.com/bmatcuk/doublestar/go.mod
generated
vendored
@@ -1 +1,3 @@
|
|||||||
module github.com/bmatcuk/doublestar
|
module github.com/bmatcuk/doublestar
|
||||||
|
|
||||||
|
go 1.12
|
||||||
|
|||||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@@ -11,7 +11,7 @@ github.com/PuerkitoBio/goquery
|
|||||||
github.com/agnivade/levenshtein
|
github.com/agnivade/levenshtein
|
||||||
# github.com/andybalholm/cascadia v1.0.0
|
# github.com/andybalholm/cascadia v1.0.0
|
||||||
github.com/andybalholm/cascadia
|
github.com/andybalholm/cascadia
|
||||||
# github.com/bmatcuk/doublestar v1.1.1
|
# github.com/bmatcuk/doublestar v1.1.5
|
||||||
github.com/bmatcuk/doublestar
|
github.com/bmatcuk/doublestar
|
||||||
# github.com/disintegration/imaging v1.6.0
|
# github.com/disintegration/imaging v1.6.0
|
||||||
github.com/disintegration/imaging
|
github.com/disintegration/imaging
|
||||||
|
|||||||
Reference in New Issue
Block a user