summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pacman/callback.c4
-rw-r--r--src/pacman/conf.c1
-rw-r--r--src/pacman/conf.h1
-rw-r--r--src/pacman/pacman.c7
-rw-r--r--src/pacman/remove.c15
5 files changed, 23 insertions, 5 deletions
diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index 9f1cca89..6e7930cb 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -258,10 +258,6 @@ void cb_trans_conv(pmtransconv_t event, void *data1, void *data2,
alpm_pkg_get_name(data1));
}
break;
- case PM_TRANS_CONV_REMOVE_HOLDPKG:
- *response = yesno(_(":: %s is designated as a HoldPkg. Remove anyway?"),
- alpm_pkg_get_name(data1));
- break;
case PM_TRANS_CONV_REPLACE_PKG:
*response = yesno(_(":: Replace %s with %s/%s?"),
alpm_pkg_get_name(data1),
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index 5853facc..ca5cd123 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -54,6 +54,7 @@ int config_free(config_t *oldconfig)
return(-1);
}
+ FREELIST(oldconfig->holdpkg);
FREELIST(oldconfig->syncfirst);
free(oldconfig->configfile);
free(oldconfig->rootdir);
diff --git a/src/pacman/conf.h b/src/pacman/conf.h
index 8ea66629..466d9832 100644
--- a/src/pacman/conf.h
+++ b/src/pacman/conf.h
@@ -69,6 +69,7 @@ typedef struct __config_t {
* downloaded of the total download list */
unsigned short totaldownload;
unsigned short cleanmethod; /* select -Sc behavior */
+ alpm_list_t *holdpkg;
alpm_list_t *syncfirst;
} config_t;
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 3255cdf0..59916d62 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -540,6 +540,11 @@ static int parseargs(int argc, char *argv[])
}
/* helper for being used with setrepeatingoption */
+static void option_add_holdpkg(const char *name) {
+ config->holdpkg = alpm_list_add(config->holdpkg, strdup(name));
+}
+
+/* helper for being used with setrepeatingoption */
static void option_add_syncfirst(const char *name) {
config->syncfirst = alpm_list_add(config->syncfirst, strdup(name));
}
@@ -702,7 +707,7 @@ static int _parseconfig(const char *file, const char *givensection,
} else if(strcmp(key, "IgnoreGroup") == 0) {
setrepeatingoption(ptr, "IgnoreGroup", alpm_option_add_ignoregrp);
} else if(strcmp(key, "HoldPkg") == 0) {
- setrepeatingoption(ptr, "HoldPkg", alpm_option_add_holdpkg);
+ setrepeatingoption(ptr, "HoldPkg", option_add_holdpkg);
} else if(strcmp(key, "SyncFirst") == 0) {
setrepeatingoption(ptr, "SyncFirst", option_add_syncfirst);
} else if(strcmp(key, "DBPath") == 0) {
diff --git a/src/pacman/remove.c b/src/pacman/remove.c
index b70f7035..841a08bb 100644
--- a/src/pacman/remove.c
+++ b/src/pacman/remove.c
@@ -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) {