Skip to content

Commit

Permalink
fix(dbExecutor): rename functions to use dbExecutor
Browse files Browse the repository at this point in the history
  • Loading branch information
Jguer committed Aug 16, 2020
1 parent 7a3794a commit 1ccfd3f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
8 changes: 4 additions & 4 deletions cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,17 +324,17 @@ func displayNumberMenu(pkgS []string, dbExecutor db.Executor, cmdArgs *settings.
switch config.SortMode {
case settings.TopDown:
if config.Runtime.Mode == settings.ModeRepo || config.Runtime.Mode == settings.ModeAny {
pq.printSearch(config.Runtime.DBExecutor)
pq.printSearch(dbExecutor)
}
if config.Runtime.Mode == settings.ModeAUR || config.Runtime.Mode == settings.ModeAny {
aq.printSearch(lenpq+1, config.Runtime.DBExecutor)
aq.printSearch(lenpq+1, dbExecutor)
}
case settings.BottomUp:
if config.Runtime.Mode == settings.ModeAUR || config.Runtime.Mode == settings.ModeAny {
aq.printSearch(lenpq+1, config.Runtime.DBExecutor)
aq.printSearch(lenpq+1, dbExecutor)
}
if config.Runtime.Mode == settings.ModeRepo || config.Runtime.Mode == settings.ModeAny {
pq.printSearch(config.Runtime.DBExecutor)
pq.printSearch(dbExecutor)
}
default:
return fmt.Errorf(gotext.Get("invalid sort mode. Fix with yay -Y --bottomup --save"))
Expand Down
6 changes: 3 additions & 3 deletions install.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func install(cmdArgs *settings.Arguments, dbExecutor db.Executor, ignoreProvider
}
}
} else if cmdArgs.ExistsArg("y", "refresh") || cmdArgs.ExistsArg("u", "sysupgrade") || len(cmdArgs.Targets) > 0 {
err = earlyPacmanCall(cmdArgs, config.Runtime.DBExecutor)
err = earlyPacmanCall(cmdArgs, dbExecutor)
if err != nil {
return err
}
Expand All @@ -91,7 +91,7 @@ func install(cmdArgs *settings.Arguments, dbExecutor db.Executor, ignoreProvider

// we may have done -Sy, our handle now has an old
// database.
err = config.Runtime.DBExecutor.RefreshHandle()
err = dbExecutor.RefreshHandle()
if err != nil {
return err
}
Expand Down Expand Up @@ -151,7 +151,7 @@ func install(cmdArgs *settings.Arguments, dbExecutor db.Executor, ignoreProvider
targets := stringset.FromSlice(cmdArgs.Targets)

dp, err := dep.GetPool(requestTargets,
warnings, config.Runtime.DBExecutor, config.Runtime.Mode,
warnings, dbExecutor, config.Runtime.Mode,
ignoreProviders, config.NoConfirm, config.Provides, config.ReBuild, config.RequestSplitN)
if err != nil {
return err
Expand Down
3 changes: 0 additions & 3 deletions pkg/settings/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"github.com/Morganamilo/go-pacmanconf"
"github.com/leonelquinteros/gotext"
"github.com/pkg/errors"

"github.com/Jguer/yay/v10/pkg/db"
)

type TargetMode int
Expand All @@ -34,7 +32,6 @@ type Runtime struct {
ConfigPath string
VCSPath string
PacmanConf *pacmanconf.Config
DBExecutor db.Executor
}

func MakeRuntime() (*Runtime, error) {
Expand Down
2 changes: 1 addition & 1 deletion print.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func biggestPackages(dbExecutor db.Executor) {
func localStatistics(dbExecutor db.Executor) error {
info := statistics(dbExecutor)

_, remoteNames, err := query.GetPackageNamesBySource(config.Runtime.DBExecutor)
_, remoteNames, err := query.GetPackageNamesBySource(dbExecutor)
if err != nil {
return err
}
Expand Down

0 comments on commit 1ccfd3f

Please sign in to comment.