mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 05:27:07 +08:00
vendor: github.com/moby/buildkit 25bec7145b39 (v0.14.0-dev)
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
38
vendor/github.com/moby/buildkit/client/llb/fileop.go
generated
vendored
38
vendor/github.com/moby/buildkit/client/llb/fileop.go
generated
vendored
@ -96,24 +96,35 @@ func (fa *FileAction) Copy(input CopyInput, src, dest string, opt ...CopyOption)
|
||||
return a
|
||||
}
|
||||
|
||||
func (fa *FileAction) allOutputs(m map[Output]struct{}) {
|
||||
func (fa *FileAction) allOutputs(seen map[Output]struct{}, outputs []Output) []Output {
|
||||
if fa == nil {
|
||||
return
|
||||
return outputs
|
||||
}
|
||||
if fa.state != nil && fa.state.Output() != nil {
|
||||
m[fa.state.Output()] = struct{}{}
|
||||
|
||||
if fa.state != nil {
|
||||
out := fa.state.Output()
|
||||
if out != nil {
|
||||
if _, ok := seen[out]; !ok {
|
||||
outputs = append(outputs, out)
|
||||
seen[out] = struct{}{}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if a, ok := fa.action.(*fileActionCopy); ok {
|
||||
if a.state != nil {
|
||||
if out := a.state.Output(); out != nil {
|
||||
m[out] = struct{}{}
|
||||
out := a.state.Output()
|
||||
if out != nil {
|
||||
if _, ok := seen[out]; !ok {
|
||||
outputs = append(outputs, out)
|
||||
seen[out] = struct{}{}
|
||||
}
|
||||
}
|
||||
} else if a.fas != nil {
|
||||
a.fas.allOutputs(m)
|
||||
outputs = a.fas.allOutputs(seen, outputs)
|
||||
}
|
||||
}
|
||||
fa.prev.allOutputs(m)
|
||||
return fa.prev.allOutputs(seen, outputs)
|
||||
}
|
||||
|
||||
func (fa *FileAction) bind(s State) *FileAction {
|
||||
@ -806,15 +817,8 @@ func (f *FileOp) Output() Output {
|
||||
return f.output
|
||||
}
|
||||
|
||||
func (f *FileOp) Inputs() (inputs []Output) {
|
||||
mm := map[Output]struct{}{}
|
||||
|
||||
f.action.allOutputs(mm)
|
||||
|
||||
for o := range mm {
|
||||
inputs = append(inputs, o)
|
||||
}
|
||||
return inputs
|
||||
func (f *FileOp) Inputs() []Output {
|
||||
return f.action.allOutputs(map[Output]struct{}{}, []Output{})
|
||||
}
|
||||
|
||||
func getIndex(input pb.InputIndex, len int, relative *int) pb.InputIndex {
|
||||
|
Reference in New Issue
Block a user