=== modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2014-09-03 04:21:40 +0000 +++ lisp/emacs-lisp/package.el 2014-09-30 00:04:22 +0000 @@ -842,8 +842,9 @@ (epg-context-result-for context 'verify))) good-signatures)))) -(defun package-install-from-archive (pkg-desc) - "Download and install a tar package." +(defun package-install-from-archive (pkg-desc &optional just-verify) + "Download and install a tar package. +When JUST-VERIFY is set, only verify the signature." (let* ((location (package-archive-base pkg-desc)) (file (concat (package-desc-full-name pkg-desc) (package-desc-suffix pkg-desc))) @@ -858,7 +859,9 @@ (unless (eq package-check-signature 'allow-unsigned) (error "Unsigned package: `%s'" (package-desc-name pkg-desc))))) - (package-unpack pkg-desc)) + ;; do the actual install + (unless just-verify + (package-unpack pkg-desc))) ;; Here the package has been installed successfully, mark it as ;; signed if appropriate. (when good-signatures @@ -1432,6 +1435,11 @@ (package-make-button "Install" 'action 'package-install-button-action + 'package-desc desc) + (insert " ") + (package-make-button + "Verify signature" + 'action 'package-verify-button-action 'package-desc desc)) (t (insert (capitalize status) "."))) (insert "\n") @@ -1546,6 +1554,13 @@ (revert-buffer nil t) (goto-char (point-min))))) +(defun package-verify-button-action (button) + (let ((pkg-desc (button-get button 'package-desc))) + (with-demoted-errors + (package-install-from-archive pkg-desc t) ; just verify + ;; note errors will preempt the following + (message "Package was verified")))) + (defun package-keyword-button-action (button) (let ((pkg-keyword (button-get button 'package-keyword))) (package-show-package-list t (list pkg-keyword))))