internal/rosa/state: patch output-only packages
Test / Create distribution (push) Successful in 58s
Test / Sandbox (push) Successful in 2m51s
Test / ShareFS (push) Successful in 3m56s
Test / Hakurei (push) Successful in 4m4s
Test / Sandbox (race detector) (push) Successful in 5m36s
Test / Hakurei (race detector) (push) Successful in 6m37s
Test / Flake checks (push) Successful in 1m5s

This is useful for common patched source code.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-07-18 23:05:52 +09:00
parent 8d9b14dfe1
commit b79aa3ea1c
+13 -6
View File
@@ -1041,12 +1041,6 @@ func (ctx *evalContext) pf(
}
meta.ID = int(anitya)
if output != nil {
v = cachedArtifact{&meta, output}
set = true
return
}
for _, pathname := range patches {
var p []byte
p, err = fs.ReadFile(ctx.b, pathname)
@@ -1059,6 +1053,19 @@ func (ctx *evalContext) pf(
})
}
if output != nil {
if len(attr.Patches) != 0 || attr.Chmod {
rn := string(name)
if meta.Version != Unversioned {
rn = string(name) + "-" + meta.Version
}
output = ctx.t.NewPatchedSource(rn, output, !attr.Chmod, attr.Patches...)
}
v = cachedArtifact{&meta, output}
set = true
return
}
if overlay == "" {
for _, h := range extraH {
_, a := ctx.t.MustLoad(h)