--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 07EE1431FBC\r
+ for <notmuch@notmuchmail.org>; Sat, 7 Mar 2015 09:12:50 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 1.738\r
+X-Spam-Level: *\r
+X-Spam-Status: No, score=1.738 tagged_above=-999 required=5\r
+ tests=[DNS_FROM_AHBL_RHSBL=2.438, RCVD_IN_DNSWL_LOW=-0.7]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 7BJFOq26zaCL for <notmuch@notmuchmail.org>;\r
+ Sat, 7 Mar 2015 09:12:46 -0800 (PST)\r
+Received: from mail-we0-f172.google.com (mail-we0-f172.google.com\r
+ [74.125.82.172]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 91C5B431FAE\r
+ for <notmuch@notmuchmail.org>; Sat, 7 Mar 2015 09:12:46 -0800 (PST)\r
+Received: by wesx3 with SMTP id x3so18909626wes.4\r
+ for <notmuch@notmuchmail.org>; Sat, 07 Mar 2015 09:12:45 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:subject:in-reply-to:references\r
+ :user-agent:date:message-id:mime-version:content-type;\r
+ bh=gO5dUaFmQs1pXsQZeidoujnJ6+EhEA7uNgIkhm2hr/8=;\r
+ b=iph0QuAe6Z96z6DqyehCmWEfqPdLMPwNOEAE8zANDvGCM5/d8mIyi6luTV9ltnaGgP\r
+ EugnIo2Sl+uWe4Mf8bFSMKmYrq1SjkOwm4XsqRrjRYc06MH7SnqwymEYa8TjjQILw8ZC\r
+ 0RsUdkRpH6CwEuUrGVGtdVwjyeEhBmlgKzgfInb3Qrza01SQRrgevpLZwtfd6CMd1QyG\r
+ Xzlk7ndgP4OrV8nPSMiGvCcq/3yY0TACb+KJOBoUd7eY40pnKpkak3hMPrPtIZmQvhak\r
+ VPFzxEQvKo1S1n13rzkoYtegeLZnzfr/F4KPtzlDBMS1y7c3qEWHDMPbpFJW1D72DVTc\r
+ dZxg==\r
+X-Gm-Message-State:\r
+ ALoCoQk1LneNBp3ek1Ec2YiI55vncAzIsJA1fmrYnUtagMlZZDd53cI5BoaUZ7LsYDOQZlVuzmUi\r
+X-Received: by 10.194.60.104 with SMTP id g8mr40443510wjr.96.1425748365704;\r
+ Sat, 07 Mar 2015 09:12:45 -0800 (PST)\r
+Received: from localhost (mobile-internet-bcee3b-76.dhcp.inet.fi.\r
+ [188.238.59.76])\r
+ by mx.google.com with ESMTPSA id ga8sm7414890wib.11.2015.03.07.09.12.44\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Sat, 07 Mar 2015 09:12:44 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 1/2] CLI: set up infrastructure to make path to\r
+ gpg configurable.\r
+In-Reply-To: <1418155271-23704-1-git-send-email-david@tethera.net>\r
+References: <1418155271-23704-1-git-send-email-david@tethera.net>\r
+User-Agent: Notmuch/0.19+74~g6aeef2e (http://notmuchmail.org) Emacs/24.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sat, 07 Mar 2015 19:13:04 +0200\r
+Message-ID: <87fv9givdr.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 07 Mar 2015 17:12:50 -0000\r
+\r
+On Tue, 09 Dec 2014, David Bremner <david@tethera.net> wrote:\r
+> GMIME takes a path to gpg, but we hardcode that path. In this commit\r
+> we push hardcoding all the way up to the top level of a notmuch\r
+> command, where we can later make it configurable.\r
+\r
+Mmmh, to be pedantic, this does not push the hardcoding to the top\r
+level, since "gpg" still remains at the lowest level. But it allows\r
+specifying the path at the top level. Which I think is fine.\r
+\r
+LGTM.\r
+\r
+\r
+> ---\r
+> crypto.c | 10 +++++-----\r
+> notmuch-client.h | 1 +\r
+> notmuch-reply.c | 3 ++-\r
+> notmuch-show.c | 3 ++-\r
+> 4 files changed, 10 insertions(+), 7 deletions(-)\r
+>\r
+> diff --git a/crypto.c b/crypto.c\r
+> index 6f4a6db..026640f 100644\r
+> --- a/crypto.c\r
+> +++ b/crypto.c\r
+> @@ -24,12 +24,12 @@\r
+> \r
+> /* Create a GPG context (GMime 2.6) */\r
+> static notmuch_crypto_context_t *\r
+> -create_gpg_context (void)\r
+> +create_gpg_context (const char *gpgpath)\r
+> {\r
+> notmuch_crypto_context_t *gpgctx;\r
+> \r
+> /* TODO: GMimePasswordRequestFunc */\r
+> - gpgctx = g_mime_gpg_context_new (NULL, "gpg");\r
+> + gpgctx = g_mime_gpg_context_new (NULL, gpgpath ? gpgpath : "gpg");\r
+> if (! gpgctx)\r
+> return NULL;\r
+> \r
+> @@ -43,13 +43,13 @@ create_gpg_context (void)\r
+> \r
+> /* Create a GPG context (GMime 2.4) */\r
+> static notmuch_crypto_context_t *\r
+> -create_gpg_context (void)\r
+> +create_gpg_context (const char* gpgpath)\r
+> {\r
+> GMimeSession *session;\r
+> notmuch_crypto_context_t *gpgctx;\r
+> \r
+> session = g_object_new (g_mime_session_get_type (), NULL);\r
+> - gpgctx = g_mime_gpg_context_new (session, "gpg");\r
+> + gpgctx = g_mime_gpg_context_new (session, gpgpath ? gpgpath : "gpg");\r
+> g_object_unref (session);\r
+> \r
+> if (! gpgctx)\r
+> @@ -83,7 +83,7 @@ notmuch_crypto_get_context (notmuch_crypto_t *crypto, const char *protocol)\r
+> if (strcasecmp (protocol, "application/pgp-signature") == 0 ||\r
+> strcasecmp (protocol, "application/pgp-encrypted") == 0) {\r
+> if (! crypto->gpgctx) {\r
+> - crypto->gpgctx = create_gpg_context ();\r
+> + crypto->gpgctx = create_gpg_context (crypto->gpgpath);\r
+> if (! crypto->gpgctx)\r
+> fprintf (stderr, "Failed to construct gpg context.\n");\r
+> }\r
+> diff --git a/notmuch-client.h b/notmuch-client.h\r
+> index 5e0d475..c25c4ea 100644\r
+> --- a/notmuch-client.h\r
+> +++ b/notmuch-client.h\r
+> @@ -80,6 +80,7 @@ typedef struct notmuch_crypto {\r
+> notmuch_crypto_context_t* gpgctx;\r
+> notmuch_bool_t verify;\r
+> notmuch_bool_t decrypt;\r
+> + const char *gpgpath;\r
+> } notmuch_crypto_t;\r
+> \r
+> typedef struct notmuch_show_params {\r
+> diff --git a/notmuch-reply.c b/notmuch-reply.c\r
+> index 7c1c809..e18370f 100644\r
+> --- a/notmuch-reply.c\r
+> +++ b/notmuch-reply.c\r
+> @@ -769,7 +769,8 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[])\r
+> .part = -1,\r
+> .crypto = {\r
+> .verify = FALSE,\r
+> - .decrypt = FALSE\r
+> + .decrypt = FALSE,\r
+> + .gpgpath = NULL\r
+> }\r
+> };\r
+> int format = FORMAT_DEFAULT;\r
+> diff --git a/notmuch-show.c b/notmuch-show.c\r
+> index d416fbd..d292f29 100644\r
+> --- a/notmuch-show.c\r
+> +++ b/notmuch-show.c\r
+> @@ -1082,7 +1082,8 @@ notmuch_show_command (notmuch_config_t *config, int argc, char *argv[])\r
+> .output_body = TRUE,\r
+> .crypto = {\r
+> .verify = FALSE,\r
+> - .decrypt = FALSE\r
+> + .decrypt = FALSE,\r
+> + .gpgpath = NULL\r
+> },\r
+> .include_html = FALSE\r
+> };\r
+> -- \r
+> 2.1.3\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r