mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-26 05:08:02 +08:00
vendor: update buildkit to master@c36941f4a10e
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
15
vendor/github.com/tonistiigi/fsutil/followlinks.go
generated
vendored
15
vendor/github.com/tonistiigi/fsutil/followlinks.go
generated
vendored
@@ -19,7 +19,7 @@ func FollowLinks(root string, paths []string) ([]string, error) {
|
||||
}
|
||||
res := make([]string, 0, len(r.resolved))
|
||||
for r := range r.resolved {
|
||||
res = append(res, r)
|
||||
res = append(res, filepath.ToSlash(r))
|
||||
}
|
||||
sort.Strings(res)
|
||||
return dedupePaths(res), nil
|
||||
@@ -31,6 +31,12 @@ type symlinkResolver struct {
|
||||
}
|
||||
|
||||
func (r *symlinkResolver) append(p string) error {
|
||||
if runtime.GOOS == "windows" && filepath.IsAbs(filepath.FromSlash(p)) {
|
||||
absParts := strings.SplitN(p, ":", 2)
|
||||
if len(absParts) == 2 {
|
||||
p = absParts[1]
|
||||
}
|
||||
}
|
||||
p = filepath.Join(".", p)
|
||||
current := "."
|
||||
for {
|
||||
@@ -41,7 +47,6 @@ func (r *symlinkResolver) append(p string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
p = ""
|
||||
if len(parts) == 2 {
|
||||
p = parts[1]
|
||||
@@ -76,7 +81,7 @@ func (r *symlinkResolver) readSymlink(p string, allowWildcard bool) ([]string, e
|
||||
if allowWildcard && containsWildcards(base) {
|
||||
fis, err := os.ReadDir(filepath.Dir(realPath))
|
||||
if err != nil {
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
if isNotFound(err) {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, errors.Wrap(err, "readdir")
|
||||
@@ -96,7 +101,7 @@ func (r *symlinkResolver) readSymlink(p string, allowWildcard bool) ([]string, e
|
||||
|
||||
fi, err := os.Lstat(realPath)
|
||||
if err != nil {
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
if isNotFound(err) {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, errors.WithStack(err)
|
||||
@@ -139,7 +144,7 @@ func dedupePaths(in []string) []string {
|
||||
if s == "." {
|
||||
return nil
|
||||
}
|
||||
if strings.HasPrefix(s, last+string(filepath.Separator)) {
|
||||
if strings.HasPrefix(s, last+"/") {
|
||||
continue
|
||||
}
|
||||
out = append(out, s)
|
||||
|
Reference in New Issue
Block a user