summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pacman/callback.c6
-rw-r--r--src/pacman/conf.c3
-rw-r--r--src/pacman/util.c8
3 files changed, 10 insertions, 7 deletions
diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index c299564c..c6146a3c 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -153,6 +153,9 @@ static void fill_progress(const int bar_percent, const int disp_percent,
/* callback to handle messages/notifications from libalpm transactions */
void cb_trans_evt(alpm_transevt_t event, void *data1, void *data2)
{
+ if(config->print) {
+ return;
+ }
switch(event) {
case ALPM_TRANS_EVT_CHECKDEPS_START:
printf(_("checking dependencies...\n"));
@@ -252,6 +255,9 @@ void cb_trans_evt(alpm_transevt_t event, void *data1, void *data2)
void cb_trans_conv(alpm_transconv_t event, void *data1, void *data2,
void *data3, int *response)
{
+ if(config->print) {
+ return;
+ }
switch(event) {
case ALPM_TRANS_CONV_INSTALL_IGNOREPKG:
if(!config->op_s_downloadonly) {
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index fe858499..f87824c9 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -534,6 +534,9 @@ static int setup_libalpm(void)
alpm_option_set_logcb(handle, cb_log);
alpm_option_set_dlcb(handle, cb_dl_progress);
+ alpm_option_set_eventcb(handle, cb_trans_evt);
+ alpm_option_set_convcb(handle, cb_trans_conv);
+ alpm_option_set_progresscb(handle, cb_trans_progress);
config->logfile = config->logfile ? config->logfile : strdup(LOGFILE);
ret = alpm_option_set_logfile(handle, config->logfile);
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 599c18c4..594186f6 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -55,13 +55,7 @@ int trans_init(alpm_transflag_t flags, int check_valid)
check_syncdbs(0, check_valid);
- if(config->print) {
- ret = alpm_trans_init(config->handle, flags, NULL, NULL, NULL);
- } else {
- ret = alpm_trans_init(config->handle, flags, cb_trans_evt, cb_trans_conv,
- cb_trans_progress);
- }
-
+ ret = alpm_trans_init(config->handle, flags);
if(ret == -1) {
trans_init_error();
return -1;