--- /dev/null
+Return-Path: <bremner@tesseract.cs.unb.ca>\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 44C9E431FD9\r
+ for <notmuch@notmuchmail.org>; Tue, 9 Dec 2014 12:01:30 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\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 yQ9GX9FOOMN0 for <notmuch@notmuchmail.org>;\r
+ Tue, 9 Dec 2014 12:01:28 -0800 (PST)\r
+Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
+ (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id EA9B6431FD4\r
+ for <notmuch@notmuchmail.org>; Tue, 9 Dec 2014 12:01:27 -0800 (PST)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+ (envelope-from <bremner@tesseract.cs.unb.ca>)\r
+ id 1XyQyN-0003HM-I1; Tue, 09 Dec 2014 16:01:27 -0400\r
+Received: (nullmailer pid 23749 invoked by uid 1000); Tue, 09 Dec 2014\r
+ 20:01:16 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/2] CLI: make gpg binary used by libgmime configurable.\r
+Date: Tue, 9 Dec 2014 21:01:11 +0100\r
+Message-Id: <1418155271-23704-2-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.1.3\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
+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: Tue, 09 Dec 2014 20:01:30 -0000\r
+\r
+Previously we set up a way for the top level notmuch command to choose\r
+which gpg binary was invoked by libgmime. In this commit we add the\r
+(mostly boilplate) code to allow the notmuch-config command to read\r
+and write this path, and use it in the appropriate struct.\r
+---\r
+ notmuch-client.h | 7 +++++++\r
+ notmuch-config.c | 15 +++++++++++++++\r
+ notmuch-reply.c | 2 ++\r
+ notmuch-show.c | 2 ++\r
+ 4 files changed, 26 insertions(+)\r
+\r
+diff --git a/notmuch-client.h b/notmuch-client.h\r
+index c25c4ea..fad81d5 100644\r
+--- a/notmuch-client.h\r
++++ b/notmuch-client.h\r
+@@ -279,6 +279,13 @@ notmuch_config_set_database_path (notmuch_config_t *config,\r
+ const char *database_path);\r
+ \r
+ const char *\r
++notmuch_config_get_gpg_path (notmuch_config_t *config);\r
++\r
++void\r
++notmuch_config_set_gpg_path (notmuch_config_t *config,\r
++ const char *gpg_path);\r
++\r
++const char *\r
+ notmuch_config_get_user_name (notmuch_config_t *config);\r
+ \r
+ void\r
+diff --git a/notmuch-config.c b/notmuch-config.c\r
+index a564bca..7aef1b6 100644\r
+--- a/notmuch-config.c\r
++++ b/notmuch-config.c\r
+@@ -107,6 +107,7 @@ struct _notmuch_config {\r
+ notmuch_bool_t is_new;\r
+ \r
+ char *database_path;\r
++ char *gpg_path;\r
+ char *user_name;\r
+ char *user_primary_email;\r
+ const char **user_other_email;\r
+@@ -690,6 +691,20 @@ notmuch_config_set_search_exclude_tags (notmuch_config_t *config,\r
+ &(config->search_exclude_tags));\r
+ }\r
+ \r
++const char *\r
++notmuch_config_get_gpg_path (notmuch_config_t *config)\r
++{\r
++ return _config_get (config, &config->gpg_path, "gpg", "path");\r
++}\r
++\r
++void\r
++notmuch_config_set_gpg_path (notmuch_config_t *config,\r
++ const char *gpg_path)\r
++{\r
++ _config_set (config, &config->gpg_path, "gpg", "path", gpg_path);\r
++}\r
++\r
++\r
+ /* Given a configuration item of the form <group>.<key> return the\r
+ * component group and key. If any error occurs, print a message on\r
+ * stderr and return 1. Otherwise, return 0.\r
+diff --git a/notmuch-reply.c b/notmuch-reply.c\r
+index e18370f..d6d3315 100644\r
+--- a/notmuch-reply.c\r
++++ b/notmuch-reply.c\r
+@@ -822,6 +822,8 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[])\r
+ return EXIT_FAILURE;\r
+ }\r
+ \r
++ params.crypto.gpgpath = notmuch_config_get_gpg_path (config);\r
++\r
+ if (notmuch_database_open (notmuch_config_get_database_path (config),\r
+ NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much))\r
+ return EXIT_FAILURE;\r
+diff --git a/notmuch-show.c b/notmuch-show.c\r
+index d292f29..b0d4609 100644\r
+--- a/notmuch-show.c\r
++++ b/notmuch-show.c\r
+@@ -1204,6 +1204,8 @@ notmuch_show_command (notmuch_config_t *config, int argc, char *argv[])\r
+ return EXIT_FAILURE;\r
+ }\r
+ \r
++ params.crypto.gpgpath = notmuch_config_get_gpg_path (config);\r
++\r
+ if (notmuch_database_open (notmuch_config_get_database_path (config),\r
+ NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much))\r
+ return EXIT_FAILURE;\r
+-- \r
+2.1.3\r
+\r