internal/rosa: use string pair for files
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m55s
Test / ShareFS (push) Successful in 3m44s
Test / Hakurei (push) Successful in 3m53s
Test / Sandbox (race detector) (push) Successful in 5m26s
Test / Hakurei (race detector) (push) Successful in 6m28s
Test / Flake checks (push) Successful in 1m20s
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m55s
Test / ShareFS (push) Successful in 3m44s
Test / Hakurei (push) Successful in 3m53s
Test / Sandbox (race detector) (push) Successful in 5m26s
Test / Hakurei (race detector) (push) Successful in 6m28s
Test / Flake checks (push) Successful in 1m20s
This is a much cleaner representation than the separator syntax. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
+10
-9
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user