mirror of
https://github.com/Jguer/yay.git
synced 2024-11-07 01:27:21 +01:00
Merge pull request #242 from Morganamilo/dbname
Improve db/name system and add support for -Si
This commit is contained in:
commit
345cc5475b
@ -276,6 +276,12 @@ func getDepTree(pkgs []string) (*depTree, error) {
|
||||
|
||||
db, name := splitDbFromName(pkg)
|
||||
|
||||
if db == "aur" {
|
||||
dt.ToProcess.set(name)
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
// Check the repos for a matching dep
|
||||
foundPkg, errdb := syncDb.FindSatisfier(name)
|
||||
found := errdb == nil && (foundPkg.DB().Name() == db || db == "")
|
||||
@ -289,7 +295,7 @@ func getDepTree(pkgs []string) (*depTree, error) {
|
||||
continue
|
||||
}
|
||||
|
||||
if db == "" || db == "aur" {
|
||||
if db == "" {
|
||||
dt.ToProcess.set(name)
|
||||
} else {
|
||||
dt.Missing.set(pkg)
|
||||
|
21
query.go
21
query.go
@ -144,7 +144,14 @@ func syncInfo(pkgS []string) (err error) {
|
||||
}
|
||||
|
||||
if len(aurS) != 0 {
|
||||
info, err = aurInfo(aurS)
|
||||
noDb := make([]string, 0, len(aurS))
|
||||
|
||||
for _, pkg := range aurS {
|
||||
_, name := splitDbFromName(pkg)
|
||||
noDb = append(noDb, name)
|
||||
}
|
||||
|
||||
info, err = aurInfo(noDb)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
@ -230,8 +237,16 @@ func packageSlices(toCheck []string) (aur []string, repo []string, err error) {
|
||||
for _, _pkg := range toCheck {
|
||||
db, name := splitDbFromName(_pkg)
|
||||
|
||||
foundPkg, errdb := dbList.FindSatisfier(name)
|
||||
found := errdb == nil && (foundPkg.DB().Name() == db || db == "")
|
||||
if db == "aur" {
|
||||
aur = append(aur, _pkg)
|
||||
continue
|
||||
} else if db != "" {
|
||||
repo = append(repo, _pkg)
|
||||
continue
|
||||
}
|
||||
|
||||
_, errdb := dbList.FindSatisfier(name)
|
||||
found := errdb == nil
|
||||
|
||||
if !found {
|
||||
_, errdb = dbList.PkgCachebyGroup(_pkg)
|
||||
|
Loading…
Reference in New Issue
Block a user