Make repositories arch-aware

Introduce an arch field that can be used to filter repositories based on
the local architecture.

If arch is provided and matching with the current GOARCH then the
repository is enabled
This commit is contained in:
Ettore Di Giacinto
2021-10-19 13:05:25 +02:00
parent b00c2ff3cc
commit 2eeb464946
16 changed files with 283 additions and 204 deletions

View File

@@ -40,16 +40,6 @@ It scans the target file system, and if finds a match with a package available i
Run: func(cmd *cobra.Command, args []string) {
util.SetSystemConfig()
// This shouldn't be necessary, but we need to unmarshal the repositories to a concrete struct, thus we need to port them back to the Repositories type
repos := installer.Repositories{}
for _, repo := range LuetCfg.SystemRepositories {
if !repo.Enable {
continue
}
r := installer.NewSystemRepository(repo)
repos = append(repos, r)
}
force := LuetCfg.Viper.GetBool("force")
Debug("Solver", LuetCfg.GetSolverOptions().CompactString())
@@ -58,8 +48,8 @@ It scans the target file system, and if finds a match with a package available i
Concurrency: LuetCfg.GetGeneral().Concurrency,
Force: force,
PreserveSystemEssentialData: true,
PackageRepositories: LuetCfg.SystemRepositories,
})
inst.Repositories(repos)
system := &installer.System{Database: LuetCfg.GetSystemDB(), Target: LuetCfg.GetSystem().Rootfs}
err := inst.Reclaim(system)