[pacman-dev] [PATCH 4/4] Allow VerifySig to act as a default verification in [options]
Dan McGee
dpmcgee at gmail.com
Wed Apr 20 20:41:29 EDT 2011
On Mon, Mar 28, 2011 at 2:15 PM, Dave Reisner <d at falconindy.com> wrote:
> diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
> index 381d2bc..012043d 100644
> --- a/src/pacman/pacman.c
> +++ b/src/pacman/pacman.c
> @@ -1038,22 +1038,34 @@ static int _parse_options(const char *key, char *value,
> config->rootdir = strdup(value);
> pm_printf(PM_LOG_DEBUG, "config: rootdir: %s\n", value);
> }
> - } else if (strcmp(key, "GPGDir") == 0) {
> + } else if(strcmp(key, "GPGDir") == 0) {
> if(!config->gpgdir) {
> config->gpgdir = strdup(value);
> pm_printf(PM_LOG_DEBUG, "config: gpgdir: %s\n", value);
> }
> - } else if (strcmp(key, "LogFile") == 0) {
> + } else if(strcmp(key, "LogFile") == 0) {
> if(!config->logfile) {
> config->logfile = strdup(value);
> pm_printf(PM_LOG_DEBUG, "config: logfile: %s\n", value);
> }
> - } else if (strcmp(key, "XferCommand") == 0) {
> + } else if(strcmp(key, "XferCommand") == 0) {
> config->xfercommand = strdup(value);
> alpm_option_set_fetchcb(download_with_xfercommand);
> pm_printf(PM_LOG_DEBUG, "config: xfercommand: %s\n", value);
> - } else if (strcmp(key, "CleanMethod") == 0) {
> + } else if(strcmp(key, "CleanMethod") == 0) {
> setrepeatingoption(value, "CleanMethod", option_add_cleanmethod);
> + } else if(strcmp(key, "VerifySig") == 0) {
> + if (strcmp(value, "Always") == 0) {
> + alpm_option_set_default_sigverify(PM_PGP_VERIFY_ALWAYS);
> + } else if(strcmp(value, "Optional") == 0) {
> + alpm_option_set_default_sigverify(PM_PGP_VERIFY_OPTIONAL);
> + } else if(strcmp(value, "Never") == 0) {
> + alpm_option_set_default_sigverify(PM_PGP_VERIFY_NEVER);
> + } else {
> + pm_printf(PM_LOG_ERROR, _("invalid value for 'VerifySig' : '%s'\n"), value);
> + return 1;
> + }
> + pm_printf(PM_LOG_DEBUG, "config: setting default VerifySig: %s\n", value);
> } else {
>
> pm_printf(PM_LOG_WARNING,
Pro tip- please don't mix syntax/reformatting patches with actual
work. I've cleaned this one up anyway since it doesn't apply cleanly
without your other patch, but keep that in mind in the future...
-Dan
More information about the pacman-dev
mailing list