mirror of
https://github.com/Jguer/yay
synced 2024-10-31 04:12:51 +00:00
Use a question callback for ignorepkg
The callback is set to allways silently say yes, When passing to pacman for the intall pacman will then ask the question giving the user a chance to answer.
This commit is contained in:
parent
e0b8c92433
commit
c091460d8c
3 changed files with 15 additions and 1 deletions
12
callbacks.go
Normal file
12
callbacks.go
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
alpm "github.com/jguer/go-alpm"
|
||||||
|
)
|
||||||
|
|
||||||
|
func QuestionCallback(question alpm.QuestionAny) {
|
||||||
|
q, err := question.QuestionInstallIgnorepkg()
|
||||||
|
if err == nil {
|
||||||
|
q.SetInstall(true)
|
||||||
|
}
|
||||||
|
}
|
2
cmd.go
2
cmd.go
|
@ -223,6 +223,8 @@ func initAlpm() (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
alpmHandle.SetQuestionCallback(QuestionCallback)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -184,7 +184,7 @@ func install(parser *arguments) error {
|
||||||
|
|
||||||
//conflicts have been checked so answer y for them
|
//conflicts have been checked so answer y for them
|
||||||
ask, _ := strconv.Atoi(cmdArgs.globals["ask"])
|
ask, _ := strconv.Atoi(cmdArgs.globals["ask"])
|
||||||
uask := alpm.Question(ask) | alpm.QuestionConflictPkg
|
uask := alpm.QuestionType(ask) | alpm.QuestionTypeConflictPkg
|
||||||
cmdArgs.globals["ask"] = fmt.Sprint(uask)
|
cmdArgs.globals["ask"] = fmt.Sprint(uask)
|
||||||
|
|
||||||
//this downloads the package build sources but also causes
|
//this downloads the package build sources but also causes
|
||||||
|
|
Loading…
Reference in a new issue