aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaiki Ueno2014-01-08 15:25:21 +0900
committerDaiki Ueno2014-01-08 15:25:21 +0900
commit0a3eec327076b877fe683ded596bda76fbaded0c (patch)
treea28c31297c057ce1b187bf87058e8ef93c4abed0
parent68f0bb9791bb40a0a09cf7bca3ddee3d18e86486 (diff)
downloademacs-0a3eec327076b877fe683ded596bda76fbaded0c.tar.gz
emacs-0a3eec327076b877fe683ded596bda76fbaded0c.zip
emacs-lisp/package.el (package--check-signature): Fix download error handling
* emacs-lisp/package.el (url-recreate-url): Declare. (url-http-target-url): Declare. (package-handle-response): Include requested URL in the error message. (package--check-signature): Don't re-signal errors from package--with-work-buffer. Suggested by Stefan Monnier.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/emacs-lisp/package.el11
2 files changed, 15 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1f8187d9e27..9ff78a4ca5f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12014-01-08 Daiki Ueno <ueno@gnu.org>
2
3 * emacs-lisp/package.el (url-recreate-url): Declare.
4 (url-http-target-url): Declare.
5 (package-handle-response): Include requested URL in the error
6 message.
7 (package--check-signature): Don't re-signal errors from
8 package--with-work-buffer. Suggested by Stefan Monnier.
9
12014-01-07 Bastien Guerry <bzg@gnu.org> 102014-01-07 Bastien Guerry <bzg@gnu.org>
2 11
3 * minibuffer.el (completion--try-word-completion): When both a 12 * minibuffer.el (completion--try-word-completion): When both a
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 15dba461d2d..64a9eff916a 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -210,6 +210,8 @@ If VERSION is nil, the package is not loaded (it is \"disabled\")."
210(declare-function lm-header "lisp-mnt" (header)) 210(declare-function lm-header "lisp-mnt" (header))
211(declare-function lm-commentary "lisp-mnt" (&optional file)) 211(declare-function lm-commentary "lisp-mnt" (&optional file))
212(defvar url-http-end-of-headers) 212(defvar url-http-end-of-headers)
213(declare-function url-recreate-url "url" (urlobj))
214(defvar url-http-target-url)
213 215
214(defcustom package-archives '(("gnu" . "http://elpa.gnu.org/packages/")) 216(defcustom package-archives '(("gnu" . "http://elpa.gnu.org/packages/"))
215 "An alist of archives from which to fetch. 217 "An alist of archives from which to fetch.
@@ -789,7 +791,8 @@ It will move point to somewhere in the headers."
789 (require 'url-http) 791 (require 'url-http)
790 (let ((response (url-http-parse-response))) 792 (let ((response (url-http-parse-response)))
791 (when (or (< response 200) (>= response 300)) 793 (when (or (< response 200) (>= response 300))
792 (error "Error during download request:%s" 794 (error "Error downloading %s:%s"
795 (url-recreate-url url-http-target-url)
793 (buffer-substring-no-properties (point) (line-end-position)))))) 796 (buffer-substring-no-properties (point) (line-end-position))))))
794 797
795(defun package--archive-file-exists-p (location file) 798(defun package--archive-file-exists-p (location file)
@@ -820,10 +823,8 @@ GnuPG keyring is located under \"gnupg\" in `package-user-dir'."
820 (sig-file (concat file ".sig")) 823 (sig-file (concat file ".sig"))
821 sig-content 824 sig-content
822 good-signatures) 825 good-signatures)
823 (condition-case-unless-debug error 826 (setq sig-content (package--with-work-buffer location sig-file
824 (setq sig-content (package--with-work-buffer location sig-file 827 (buffer-string)))
825 (buffer-string)))
826 (error "Failed to download %s: %S" sig-file (cdr error)))
827 (epg-context-set-home-directory context homedir) 828 (epg-context-set-home-directory context homedir)
828 (epg-verify-string context sig-content (buffer-string)) 829 (epg-verify-string context sig-content (buffer-string))
829 ;; The .sig file may contain multiple signatures. Success if one 830 ;; The .sig file may contain multiple signatures. Success if one