Skip to content

Commit

Permalink
composer: simplify loading the repositories
Browse files Browse the repository at this point in the history
Move to use `reporegistry.New(repositoryConfigs)` which will do
the equivivalent of the existing code and is shorter.

With this merged we can unexport `LoadAllRepositories()` and
remove `NewFromDistrosRepoConfigs` from the "images" library
as this is the only place using them.
  • Loading branch information
mvo5 committed Oct 29, 2024
1 parent d29f466 commit 2f4572f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/osbuild-composer/composer.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,10 @@ func NewComposer(config *ComposerConfigFile, stateDir, cacheDir string) (*Compos
return nil, fmt.Errorf("failed to configure distro aliases: %v", err)
}

repoConfigs, err := reporegistry.LoadAllRepositories(repositoryConfigs)
c.repos, err = reporegistry.New(repositoryConfigs)
if err != nil {
return nil, fmt.Errorf("error loading repository definitions: %v", err)
}
c.repos = reporegistry.NewFromDistrosRepoConfigs(repoConfigs)

c.solver = dnfjson.NewBaseSolver(path.Join(c.cacheDir, "rpmmd"))
c.solver.SetDNFJSONPath(c.config.DNFJson)
Expand Down

0 comments on commit 2f4572f

Please sign in to comment.