From 8807cbc7305e424725b2be8eed7ecd9234f7772e Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 19 May 2026 00:03:42 +0900 Subject: internal/rosa: create metadata alongside artifact This enables deferring evaluation of azalea-based packages and fixes the longstanding quirk of version being disjoint from other metadata. Signed-off-by: Ophestra --- cmd/mbf/info_test.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'cmd/mbf/info_test.go') diff --git a/cmd/mbf/info_test.go b/cmd/mbf/info_test.go index 87e9cdcb..30658119 100644 --- a/cmd/mbf/info_test.go +++ b/cmd/mbf/info_test.go @@ -22,12 +22,12 @@ func TestInfo(t *testing.T) { t.Parallel() _t := rosa.Native().Std() - _, qemuVersion := _t.Load(rosa.QEMU) - _, glibVersion := _t.Load(rosa.GLib) - zlib, zlibVersion := _t.Load(rosa.Zlib) - _, zstdVersion := _t.Load(rosa.Zstd) - _, hakureiVersion := _t.Load(rosa.Hakurei) - _, hakureiDistVersion := _t.Load(rosa.HakureiDist) + qemuMeta, _ := _t.Load(rosa.QEMU) + glibMeta, _ := _t.Load(rosa.GLib) + zlibMeta, zlib := _t.Load(rosa.Zlib) + zstdMeta, _ := _t.Load(rosa.Zstd) + hakureiMeta, _ := _t.Load(rosa.Hakurei) + hakureiDistMeta, _ := _t.Load(rosa.HakureiDist) testCases := []struct { name string @@ -38,24 +38,24 @@ func TestInfo(t *testing.T) { wantErr any }{ {"qemu", []string{"qemu"}, nil, "", ` -name : qemu-` + qemuVersion + ` +name : qemu-` + qemuMeta.Version + ` description : a generic and open source machine emulator and virtualizer website : https://www.qemu.org -depends on : glib-` + glibVersion + ` zstd-` + zstdVersion + ` +depends on : glib-` + glibMeta.Version + ` zstd-` + zstdMeta.Version + ` `, nil}, {"multi", []string{"hakurei", "hakurei-dist"}, nil, "", ` -name : hakurei-` + hakureiVersion + ` +name : hakurei-` + hakureiMeta.Version + ` description : low-level userspace tooling for Rosa OS website : https://hakurei.app -name : hakurei-dist-` + hakureiDistVersion + ` +name : hakurei-dist-` + hakureiDistMeta.Version + ` description : low-level userspace tooling for Rosa OS (distribution tarball) website : https://hakurei.app `, nil}, {"nonexistent", []string{"zlib", "\x00"}, nil, "", ` -name : zlib-` + zlibVersion + ` +name : zlib-` + zlibMeta.Version + ` description : lossless data-compression library website : https://zlib.net @@ -65,12 +65,12 @@ website : https://zlib.net "zstd": "internal/pkg (amd64) on satori\n", "hakurei": "internal/pkg (amd64) on satori\n\n", }, "", ` -name : zlib-` + zlibVersion + ` +name : zlib-` + zlibMeta.Version + ` description : lossless data-compression library website : https://zlib.net status : not yet cured -name : zstd-` + zstdVersion + ` +name : zstd-` + zstdMeta.Version + ` description : a fast compression algorithm website : https://facebook.github.io/zstd status : internal/pkg (amd64) on satori @@ -79,7 +79,7 @@ status : internal/pkg (amd64) on satori {"status cache perm", []string{"zlib"}, map[string]string{ "zlib": "\x00", }, "", ` -name : zlib-` + zlibVersion + ` +name : zlib-` + zlibMeta.Version + ` description : lossless data-compression library website : https://zlib.net `, func(cm *cache) error { @@ -91,7 +91,7 @@ website : https://zlib.net }}, {"status report", []string{"zlib"}, nil, strings.Repeat("\x00", len(pkg.Checksum{})+8), ` -name : zlib-` + zlibVersion + ` +name : zlib-` + zlibMeta.Version + ` description : lossless data-compression library website : https://zlib.net status : not in report @@ -140,7 +140,7 @@ status : not in report if tc.status != nil { for name, status := range tc.status { - a, _ := _t.Load(rosa.ArtifactH(unique.Make(name))) + _, a := _t.Load(rosa.ArtifactH(unique.Make(name))) if a == nil { t.Fatalf("invalid name %q", name) } -- cgit v1.3.1