From acec29dea2a6ffc3f4bd9c104f2a99f76a86bd29 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 2 Jun 2025 20:16:35 +0200 Subject: [PATCH] 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. --- cmd/README | 3 ++- cmd/osbuild-store-dump/main.go | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/README b/cmd/README index 9a0a071e9..d818309a9 100644 --- a/cmd/README +++ b/cmd/README @@ -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 diff --git a/cmd/osbuild-store-dump/main.go b/cmd/osbuild-store-dump/main.go index 836240544..d212bb03d 100644 --- a/cmd/osbuild-store-dump/main.go +++ b/cmd/osbuild-store-dump/main.go @@ -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 {