diff options
author | Daiki Ueno <ueno@gnu.org> | 2016-02-17 16:32:25 +0900 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2016-02-17 16:47:24 +0900 |
commit | e80c2a7b47d161f00aac096b9d58a18879a122e8 (patch) | |
tree | 982974a0196587628a0891ffb19d66339c650fad /lisp/epg.el | |
parent | 15a946479c96fdce693c13acfe41a66266ffcadb (diff) | |
download | emacs-e80c2a7b47d161f00aac096b9d58a18879a122e8.tar.gz emacs-e80c2a7b47d161f00aac096b9d58a18879a122e8.tar.bz2 emacs-e80c2a7b47d161f00aac096b9d58a18879a122e8.zip |
Make GnuPG version check robuster
We changed the default gpg program to "gpg2" from "gpg" in the commit
f93d669a16bd3cb3f43f0c8cfd22fe18b627a6a1. However, there are two
maintained branches (2.0 and 2.1) and Emacs doesn't work well with 2.0
series. Check the actual version of "gpg2" at run time, and properly
divert to "gpg" if necessary.
* lisp/epg-config.el: Require 'cl-lib for `cl-destructuring-bind'.
(epg-config--program-alist): New variable.
(epg--configurations): New variable.
(epg-configuration-find): New function.
(epg-config--make-gpg-configuration): New function.
(epg-config--make-gpgsm-configuration): New function.
(epg-configuration): Mark as obsolete.
* lisp/epg.el (epg-context): Use `epg-configuration-find'.
Diffstat (limited to 'lisp/epg.el')
-rw-r--r-- | lisp/epg.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/epg.el b/lisp/epg.el index 1f9db23478c..1a18ab2a52a 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -186,11 +186,11 @@ compress-algorithm &aux (program - (pcase protocol - (`OpenPGP epg-gpg-program) - (`CMS epg-gpgsm-program) - (_ (signal 'epg-error - (list "unknown protocol" protocol))))))) + (let ((configuration (epg-configuration-find protocol))) + (unless configuration + (signal 'epg-error + (list "no usable configuration" protocol))) + (alist-get 'program configuration))))) (:copier nil) (:predicate nil)) protocol |