Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id E0FFB6DE13EF for ; Fri, 11 Dec 2015 13:56:36 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.701 X-Spam-Level: X-Spam-Status: No, score=0.701 tagged_above=-999 required=5 tests=[AWL=0.049, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XTPuJ8wl0_OB for ; Fri, 11 Dec 2015 13:56:35 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 320666DE005F for ; Fri, 11 Dec 2015 13:56:35 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id CBB5D1000FB; Fri, 11 Dec 2015 23:56:45 +0200 (EET) From: Tomi Ollila To: Daniel Kahn Gillmor , Notmuch Mail Subject: Re: [PATCH 6/9] search for a reasonable gpg implementation In-Reply-To: <1449718786-28000-7-git-send-email-dkg@fifthhorseman.net> References: <1449718786-28000-1-git-send-email-dkg@fifthhorseman.net> <1449718786-28000-7-git-send-email-dkg@fifthhorseman.net> User-Agent: Notmuch/0.21+32~g73439f8 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 21:56:37 -0000 On Thu, Dec 10 2015, Daniel Kahn Gillmor wrote: > When the notmuch database needs to find gpg, have it search reasonable > paths first. > --- > lib/database.cc | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/lib/database.cc b/lib/database.cc > index 62bc6d9..d0e8800 100644 > --- a/lib/database.cc > +++ b/lib/database.cc > @@ -2393,6 +2393,17 @@ _notmuch_database_link_message (notmuch_database_t *notmuch, > return status; > } > > +static const char* > +_notmuch_database_get_gpg_path (notmuch_database_t *notmuch) > +{ > +#define try_gpg_path(z) if (!access(z, X_OK)) return z > + try_gpg_path("/usr/bin/gpg2"); > + try_gpg_path("/bin/gpg2"); > + try_gpg_path("/usr/bin/gpg"); > + try_gpg_path("/bin/gpg"); > + return NULL; > +} If this were to survive longer, BSD folks would like to have /usr/local/bin checked... (i don't know (yet) about os x