mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-09 07:40:39 -08:00
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.
This commit is contained in:
parent
68f0bb9791
commit
0a3eec3270
2 changed files with 15 additions and 5 deletions
|
|
@ -1,3 +1,12 @@
|
||||||
|
2014-01-08 Daiki Ueno <ueno@gnu.org>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2014-01-07 Bastien Guerry <bzg@gnu.org>
|
2014-01-07 Bastien Guerry <bzg@gnu.org>
|
||||||
|
|
||||||
* minibuffer.el (completion--try-word-completion): When both a
|
* minibuffer.el (completion--try-word-completion): When both a
|
||||||
|
|
|
||||||
|
|
@ -210,6 +210,8 @@ If VERSION is nil, the package is not loaded (it is \"disabled\")."
|
||||||
(declare-function lm-header "lisp-mnt" (header))
|
(declare-function lm-header "lisp-mnt" (header))
|
||||||
(declare-function lm-commentary "lisp-mnt" (&optional file))
|
(declare-function lm-commentary "lisp-mnt" (&optional file))
|
||||||
(defvar url-http-end-of-headers)
|
(defvar url-http-end-of-headers)
|
||||||
|
(declare-function url-recreate-url "url" (urlobj))
|
||||||
|
(defvar url-http-target-url)
|
||||||
|
|
||||||
(defcustom package-archives '(("gnu" . "http://elpa.gnu.org/packages/"))
|
(defcustom package-archives '(("gnu" . "http://elpa.gnu.org/packages/"))
|
||||||
"An alist of archives from which to fetch.
|
"An alist of archives from which to fetch.
|
||||||
|
|
@ -789,7 +791,8 @@ It will move point to somewhere in the headers."
|
||||||
(require 'url-http)
|
(require 'url-http)
|
||||||
(let ((response (url-http-parse-response)))
|
(let ((response (url-http-parse-response)))
|
||||||
(when (or (< response 200) (>= response 300))
|
(when (or (< response 200) (>= response 300))
|
||||||
(error "Error during download request:%s"
|
(error "Error downloading %s:%s"
|
||||||
|
(url-recreate-url url-http-target-url)
|
||||||
(buffer-substring-no-properties (point) (line-end-position))))))
|
(buffer-substring-no-properties (point) (line-end-position))))))
|
||||||
|
|
||||||
(defun package--archive-file-exists-p (location file)
|
(defun package--archive-file-exists-p (location file)
|
||||||
|
|
@ -820,10 +823,8 @@ GnuPG keyring is located under \"gnupg\" in `package-user-dir'."
|
||||||
(sig-file (concat file ".sig"))
|
(sig-file (concat file ".sig"))
|
||||||
sig-content
|
sig-content
|
||||||
good-signatures)
|
good-signatures)
|
||||||
(condition-case-unless-debug error
|
|
||||||
(setq sig-content (package--with-work-buffer location sig-file
|
(setq sig-content (package--with-work-buffer location sig-file
|
||||||
(buffer-string)))
|
(buffer-string)))
|
||||||
(error "Failed to download %s: %S" sig-file (cdr error)))
|
|
||||||
(epg-context-set-home-directory context homedir)
|
(epg-context-set-home-directory context homedir)
|
||||||
(epg-verify-string context sig-content (buffer-string))
|
(epg-verify-string context sig-content (buffer-string))
|
||||||
;; The .sig file may contain multiple signatures. Success if one
|
;; The .sig file may contain multiple signatures. Success if one
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue