manifest: introduce GetPackageSetChains()

This returns the package set chains for a given manifest. A package
chain is a list of depsolve requests (include, exclude, repos) to be
performed in sequence as if packages were incrementally installed
to the same image. Each pipeline has its own package set chain, and
the manifest returns a mapping from pipeline name to their
respective chain.

So far this is not used, and always returns the empty chains.

The intention is to eventually make each pipeline (and hence
manifest) self-describing, so they can return exactly the depsolve
requests needed to serialise them, rather than relying on that
information being maintained externally.
This commit is contained in:
Tom Gundersen 2022-06-28 19:03:34 +01:00
parent ef952c90a8
commit d0fa58bb2d
2 changed files with 15 additions and 0 deletions

View file

@ -58,6 +58,16 @@ func (m *Manifest) addInline(data []string) {
m.inlineData = append(m.inlineData, data...)
}
func (m Manifest) GetPackageSetChains() map[string][]rpmmd.PackageSet {
chains := make(map[string][]rpmmd.PackageSet)
for _, pipeline := range m.pipelines {
chains[pipeline.Name()] = pipeline.getPackageSetChain()
}
return chains
}
func (m Manifest) Serialize() (distro.Manifest, error) {
var commits []ostree.CommitSource
for _, commit := range m.osTreeCommits {

View file

@ -13,6 +13,7 @@ import (
type Pipeline interface {
Name() string
getPackageSetChain() []rpmmd.PackageSet
serialize() osbuild2.Pipeline
getPackageSpecs() []rpmmd.PackageSpec
getOSTreeCommits() []osTreeCommit
@ -34,6 +35,10 @@ func (p BasePipeline) Name() string {
return p.name
}
func (p BasePipeline) getPackageSetChain() []rpmmd.PackageSet {
return []rpmmd.PackageSet{}
}
func (p BasePipeline) getPackageSpecs() []rpmmd.PackageSpec {
return []rpmmd.PackageSpec{}
}