diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-05-17 13:07:12 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-05-17 15:56:53 +0900 |
| commit | 30eb0d6a613ad268f6805ccbcdcabf158e7f526f (patch) | |
| tree | 07e55baa52748fd139e183017eeb43f5f64cee59 /internal/rosa/report.go | |
| parent | c2ff9c9fa55ea569a5e70ee90d2eb0b2ee2a0540 (diff) | |
internal/rosa: key metadata by string
For upcoming azalea integration. The API is quite ugly right now to ease migration.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/report.go')
| -rw-r--r-- | internal/rosa/report.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/internal/rosa/report.go b/internal/rosa/report.go index 2d8b0648..01c3cf91 100644 --- a/internal/rosa/report.go +++ b/internal/rosa/report.go @@ -32,10 +32,14 @@ func WriteReport(msg message.Msg, w io.Writer, c *pkg.Cache) error { zero [wordSize]byte buf [len(pkg.ID{}) + wordSize]byte ) - for i := range PresetEnd { - a := Std.Load(PArtifact(i)) + for _, p := range native.Collect() { + a, _ := native.Load(Std, p) + meta := native.Get(p) + if meta == nil { + return errors.New("artifact " + p.String() + " in inconsistent state") + } if _, ok := a.(pkg.FileArtifact); ok { - msg.Verbosef("skipping file artifact %s", artifactsM[i].Name) + msg.Verbosef("skipping file artifact %s", meta.Name) continue } @@ -44,7 +48,7 @@ func WriteReport(msg message.Msg, w io.Writer, c *pkg.Cache) error { var f *os.File if r, err := c.OpenStatus(a); err != nil { if errors.Is(err, os.ErrNotExist) { - msg.Verbosef("artifact %s unavailable", artifactsM[i].Name) + msg.Verbosef("artifact %s unavailable", meta.Name) continue } return err @@ -52,7 +56,7 @@ func WriteReport(msg message.Msg, w io.Writer, c *pkg.Cache) error { f = r.(*os.File) } - msg.Verbosef("writing artifact %s...", artifactsM[i].Name) + msg.Verbosef("writing artifact %s...", meta.Name) var sz int64 if fi, err := f.Stat(); err != nil { |
