From 62e244db0ff127e542a5a325d4ff92af05907205 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Tue, 13 Mar 2018 21:36:42 +0000 Subject: [PATCH] Improve db/name system and add support for -Si --- dependencies.go | 8 +++++++- query.go | 21 ++++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/dependencies.go b/dependencies.go index 85447c16..60a121fb 100644 --- a/dependencies.go +++ b/dependencies.go @@ -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) diff --git a/query.go b/query.go index 2d767bb0..0dcca28c 100644 --- a/query.go +++ b/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)