index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2007-08-20 16:34:43 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-10-08 20:46:55 -0500 |
commit | 1ff8e7f364a9f640ada7526384646d510ac29967 (patch) | |
tree | 39d17ca6040f2d1d5d5dc122e3e235abf17f2bca /src/pacman/callback.c | |
parent | 60dc4b43fd4ad1c1ca2ab31f7ace7179fe3d1844 (diff) |
-rw-r--r-- | src/pacman/callback.c | 123 |
diff --git a/src/pacman/callback.c b/src/pacman/callback.c index 0e4ef11a..6d257133 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -255,118 +255,65 @@ void cb_trans_conv(pmtransconv_t event, void *data1, void *data2, switch(event) { case PM_TRANS_CONV_INSTALL_IGNOREPKG: - if(config->noask) { - if(config->ask & PM_TRANS_CONV_INSTALL_IGNOREPKG) { - *response = 1; - } else { - *response = 0; - } - } else if(data2) { + if(data2) { /* TODO we take this route based on data2 being not null? WTF */ snprintf(str, LOG_STR_LEN, _(":: %s requires installing %s from IgnorePkg. Install anyway? [Y/n] "), - alpm_pkg_get_name(data1), - alpm_pkg_get_name(data2)); + alpm_pkg_get_name(data1), + alpm_pkg_get_name(data2)); *response = yesno(str); } else { snprintf(str, LOG_STR_LEN, _(":: %s is in IgnorePkg. Install anyway? [Y/n] "), - alpm_pkg_get_name(data1)); + alpm_pkg_get_name(data1)); *response = yesno(str); } break; case PM_TRANS_CONV_REMOVE_HOLDPKG: - if(config->noask) { - if(config->ask & PM_TRANS_CONV_REMOVE_HOLDPKG) { - *response = 1; - } else { - *response = 0; - } - } else { - snprintf(str, LOG_STR_LEN, _(":: %s is designated as a HoldPkg. Remove anyway? [Y/n] "), - alpm_pkg_get_name(data1)); - *response = yesno(str); - } + snprintf(str, LOG_STR_LEN, _(":: %s is designated as a HoldPkg. Remove anyway? [Y/n] "), + alpm_pkg_get_name(data1)); + *response = yesno(str); break; case PM_TRANS_CONV_REPLACE_PKG: - if(config->noask) { - if(config->ask & PM_TRANS_CONV_REPLACE_PKG) { - *response = 1; - } else { - *response = 0; - } - } else { - snprintf(str, LOG_STR_LEN, _(":: Replace %s with %s/%s? [Y/n] "), - alpm_pkg_get_name(data1), - (char *)data3, - alpm_pkg_get_name(data2)); - *response = yesno(str); - } + snprintf(str, LOG_STR_LEN, _(":: Replace %s with %s/%s? [Y/n] "), + alpm_pkg_get_name(data1), + (char *)data3, + alpm_pkg_get_name(data2)); + *response = yesno(str); break; case PM_TRANS_CONV_CONFLICT_PKG: - if(config->noask) { - if(config->ask & PM_TRANS_CONV_CONFLICT_PKG) { - *response = 1; - } else { - *response = 0; - } - } else { - snprintf(str, LOG_STR_LEN, _(":: %s conflicts with %s. Remove %s? [Y/n] "), - (char *)data1, - (char *)data2, - (char *)data2); - *response = yesno(str); - } + snprintf(str, LOG_STR_LEN, _(":: %s conflicts with %s. Remove %s? [Y/n] "), + (char *)data1, + (char *)data2, + (char *)data2); + *response = yesno(str); break; case PM_TRANS_CONV_LOCAL_NEWER: - if(config->noask) { - if(config->ask & PM_TRANS_CONV_LOCAL_NEWER) { - *response = 1; - } else { - *response = 0; - } + + if(!config->op_s_downloadonly) { + snprintf(str, LOG_STR_LEN, _(":: %s-%s: local version is newer. Upgrade anyway? [Y/n] "), + alpm_pkg_get_name(data1), + alpm_pkg_get_version(data1)); + *response = yesno(str); } else { - if(!config->op_s_downloadonly) { - snprintf(str, LOG_STR_LEN, _(":: %s-%s: local version is newer. Upgrade anyway? [Y/n] "), - alpm_pkg_get_name(data1), - alpm_pkg_get_version(data1)); - *response = yesno(str); - } else { - *response = 1; - } + *response = 1; } break; case PM_TRANS_CONV_LOCAL_UPTODATE: - if(config->noask) { - if(config->ask & PM_TRANS_CONV_LOCAL_UPTODATE) { - *response = 1; - } else { - *response = 0; - } + if(!config->op_s_downloadonly) { + snprintf(str, LOG_STR_LEN, _(":: %s-%s: local version is up to date. Upgrade anyway? [Y/n] "), + alpm_pkg_get_name(data1), + alpm_pkg_get_version(data1)); + *response = yesno(str); } else { - if(!config->op_s_downloadonly) { - snprintf(str, LOG_STR_LEN, _(":: %s-%s: local version is up to date. Upgrade anyway? [Y/n] "), - alpm_pkg_get_name(data1), - alpm_pkg_get_version(data1)); - *response = yesno(str); - } else { - *response = 1; - } + *response = 1; } break; case PM_TRANS_CONV_CORRUPTED_PKG: - if(config->noask) { - if(config->ask & PM_TRANS_CONV_CORRUPTED_PKG) { - *response = 1; - } else { - *response = 0; - } + if(!config->noconfirm) { + snprintf(str, LOG_STR_LEN, _(":: Archive %s is corrupted. Do you want to delete it? [Y/n] "), + (char *)data1); + *response = yesno(str); } else { - if(!config->noconfirm) { - snprintf(str, LOG_STR_LEN, _(":: Archive %s is corrupted. Do you want to delete it? [Y/n] "), - (char *)data1); - *response = yesno(str); - } else { - *response = 1; - } + *response = 1; } break; } |