Re: [PATCH v3 04/16] Provide _notmuch_crypto_{set,get}_gpg_path
[notmuch-archives.git] / cd / 526693f5c2d0caeb819a336f306ead5dac8287
1 Return-Path: <dkg@fifthhorseman.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5  by arlo.cworth.org (Postfix) with ESMTP id E365E6DE0FF8\r
6  for <notmuch@notmuchmail.org>; Wed, 10 Feb 2016 08:32:10 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.018\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.018 tagged_above=-999 required=5\r
12  tests=[AWL=-0.018] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id F9Zx95u-FQqD for <notmuch@notmuchmail.org>;\r
16  Wed, 10 Feb 2016 08:32:09 -0800 (PST)\r
17 Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108])\r
18  by arlo.cworth.org (Postfix) with ESMTP id 392006DE0BF6\r
19  for <notmuch@notmuchmail.org>; Wed, 10 Feb 2016 08:32:09 -0800 (PST)\r
20 Received: from fifthhorseman.net (unknown [38.109.115.130])\r
21  by che.mayfirst.org (Postfix) with ESMTPSA id 04F90F997;\r
22  Wed, 10 Feb 2016 11:31:56 -0500 (EST)\r
23 Received: by fifthhorseman.net (Postfix, from userid 1000)\r
24  id 037FF1FF3A; Wed, 10 Feb 2016 11:31:57 -0500 (EST)\r
25 From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
26 To: David Bremner <david@tethera.net>, Notmuch Mail <notmuch@notmuchmail.org>\r
27 Subject: Re: [PATCH v3 04/16] Provide _notmuch_crypto_{set,get}_gpg_path\r
28 In-Reply-To: <87r3gkvlec.fsf@maritornes.cs.unb.ca>\r
29 References: <1454272801-23623-1-git-send-email-dkg@fifthhorseman.net>\r
30  <1454272801-23623-5-git-send-email-dkg@fifthhorseman.net>\r
31  <87r3gkvlec.fsf@maritornes.cs.unb.ca>\r
32 User-Agent: Notmuch/0.21+72~gd8c4f1c (http://notmuchmail.org) Emacs/24.5.1\r
33  (x86_64-pc-linux-gnu)\r
34 Date: Wed, 10 Feb 2016 11:31:56 -0500\r
35 Message-ID: <87a8n8o7b7.fsf@alice.fifthhorseman.net>\r
36 MIME-Version: 1.0\r
37 Content-Type: text/plain\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.20\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42  <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
44  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
49  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Wed, 10 Feb 2016 16:32:11 -0000\r
51 \r
52 On Wed 2016-02-10 06:45:47 -0500, David Bremner wrote:\r
53 > Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:\r
54 >\r
55 >> +#define try_gpg_path(z) if (test_for_executable(z)) return z\r
56 >> +    try_gpg_path("gpg2");\r
57 >> +    try_gpg_path("gpg");\r
58 >> +#undef try_gpg_path\r
59 >> +    return NULL;\r
60 >> +}\r
61 >\r
62 > I think I'd prefer just inlining these two ifs.\r
63 >\r
64 >> +notmuch_status_t\r
65 >> +_notmuch_crypto_set_gpg_path (_notmuch_crypto_t *crypto, const char* gpg_path)\r
66 >> +{\r
67 >> +    /* return success if this matches what is already configured */\r
68 >> +    if ((!gpg_path && !crypto->gpg_path) ||\r
69 >> +    (gpg_path && crypto->gpg_path && 0 == strcmp(gpg_path, crypto->gpg_path)))\r
70 >> +    return NOTMUCH_STATUS_SUCCESS;\r
71 >\r
72 > these changes probably need a pass of uncrustify or equivalent.\r
73 \r
74 I've made these changes in my working copy; i'll publish them as part of\r
75 v4 soon.\r
76 \r
77    --dkg\r