summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2016-02-17 16:44:16 +0900
committerDaiki Ueno <ueno@gnu.org>2016-02-17 16:50:43 +0900
commit14aec913ac3f0dd408487c0e8327403e0f239964 (patch)
tree5bd6686c7fd37ab559166fd180a1ef1a3a95abcc /lisp/emacs-lisp
parente80c2a7b47d161f00aac096b9d58a18879a122e8 (diff)
downloademacs-14aec913ac3f0dd408487c0e8327403e0f239964.tar.gz
emacs-14aec913ac3f0dd408487c0e8327403e0f239964.tar.bz2
emacs-14aec913ac3f0dd408487c0e8327403e0f239964.zip
Take advantage of new GnuPG version check function
* lisp/emacs-lisp/package.el (epg-configuration-find): Declare. (package-refresh-contents): Use `epg-configuration-find' to check if EPG is usable.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/package.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 34772a0aa90..6156f651b62 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1452,9 +1452,8 @@ loading packages twice."
(defvar package--downloads-in-progress nil
"List of in-progress asynchronous downloads.")
-(declare-function epg-check-configuration "epg-config"
- (config &optional minimum-version))
-(declare-function epg-configuration "epg-config" ())
+(declare-function epg-configuration-find "epg-config"
+ (protocol &optional force))
(declare-function epg-import-keys-from-file "epg" (context keys))
;;;###autoload
@@ -1554,11 +1553,15 @@ downloads in the background."
(let ((default-keyring (expand-file-name "package-keyring.gpg"
data-directory))
(inhibit-message async))
+ (if (get 'package-check-signature 'saved-value)
+ (when package-check-signature
+ (epg-configuration-find 'OpenPGP))
+ (setq package-check-signature
+ (if (epg-configuration-find 'OpenPGP)
+ 'allow-unsigned)))
(when (and package-check-signature (file-exists-p default-keyring))
(condition-case-unless-debug error
- (progn
- (epg-check-configuration (epg-configuration))
- (package-import-keyring default-keyring))
+ (package-import-keyring default-keyring)
(error (message "Cannot import default keyring: %S" (cdr error))))))
(package--download-and-read-archives async))