aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-07-18 23:05:52 +0900
committerOphestra <cat@gensokyo.uk>2026-07-18 23:05:52 +0900
commitb79aa3ea1cb2e7d27db5f0b0554d80d4f29f4fe5 (patch)
tree6766ccc7821df6b4007db3b3bcb511d738c4781d /internal/rosa
parent8d9b14dfe1fe2129b1cc1faa1b81b437f45de902 (diff)
internal/rosa/state: patch output-only packages
This is useful for common patched source code. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa')
-rw-r--r--internal/rosa/state.go19
1 files changed, 13 insertions, 6 deletions
diff --git a/internal/rosa/state.go b/internal/rosa/state.go
index a14f4a5d..cd010d5c 100644
--- a/internal/rosa/state.go
+++ b/internal/rosa/state.go
@@ -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)