From f9505063f804b9e1c736299b2387e1ddfbdc4f97 Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Wed, 17 Dec 2008 16:25:07 +0530 Subject: Added gpg verification options per repo to the config file. Once we do this, add support for VerifySig to pactest. We just check if the repo name contains Always, Never or Optional to determine the value of VerifySig. The default is Never. pacman uses Always by default but this is not suitable for pactest. Original-work-by: shankar Signed-off-by: Xavier Chantry Signed-off-by: Dan McGee --- src/pacman/pacman.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 706e97be..0487ee87 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -1241,6 +1241,24 @@ static int _parseconfig(const char *file, const char *givensection, ret = 1; goto cleanup; } + } else if(strcmp(key, "VerifySig") == 0) { + if (strcmp(value, "Always") == 0) { + ret = alpm_db_set_pgp_verify(db,PM_PGP_VERIFY_ALWAYS); + } else if (strcmp(value, "Optional") == 0) { + ret = alpm_db_set_pgp_verify(db,PM_PGP_VERIFY_OPTIONAL); + } else if (strcmp(value, "Never") == 0) { + ret = alpm_db_set_pgp_verify(db,PM_PGP_VERIFY_NEVER); + } else { + pm_printf(PM_LOG_ERROR, _("invalid value for 'VerifySig' : '%s'\n"), value); + ret = 1; + goto cleanup; + } + if (ret != 0) { + pm_printf(PM_LOG_ERROR, _("could not add pgp verify option to database '%s': %s (%s)\n"), + alpm_db_get_name(db), value, alpm_strerrorlast()); + goto cleanup; + } + pm_printf(PM_LOG_DEBUG, "config: VerifySig for %s: %s\n",alpm_db_get_name(db), value); } else { pm_printf(PM_LOG_WARNING, _("config file %s, line %d: directive '%s' in section '%s' not recognized.\n"), -- cgit v1.2.3-24-g4f1b