diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-09-27 12:25:53 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-09-27 12:25:53 -0400 |
commit | a5426ef3c2c1479cc045e271cbd60a73de548ace (patch) | |
tree | 69468d02b4b437f105e8646638f077813c88289f /lisp/emacs-lisp/package.el | |
parent | af71540b126e2449d365b0d2c88f4026f4b6b3f6 (diff) | |
download | emacs-a5426ef3c2c1479cc045e271cbd60a73de548ace.tar.gz emacs-a5426ef3c2c1479cc045e271cbd60a73de548ace.tar.bz2 emacs-a5426ef3c2c1479cc045e271cbd60a73de548ace.zip |
* lisp/emacs-lisp/package.el (package-check-signature): Default to nil if
GPG is not available.
(package-refresh-contents): Don't mess with the keyring if we won't
check the signatures anyway.
Diffstat (limited to 'lisp/emacs-lisp/package.el')
-rw-r--r-- | lisp/emacs-lisp/package.el | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 329ab8e6de7..958e9d29ebd 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -289,7 +289,9 @@ contrast, `package-user-dir' contains packages for personal use." :group 'package :version "24.1") -(defcustom package-check-signature 'allow-unsigned +(defcustom package-check-signature + (if (progn (require 'epg-config) (executable-find epg-gpg-program)) + 'allow-unsigned) "Non-nil means to check package signatures when installing. The value `allow-unsigned' means to still install a package even if it is unsigned. @@ -1313,12 +1315,12 @@ makes them available for download." (make-directory package-user-dir t)) (let ((default-keyring (expand-file-name "package-keyring.gpg" data-directory))) - (if (file-exists-p default-keyring) - (condition-case-unless-debug error - (progn - (epg-check-configuration (epg-configuration)) - (package-import-keyring default-keyring)) - (error (message "Cannot import default keyring: %S" (cdr error)))))) + (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)) + (error (message "Cannot import default keyring: %S" (cdr error)))))) (dolist (archive package-archives) (condition-case-unless-debug nil (package--download-one-archive archive "archive-contents") |