]> git.eshelyaron.com Git - emacs.git/commitdiff
Take advantage of new GnuPG version check function
authorDaiki Ueno <ueno@gnu.org>
Wed, 17 Feb 2016 07:44:16 +0000 (16:44 +0900)
committerDaiki Ueno <ueno@gnu.org>
Wed, 17 Feb 2016 07:50:43 +0000 (16:50 +0900)
* lisp/emacs-lisp/package.el (epg-configuration-find): Declare.
(package-refresh-contents): Use `epg-configuration-find' to check if EPG
is usable.

lisp/emacs-lisp/package.el

index 34772a0aa90a3bdcee280308b2b6c6b97275508d..6156f651b62b657f9a8f6d3d47030336f1ef503d 100644 (file)
@@ -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))