diff --git a/callbacks.go b/callbacks.go new file mode 100644 index 00000000..2973d804 --- /dev/null +++ b/callbacks.go @@ -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) + } +} diff --git a/cmd.go b/cmd.go index ef46e33e..02b37770 100644 --- a/cmd.go +++ b/cmd.go @@ -223,6 +223,8 @@ func initAlpm() (err error) { return } + alpmHandle.SetQuestionCallback(QuestionCallback) + return } diff --git a/install.go b/install.go index 6c273dcb..3945bcfc 100644 --- a/install.go +++ b/install.go @@ -184,7 +184,7 @@ func install(parser *arguments) error { //conflicts have been checked so answer y for them ask, _ := strconv.Atoi(cmdArgs.globals["ask"]) - uask := alpm.Question(ask) | alpm.QuestionConflictPkg + uask := alpm.QuestionType(ask) | alpm.QuestionTypeConflictPkg cmdArgs.globals["ask"] = fmt.Sprint(uask) //this downloads the package build sources but also causes