mirror of
https://github.com/Jguer/yay.git
synced 2025-11-28 00:05:15 -05: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
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…
x
Reference in New Issue
Block a user