From a888f377a5c805f1da24b556e6a4a9e3678d8eb3 Mon Sep 17 00:00:00 2001 From: Nagy Gabor Date: Sun, 24 Aug 2008 23:24:53 +0200 Subject: HoldPkg rework The HoldPkg feature is even more important when the packages to be held are pulled automatically by pacman, in a -Rc and -Rs operation. Before, it only applied when the packages were explicitly requested by the user to be removed. This patch extends holdpkg to -Rc and -Rs by doing the HoldPkg check just before trans_commit. Additionally, the whole HoldPkg stuff was moved to the front-end. I changed the default behavior to "don't remove", so I modified remove030.py pactest as well. See also: FS#9173. Original-work-by: Xavier Chantry Signed-off-by: Nagy Gabor Signed-off-by: Dan McGee --- src/pacman/pacman.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/pacman/pacman.c') 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 @@ -539,6 +539,11 @@ static int parseargs(int argc, char *argv[]) return(0); } +/* 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) { -- cgit v1.2.3-70-g09d2