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.
This commit is contained in:
parent
e80c2a7b47
commit
14aec913ac
1 changed files with 9 additions and 6 deletions
|
@ -1452,9 +1452,8 @@ loading packages twice."
|
||||||
(defvar package--downloads-in-progress nil
|
(defvar package--downloads-in-progress nil
|
||||||
"List of in-progress asynchronous downloads.")
|
"List of in-progress asynchronous downloads.")
|
||||||
|
|
||||||
(declare-function epg-check-configuration "epg-config"
|
(declare-function epg-configuration-find "epg-config"
|
||||||
(config &optional minimum-version))
|
(protocol &optional force))
|
||||||
(declare-function epg-configuration "epg-config" ())
|
|
||||||
(declare-function epg-import-keys-from-file "epg" (context keys))
|
(declare-function epg-import-keys-from-file "epg" (context keys))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
@ -1554,11 +1553,15 @@ downloads in the background."
|
||||||
(let ((default-keyring (expand-file-name "package-keyring.gpg"
|
(let ((default-keyring (expand-file-name "package-keyring.gpg"
|
||||||
data-directory))
|
data-directory))
|
||||||
(inhibit-message async))
|
(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))
|
(when (and package-check-signature (file-exists-p default-keyring))
|
||||||
(condition-case-unless-debug error
|
(condition-case-unless-debug error
|
||||||
(progn
|
(package-import-keyring default-keyring)
|
||||||
(epg-check-configuration (epg-configuration))
|
|
||||||
(package-import-keyring default-keyring))
|
|
||||||
(error (message "Cannot import default keyring: %S" (cdr error))))))
|
(error (message "Cannot import default keyring: %S" (cdr error))))))
|
||||||
(package--download-and-read-archives async))
|
(package--download-and-read-archives async))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue