diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-05-20 09:01:40 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-05-20 09:01:40 +0900 |
| commit | 9836030c59f7a39d5df178133a80c98aef77f4d4 (patch) | |
| tree | df415e87ab8d36507e30587fe3e9daacfc5b4931 | |
| parent | b482fd4abfb2b3765b1791915b31067a0f80fec7 (diff) | |
internal/rosa: reinitialise frame alongside cache
The cached frame can contain information made outdated by the DropCaches call.
Signed-off-by: Ophestra <cat@gensokyo.uk>
| -rw-r--r-- | internal/rosa/state.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/internal/rosa/state.go b/internal/rosa/state.go index 5d3421f2..6142e4ac 100644 --- a/internal/rosa/state.go +++ b/internal/rosa/state.go @@ -189,8 +189,6 @@ type S struct { // Target architecture. arch string - // For matching arch-specific values. - identArch unique.Handle[azalea.Ident] // For initialising arch. archOnce sync.Once @@ -229,7 +227,6 @@ func (s *S) wantsArch() { s.archOnce.Do(func() { if s.arch == "" { s.arch = runtime.GOARCH - s.identArch = unique.Make(azalea.Ident(s.arch)) } }) } @@ -248,11 +245,11 @@ func (s *S) DropCaches(targetArch string, flags int) { } s.arch = targetArch - s.identArch = unique.Make(azalea.Ident(s.arch)) s.opts = flags for i := range s.c { s.c[i].Clear() } + s.frameOnce = sync.Once{} } // get returns the named [Artifact]. @@ -426,7 +423,8 @@ func (s *S) getFrame() azalea.Frame { return unique.Make(azalea.Ident(name)) } - var identDefault = k("default") + identDefault := k("default") + identArch := unique.Make(azalea.Ident(s.arch)) enumCompress := map[unique.Handle[azalea.Ident]]any{ k("uncompressed"): uint32(pkg.TarUncompressed), @@ -627,7 +625,7 @@ func (s *S) getFrame() azalea.Frame { fallback = arg.V continue - case s.identArch: + case identArch: return arg.V, true, nil } } |
