diff options
Diffstat (limited to 'internal/rosa/state.go')
| -rw-r--r-- | internal/rosa/state.go | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/internal/rosa/state.go b/internal/rosa/state.go index 6142e4ac..6ff6f1cf 100644 --- a/internal/rosa/state.go +++ b/internal/rosa/state.go @@ -899,7 +899,7 @@ func (ctx *evalContext) pf( var ( attr PackageAttr patches []string - files []string + files []KV excl bool early bool @@ -965,16 +965,17 @@ func (ctx *evalContext) pf( for _, pair := range files { var pathname *check.Absolute - dst, src, ok := strings.Cut(pair, ":") - if !ok { - src, dst = dst, filepath.Base(dst) + if pathname, err = check.NewAbs(pair[0]); err != nil { + pathname = AbsUsrSrc.Append(pair[0]) + err = nil } - if pathname, err = check.NewAbs(dst); err != nil { - pathname = AbsUsrSrc.Append(dst) + + if pair[1] == "" { + pair[1] = pair[0] } var p []byte - p, err = fs.ReadFile(ctx.b, src) + p, err = fs.ReadFile(ctx.b, pair[1]) if err != nil { return } @@ -982,8 +983,8 @@ func (ctx *evalContext) pf( attr.Paths = append(attr.Paths, pkg.Path( pathname, false, - pkg.NewFile(filepath.Base(dst), p), - )) + pkg.NewFile(filepath.Base(pair[0]), p)), + ) } if excl { |
