composer: use distro name aliases from configuration

Register the distro name aliases from the configuration on the distro
factory.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2024-01-10 22:10:22 +01:00 committed by Achilleas Koutsou
parent b79eaeb78e
commit 8ba3426f12

View file

@ -69,9 +69,10 @@ func NewComposer(config *ComposerConfigFile, stateDir, cacheDir string) (*Compos
}
c.distros = distrofactory.NewDefault()
// TODO: set the c.config.DistroAliases to the distrofactory
// More work is needed to make the distro aliases behavior consistent for Weldr API,
// specifically for picking the correct repositories definition.
err = c.distros.RegisterAliases(config.DistroAliases)
if err != nil {
return nil, fmt.Errorf("failed to configure distro aliases: %v", err)
}
c.solver = dnfjson.NewBaseSolver(path.Join(c.cacheDir, "rpmmd"))
c.solver.SetDNFJSONPath(c.config.DNFJson)