osbuild-store-dump: use distrofactory instead of importing fedora

This commit removes the direct use of `pkg/distro/fedora` and
uses `distrofactory` instead. This is the more generic interface,
it also helps with PR#1563 as `pkg/distro/fedora` goes away.

Note that I did not test this but @bcl was kind enough to
mention how this is used:
```
The output from this is used in Test_upgrade in
internal/store/json_test.go, the files there are manually
created when we change the format of the store and add a new
parser to internal/store/json.go -- which hasn't happened in
a long time :)
```
I updated the cmd/README with a snippet of the above.
This commit is contained in:
Michael Vogt 2025-06-02 20:16:35 +02:00 committed by Tomáš Hozza
parent 488a53e106
commit acec29dea2
2 changed files with 4 additions and 4 deletions

View file

@ -32,5 +32,6 @@ osbuild-dnf-json-tests
osbuild-image-tests
osbuild-koji-tests
osbuild-mock-openid-provider
osbuild-store-dump
osbuild-upload-*
osbuild-store-dump: the output from this is used in Test_upgrade in internal/store/json_test.go

View file

@ -12,7 +12,6 @@ import (
"github.com/osbuild/blueprint/pkg/blueprint"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/distro/fedora"
"github.com/osbuild/images/pkg/distrofactory"
"github.com/osbuild/images/pkg/dnfjson"
"github.com/osbuild/images/pkg/manifest"
@ -130,7 +129,7 @@ func main() {
const fedoraID = "fedora-37"
d := fedora.DistroFactory(fedoraID)
d := distrofactory.NewDefault().GetDistro(fedoraID)
a, err := d.GetArch(arch.ARCH_X86_64.String())
if err != nil {
panic(err)
@ -154,7 +153,7 @@ func main() {
}
rpmmdCache := path.Join(homeDir, ".cache/osbuild-composer/rpmmd")
df := distrofactory.New(fedora.DistroFactory)
df := distrofactory.NewDefault()
s := store.New(&cwd, df, nil)
if s == nil {