Dont use FindSatisfier() in packageSlices()

Now that install() no longer relies on packageSlices() we can drop the
use of FindSatisfier() so that only direct package names are understood,
this is how pacman -Si works.

This also fixes a small issue where `yay -Si mysql` would fail. This is
because two repo packages provide `mysql`. This causes Yay to not bother
checking the AUR even though there is a package in the AUR called `mysql`
This commit is contained in:
morganamilo 2018-03-19 00:11:40 +00:00
parent df11b85e54
commit 3ceda128fc
No known key found for this signature in database
GPG key ID: 6FE9E7996B0B082E

View file

@ -236,6 +236,7 @@ func packageSlices(toCheck []string) (aur []string, repo []string, err error) {
for _, _pkg := range toCheck {
db, name := splitDbFromName(_pkg)
found := false
if db == "aur" {
aur = append(aur, _pkg)
@ -245,11 +246,19 @@ func packageSlices(toCheck []string) (aur []string, repo []string, err error) {
continue
}
_, errdb := dbList.FindSatisfier(name)
found := errdb == nil
_ = dbList.ForEach(func(db alpm.Db) error {
_, err := db.PkgByName(name)
if err == nil {
found = true
return fmt.Errorf("")
}
return nil
})
if !found {
_, errdb = dbList.PkgCachebyGroup(name)
_, errdb := dbList.PkgCachebyGroup(name)
found = errdb == nil
}