|
@@ -1202,31 +1202,13 @@ func normalizeContextPaths(paths map[string]struct{}) []string {
|
|
if p == "/" {
|
|
if p == "/" {
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
- pathSlice = append(pathSlice, p)
|
|
|
|
|
|
+ pathSlice = append(pathSlice, path.Join(".", p))
|
|
}
|
|
}
|
|
|
|
|
|
- toDelete := map[string]struct{}{}
|
|
|
|
- for i := range pathSlice {
|
|
|
|
- for j := range pathSlice {
|
|
|
|
- if i == j {
|
|
|
|
- continue
|
|
|
|
- }
|
|
|
|
- if strings.HasPrefix(pathSlice[j], pathSlice[i]+"/") {
|
|
|
|
- delete(paths, pathSlice[j])
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- toSort := make([]string, 0, len(paths))
|
|
|
|
- for p := range paths {
|
|
|
|
- if _, ok := toDelete[p]; !ok {
|
|
|
|
- toSort = append(toSort, path.Join(".", p))
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- sort.Slice(toSort, func(i, j int) bool {
|
|
|
|
- return toSort[i] < toSort[j]
|
|
|
|
|
|
+ sort.Slice(pathSlice, func(i, j int) bool {
|
|
|
|
+ return pathSlice[i] < pathSlice[j]
|
|
})
|
|
})
|
|
- return toSort
|
|
|
|
|
|
+ return pathSlice
|
|
}
|
|
}
|
|
|
|
|
|
func proxyEnvFromBuildArgs(args map[string]string) *llb.ProxyEnv {
|
|
func proxyEnvFromBuildArgs(args map[string]string) *llb.ProxyEnv {
|