From 3d10d460dff4c1321b40fa509c4ff9be93db0ca3 Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Sat, 16 Feb 2008 16:01:13 +0100 Subject: Add new CleanMethod option. As it was already mentioned several times, the new -Sc behavior in 3.1 is great, but only when the package cache is not shared. This option has two possible values : KeepInstalled and KeepCurrent With KeepCurrent, -Sc will clean packages that are no longer available in any sync db, rather than packages that are no longer in the local db. The resulting behavior should be better for shared cache. Ref : http://www.archlinux.org/pipermail/pacman-dev/2008-February/011140.html Signed-off-by: Chantry Xavier Signed-off-by: Dan McGee --- src/pacman/pacman.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/pacman/pacman.c') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 6bc284a3..7240e0fa 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -692,6 +692,16 @@ static int _parseconfig(const char *file, const char *givensection, } else if (strcmp(key, "XferCommand") == 0) { alpm_option_set_xfercommand(ptr); pm_printf(PM_LOG_DEBUG, "config: xfercommand: %s\n", ptr); + } else if (strcmp(key, "CleanMethod") == 0) { + if (strcmp(ptr, "KeepInstalled") == 0) { + config->cleanmethod = PM_CLEAN_KEEPINST; + } else if (strcmp(ptr, "KeepCurrent") == 0) { + config->cleanmethod = PM_CLEAN_KEEPCUR; + } else { + pm_printf(PM_LOG_ERROR, _("invalid value for 'CleanMethod' : '%s'\n"), ptr); + return(1); + } + pm_printf(PM_LOG_DEBUG, "config: cleanmethod: %s\n", ptr); } else { pm_printf(PM_LOG_ERROR, _("config file %s, line %d: directive '%s' not recognized.\n"), file, linenum, key); -- cgit v1.2.3-70-g09d2