fix(query_builder): use correct aur client for mixed query builder (#2041)

* use same repo search as pacman

use logger child from runtime

* use common interface for aur clients
This commit is contained in:
Jo
2023-04-01 11:33:05 +01:00
committed by GitHub
parent e615f8e07e
commit 5d1c54413c
10 changed files with 44 additions and 58 deletions

10
main.go
View File

@@ -117,16 +117,16 @@ func main() {
if cfg.SeparateSources {
cfg.Runtime.QueryBuilder = query.NewSourceQueryBuilder(
cfg.Runtime.AURClient, cfg.Runtime.AURCache,
cfg.Runtime.AURCache,
cfg.Runtime.Logger.Child("querybuilder"), cfg.SortBy,
cfg.Mode, cfg.SearchBy, cfg.BottomUp,
cfg.SingleLineResults, cfg.NewInstallEngine)
cfg.SingleLineResults)
} else {
cfg.Runtime.QueryBuilder = query.NewMixedSourceQueryBuilder(
cfg.Runtime.AURClient, cfg.Runtime.AURCache,
cfg.Runtime.AURCache,
cfg.Runtime.Logger.Child("mixed.querybuilder"), cfg.SortBy,
cfg.Mode, cfg.SearchBy,
cfg.BottomUp, cfg.SingleLineResults, cfg.NewInstallEngine)
cfg.BottomUp, cfg.SingleLineResults)
}
var useColor bool
@@ -146,7 +146,7 @@ func main() {
text.UseColor = useColor
dbExecutor, err := ialpm.NewExecutor(cfg.Runtime.PacmanConf)
dbExecutor, err := ialpm.NewExecutor(cfg.Runtime.PacmanConf, runtime.Logger.Child("db"))
if err != nil {
if str := err.Error(); str != "" {
text.Errorln(str)