From 78ffd98701b64bff74fc530db91ffc7e8768989a Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Wed, 22 Feb 2006 20:39:24 +0000 Subject: fixed outputs when downloadonly flag is set (patch from VMiklos ) --- src/pacman/trans.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/pacman/trans.c b/src/pacman/trans.c index 07ac3a3b..ede5bd6f 100644 --- a/src/pacman/trans.c +++ b/src/pacman/trans.c @@ -32,9 +32,13 @@ #include "util.h" #include "log.h" #include "trans.h" +#include "list.h" +#include "conf.h" #define LOG_STR_LEN 256 +extern config_t *config; + /* Callback to handle transaction events */ void cb_trans_evt(unsigned char event, void *data1, void *data2) @@ -120,16 +124,24 @@ void cb_trans_conv(unsigned char event, void *data1, void *data2, void *data3, i *response = yesno(str); break; case PM_TRANS_CONV_LOCAL_NEWER: - snprintf(str, LOG_STR_LEN, ":: %s-%s: local version is newer. Upgrade anyway? [Y/n] ", + if(!config->op_s_downloadonly) { + snprintf(str, LOG_STR_LEN, ":: %s-%s: local version is newer. Upgrade anyway? [Y/n] ", (char *)alpm_pkg_getinfo(data1, PM_PKG_NAME), (char *)alpm_pkg_getinfo(data1, PM_PKG_VERSION)); - *response = yesno(str); + *response = yesno(str); + } else { + *response = 1; + } break; case PM_TRANS_CONV_LOCAL_UPTODATE: - snprintf(str, LOG_STR_LEN, ":: %s-%s: local version is up to date. Upgrade anyway? [Y/n] ", + if(!config->op_s_downloadonly) { + snprintf(str, LOG_STR_LEN, ":: %s-%s: local version is up to date. Upgrade anyway? [Y/n] ", (char *)alpm_pkg_getinfo(data1, PM_PKG_NAME), (char *)alpm_pkg_getinfo(data1, PM_PKG_VERSION)); - *response = yesno(str); + *response = yesno(str); + } else { + *response = 1; + } break; } } -- cgit v1.2.3-24-g4f1b