[PATCH 6/9] search for a reasonable gpg implementation

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Dec 11 14:22:08 PST 2015


On Fri 2015-12-11 17:18:52 -0500, J. Lewis Muir wrote:
> On 12/11/15 3:56 PM, Tomi Ollila wrote:
>>> +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
>
> I'm not following closely, but seeing paths to programs hard coded in
> the source never seems like a good idea; invariably someone will have
> the program in an unanticipated location.  I'm using pkgsrc on OS X,
> and my gpg is at /opt/pkg/bin/gpg.  How about a Notmuch configuration
> file item specifying the location of the program?  Or if not that, how
> about a configuration option at build time to specify the location of
> gpg that then gets hard coded in the source?  Or if not that, how about
> an environment variable that will specify the location of the program
> (e.g. like OpenSSH's SSH_ASKPASS environment variable)?

Yes, the path search is genericized later in the series (7/9).  clearly
i should have done even more commit squashing to avoid confusing people
with this distraction.  point clearly taken, though; i will avoid
hard-coding any paths.  thanks!

            --dkg


More information about the notmuch mailing list