From ad3e43dc904fa3b17da1c3de8d3d1545f0ad9d56 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 16 Mar 2021 09:29:12 -0700 Subject: [PATCH] osbuild-store-dump: Add Packages support The compose now saves the list of packages used to create the manifest. --- cmd/osbuild-store-dump/main.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/osbuild-store-dump/main.go b/cmd/osbuild-store-dump/main.go index 290ffb350..0c5a31d5b 100644 --- a/cmd/osbuild-store-dump/main.go +++ b/cmd/osbuild-store-dump/main.go @@ -16,7 +16,7 @@ import ( "github.com/osbuild/osbuild-composer/internal/target" ) -func getManifest(bp blueprint.Blueprint, t distro.ImageType, a distro.Arch, d distro.Distro, rpm_md rpmmd.RPMMD, repos []rpmmd.RepoConfig) distro.Manifest { +func getManifest(bp blueprint.Blueprint, t distro.ImageType, a distro.Arch, d distro.Distro, rpm_md rpmmd.RPMMD, repos []rpmmd.RepoConfig) (distro.Manifest, []rpmmd.PackageSpec) { packageSets := t.PackageSets(bp) pkgSpecSets := make(map[string][]rpmmd.PackageSpec) for name, packages := range packageSets { @@ -31,7 +31,7 @@ func getManifest(bp blueprint.Blueprint, t distro.ImageType, a distro.Arch, d di panic(err) } - return manifest + return manifest, pkgSpecSets["packages"] } func main() { @@ -155,8 +155,9 @@ func main() { if err != nil { panic(err) } + manifest, packages := getManifest(bp2, t1, a, d, rpmmd, repos) err = s.PushCompose(id1, - getManifest(bp2, t1, a, d, rpmmd, repos), + manifest, t1, &bp2, 0, @@ -164,12 +165,14 @@ func main() { awsTarget, }, id1, + packages, ) if err != nil { panic(err) } + manifest, packages = getManifest(bp2, t2, a, d, rpmmd, repos) err = s.PushCompose(id2, - getManifest(bp2, t2, a, d, rpmmd, repos), + manifest, t2, &bp2, 0, @@ -177,6 +180,7 @@ func main() { awsTarget, }, id2, + packages, ) if err != nil { panic(err)