diff --git a/actions.go b/actions.go index e7c6760a..3f1bffee 100644 --- a/actions.go +++ b/actions.go @@ -26,7 +26,7 @@ func NumberMenu(pkgName string, flags []string) (err error) { var args []string a, err := aur.Search(pkgName, true) - r, err := SearchPackages(pkgName, conf) + r, err := SearchPackages(pkgName) if err != nil { return } @@ -76,7 +76,7 @@ func NumberMenu(pkgName string, flags []string) (err error) { } for _, aurpkg := range aurInstall { - err = aurpkg.Install(BuildDir, conf, flags) + err = aurpkg.Install(BuildDir, &conf, flags) if err != nil { // Do not abandon program, we might still be able to install the rest fmt.Println(err) @@ -133,7 +133,7 @@ func Install(pkgs []string, flags []string) error { } for _, aurpkg := range foreign { - err = aur.Install(aurpkg, BuildDir, conf, flags) + err = aur.Install(aurpkg, BuildDir, &conf, flags) } return nil @@ -142,7 +142,7 @@ func Install(pkgs []string, flags []string) error { // Upgrade handles updating the cache and installing updates. func Upgrade(flags []string) error { errp := UpdatePackages(flags) - erra := aur.UpdatePackages(BuildDir, conf, flags) + erra := aur.UpdatePackages(BuildDir, &conf, flags) if errp != nil { return errp @@ -158,7 +158,7 @@ func Search(pkg string) (err error) { return err } - SearchRepos(pkg, conf, SearchMode) + SearchRepos(pkg, SearchMode) a.PrintSearch(SearchMode) return nil diff --git a/cmd/yay/yay.go b/cmd/yay/yay.go index f836b1b6..a0459dcf 100644 --- a/cmd/yay/yay.go +++ b/cmd/yay/yay.go @@ -68,21 +68,21 @@ func main() { err = yay.LocalStatistics() case "-Ss": for _, pkg := range pkgs { - err = searchMode(pkg, &conf) + err = yay.Search(pkg) } case "-S": - err = InstallPackage(pkgs, &conf, options) + err = yay.Install(pkgs, options) case "-Syu", "-Suy": err = yay.Upgrade(options) case "yogurt": for _, pkg := range pkgs { - err = yay.NumberMenu(pkg, &conf, options) + err = yay.NumberMenu(pkg, options) break } case "--help", "-h": usage() default: - err = passToPacman(op, pkgs, options) + err = yay.PassToPacman(op, pkgs, options) } if err != nil { diff --git a/pacman.go b/pacman.go index 0c18a5db..0ea12b2b 100644 --- a/pacman.go +++ b/pacman.go @@ -61,7 +61,7 @@ func UpdatePackages(flags []string) error { } // SearchRepos searches and prints packages in repo -func SearchRepos(pkgName string, conf *alpm.PacmanConfig, mode int) (err error) { +func SearchRepos(pkgName string, mode int) (err error) { h, err := conf.CreateHandle() defer h.Release() if err != nil { @@ -103,7 +103,7 @@ func SearchRepos(pkgName string, conf *alpm.PacmanConfig, mode int) (err error) } // SearchPackages handles repo searches. Creates a RepoSearch struct. -func SearchPackages(pkgName string, conf *alpm.PacmanConfig) (s RepoSearch, err error) { +func SearchPackages(pkgName string) (s RepoSearch, err error) { h, err := conf.CreateHandle() defer h.Release() if err != nil {