Re: [PATCH v3 04/16] Provide _notmuch_crypto_{set,get}_gpg_path
authorDavid Bremner <david@tethera.net>
Wed, 10 Feb 2016 11:45:47 +0000 (07:45 +2000)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:21:04 +0000 (16:21 -0700)
0d/a2a8ab9d8263ead369a36f559e58473ae4201d [new file with mode: 0644]

diff --git a/0d/a2a8ab9d8263ead369a36f559e58473ae4201d b/0d/a2a8ab9d8263ead369a36f559e58473ae4201d
new file mode 100644 (file)
index 0000000..4aff39f
--- /dev/null
@@ -0,0 +1,73 @@
+Return-Path: <david@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 7B3026DE0231\r
+ for <notmuch@notmuchmail.org>; Wed, 10 Feb 2016 03:45:55 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.308\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.308 tagged_above=-999 required=5 tests=[AWL=0.243,\r
+  RP_MATCHES_RCVD=-0.55, SPF_PASS=-0.001] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id jRYsvYSmZi84 for <notmuch@notmuchmail.org>;\r
+ Wed, 10 Feb 2016 03:45:53 -0800 (PST)\r
+Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 1CDA36DE021E\r
+ for <notmuch@notmuchmail.org>; Wed, 10 Feb 2016 03:45:52 -0800 (PST)\r
+Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
+ (envelope-from <david@tethera.net>)\r
+ id 1aTTCm-00081w-8l; Wed, 10 Feb 2016 06:45:08 -0500\r
+Received: (nullmailer pid 24742 invoked by uid 1000);\r
+ Wed, 10 Feb 2016 11:45:47 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,\r
+ Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH v3 04/16] Provide _notmuch_crypto_{set,get}_gpg_path\r
+In-Reply-To: <1454272801-23623-5-git-send-email-dkg@fifthhorseman.net>\r
+References: <1454272801-23623-1-git-send-email-dkg@fifthhorseman.net>\r
+ <1454272801-23623-5-git-send-email-dkg@fifthhorseman.net>\r
+User-Agent: Notmuch/0.21+5~gca076ce (http://notmuchmail.org) Emacs/24.5.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Wed, 10 Feb 2016 07:45:47 -0400\r
+Message-ID: <87r3gkvlec.fsf@maritornes.cs.unb.ca>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 10 Feb 2016 11:45:55 -0000\r
+\r
+Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:\r
+\r
+> +#define try_gpg_path(z) if (test_for_executable(z)) return z\r
+> +    try_gpg_path("gpg2");\r
+> +    try_gpg_path("gpg");\r
+> +#undef try_gpg_path\r
+> +    return NULL;\r
+> +}\r
+\r
+I think I'd prefer just inlining these two ifs.\r
+\r
+> +notmuch_status_t\r
+> +_notmuch_crypto_set_gpg_path (_notmuch_crypto_t *crypto, const char* gpg_path)\r
+> +{\r
+> +    /* return success if this matches what is already configured */\r
+> +    if ((!gpg_path && !crypto->gpg_path) ||\r
+> +    (gpg_path && crypto->gpg_path && 0 == strcmp(gpg_path, crypto->gpg_path)))\r
+> +    return NOTMUCH_STATUS_SUCCESS;\r
+\r
+these changes probably need a pass of uncrustify or equivalent.\r
+\r
+\r