mirror of
https://github.com/Jguer/yay.git
synced 2025-10-08 00:04:37 -04:00
Merge pull request #455 from Morganamilo/fixyogurt
Don't show provider menu for targets during -Y
This commit is contained in:
commit
68ca822fc7
43
depPool.go
43
depPool.go
@ -377,6 +377,12 @@ func (dp *depPool) findSatisfierAur(dep string) *rpc.Pkg {
|
|||||||
// This is mostly used to promote packages from the cache
|
// This is mostly used to promote packages from the cache
|
||||||
// to the Install list
|
// to the Install list
|
||||||
// Provide a pacman style provider menu if theres more than one candidate
|
// Provide a pacman style provider menu if theres more than one candidate
|
||||||
|
// This acts slightly differenly from Pacman, It will give
|
||||||
|
// a menu even if a package with a matching name exists. I believe this
|
||||||
|
// method is better because most of the time you are choosing between
|
||||||
|
// foo and foo-git.
|
||||||
|
// Using Pacman's ways trying to install foo would never give you
|
||||||
|
// a menu.
|
||||||
// TODO: maybe intermix repo providers in the menu
|
// TODO: maybe intermix repo providers in the menu
|
||||||
func (dp *depPool) findSatisfierAurCache(dep string) *rpc.Pkg {
|
func (dp *depPool) findSatisfierAurCache(dep string) *rpc.Pkg {
|
||||||
depName, _, _ := splitDep(dep)
|
depName, _, _ := splitDep(dep)
|
||||||
@ -387,33 +393,20 @@ func (dp *depPool) findSatisfierAurCache(dep string) *rpc.Pkg {
|
|||||||
if pkg, ok := dp.AurCache[dep]; ok && pkgSatisfies(pkg.Name, pkg.Version, dep) {
|
if pkg, ok := dp.AurCache[dep]; ok && pkgSatisfies(pkg.Name, pkg.Version, dep) {
|
||||||
return pkg
|
return pkg
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//this version prioratizes name over provides
|
if cmdArgs.op == "Y" || cmdArgs.op == "yay" {
|
||||||
//if theres a direct match for a package return
|
for _, pkg := range dp.AurCache {
|
||||||
//that instead of using the menu
|
if pkgSatisfies(pkg.Name, pkg.Version, dep) {
|
||||||
//
|
for _, target := range dp.Targets {
|
||||||
//providers := make(rpcPkgs, 0)
|
if target.Name == pkg.Name {
|
||||||
//for _, pkg := range dp.AurCache {
|
return pkg
|
||||||
// if pkgSatisfies(pkg.Name, pkg.Version, dep) {
|
}
|
||||||
// return pkg
|
}
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
}
|
||||||
//for _, pkg := range dp.AurCache {
|
|
||||||
// for _, provide := range pkg.Provides {
|
|
||||||
// if provideSatisfies(provide, dep) {
|
|
||||||
// providers = append(providers, pkg)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
// This version acts slightly differenly from Pacman, It will give
|
|
||||||
// a menu even if a package with a matching name exists. I believe this
|
|
||||||
// method is better because most of the time you are choosing between
|
|
||||||
// foo and foo-git.
|
|
||||||
// Using Pacman's ways trying to install foo would never give you
|
|
||||||
// a menu.
|
|
||||||
|
|
||||||
for _, pkg := range dp.AurCache {
|
for _, pkg := range dp.AurCache {
|
||||||
if seen.get(pkg.Name) {
|
if seen.get(pkg.Name) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user