diff options
author | Aurelien Foret <aurelien@archlinux.org> | 2006-02-22 20:39:24 +0000 |
---|---|---|
committer | Aurelien Foret <aurelien@archlinux.org> | 2006-02-22 20:39:24 +0000 |
commit | 78ffd98701b64bff74fc530db91ffc7e8768989a (patch) | |
tree | af5142d0a9c51c1e8c465192894ba7520ec177a1 /src/pacman | |
parent | 3f9ddf262df63901c8d91fc8e0a9fe41e5e489d4 (diff) |
fixed outputs when downloadonly flag is set (patch from VMiklos <vmiklos@frugalware.org>)
Diffstat (limited to 'src/pacman')
-rw-r--r-- | src/pacman/trans.c | 20 |
1 files 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; } } |