Merge pull request #242 from Morganamilo/dbname

Improve db/name system and add support for -Si
This commit is contained in:
Morgana 2018-03-13 23:59:51 +00:00 committed by GitHub
commit 345cc5475b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 4 deletions

View File

@ -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)

View File

@ -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)