summaryrefslogtreecommitdiff
path: root/src/pacman/remove.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pacman/remove.c')
-rw-r--r--src/pacman/remove.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/pacman/remove.c b/src/pacman/remove.c
index f091fa4d..11bc157f 100644
--- a/src/pacman/remove.c
+++ b/src/pacman/remove.c
@@ -75,10 +75,10 @@ int pacman_remove(alpm_list_t *targets)
}
printf(_(":: group %s:\n"), targ);
list_display(" ", pkgnames);
- int all = yesno(1, _(" Remove whole content?"));
+ int all = yesno(_(" Remove whole content?"));
for(p = pkgnames; p; p = alpm_list_next(p)) {
char *pkgn = alpm_list_getdata(p);
- if(all || yesno(1, _(":: Remove %s from group %s?"), pkgn, targ)) {
+ if(all || yesno(_(":: Remove %s from group %s?"), pkgn, targ)) {
if(alpm_trans_addtarget(pkgn) == -1) {
pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", targ,
alpm_strerrorlast());
@@ -107,7 +107,7 @@ int pacman_remove(alpm_list_t *targets)
for(i = data; i; i = alpm_list_next(i)) {
pmdepmissing_t *miss = alpm_list_getdata(i);
pmdepend_t *dep = alpm_miss_get_dep(miss);
- char *depstring = alpm_dep_get_string(dep);
+ char *depstring = alpm_dep_compute_string(dep);
printf(_(":: %s: requires %s\n"), alpm_miss_get_target(miss),
depstring);
free(depstring);
@@ -121,6 +121,21 @@ int pacman_remove(alpm_list_t *targets)
goto cleanup;
}
+ /* Search for holdpkg in target list */
+ int holdpkg = 0;
+ for(i = alpm_trans_get_pkgs(); i; i = alpm_list_next(i)) {
+ pmpkg_t *pkg = alpm_list_getdata(i);
+ if(alpm_list_find_str(config->holdpkg, alpm_pkg_get_name(pkg))) {
+ pm_printf(PM_LOG_WARNING, _("%s is designated as a HoldPkg.\n"),
+ alpm_pkg_get_name(pkg));
+ holdpkg = 1;
+ }
+ }
+ if(holdpkg && (noyes(_("HoldPkg was found in target list. Do you want to continue?")) == 0)) {
+ retval = 1;
+ goto cleanup;
+ }
+
/* Warn user in case of dangerous operation */
if(config->flags & PM_TRANS_FLAG_RECURSE ||
config->flags & PM_TRANS_FLAG_CASCADE) {
@@ -131,7 +146,7 @@ int pacman_remove(alpm_list_t *targets)
printf("\n");
/* get confirmation */
- if(yesno(1, _("Do you want to remove these packages?")) == 0) {
+ if(yesno(_("Do you want to remove these packages?")) == 0) {
retval = 1;
goto cleanup;
}