Merge pull request #535 from Morganamilo/fix#534

Properley seprate aur and repo targets.
This commit is contained in:
J Guerreiro 2018-07-06 00:39:09 +01:00 committed by GitHub
commit a06c21d875
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,12 +59,44 @@ func install(parser *arguments) error {
parser.clearTargets() parser.clearTargets()
arguments.clearTargets() arguments.clearTargets()
//seperate aur and repo targets syncDb, err := alpmHandle.SyncDbs()
for _, target := range targets { if err != nil {
if localNamesCache.get(target) { return err
arguments.addTarget(target) }
} else {
parser.addTarget(target) if mode == ModeRepo {
arguments.targets = targets
} else {
alpmHandle.SetQuestionCallback(func(alpm.QuestionAny) {})
//seperate aur and repo targets
for _, _target := range targets {
target := toTarget(_target)
if target.Db == "aur" {
parser.addTarget(_target)
continue
}
var singleDb *alpm.Db
if target.Db != "" {
singleDb, err = alpmHandle.SyncDbByName(target.Db)
if err != nil {
return err
}
fmt.Println(singleDb)
fmt.Println(target.DepString())
_, err = singleDb.PkgCache().FindSatisfier(target.DepString())
fmt.Println("herererrrrrr", err)
} else {
_, err = syncDb.FindSatisfier(target.DepString())
}
if err == nil {
arguments.addTarget(_target)
} else {
parser.addTarget(_target)
}
} }
} }