diff options
| author | Artur Malabarba | 2015-04-04 21:00:38 +0100 |
|---|---|---|
| committer | Artur Malabarba | 2015-04-05 10:59:18 +0100 |
| commit | b47fe819f70cd48c5ca26e37843b878ecc0d0b66 (patch) | |
| tree | b126ef814e97bfa21388e06a64faf5c8f43db55a | |
| parent | 16eec6fc55dcc05d1d819f18998e84a9580b2521 (diff) | |
| download | emacs-b47fe819f70cd48c5ca26e37843b878ecc0d0b66.tar.gz emacs-b47fe819f70cd48c5ca26e37843b878ecc0d0b66.zip | |
emacs-lisp/package.el: Prevent outdated downloads-in-progress.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package.el | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7fa39b46727..0870f0cad31 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -14,6 +14,9 @@ | |||
| 14 | `package-archives' to `package--downloads-in-progress' instead of | 14 | `package-archives' to `package--downloads-in-progress' instead of |
| 15 | overwriting it. | 15 | overwriting it. |
| 16 | (package--with-work-buffer-async): Protect macro arguments. | 16 | (package--with-work-buffer-async): Protect macro arguments. |
| 17 | (package--download-one-archive) | ||
| 18 | (package--download-and-read-archives): Prevent | ||
| 19 | downloads-in-progress list from becoming outdated. | ||
| 17 | 20 | ||
| 18 | 2015-04-04 Michael Albinus <michael.albinus@gmx.de> | 21 | 2015-04-04 Michael Albinus <michael.albinus@gmx.de> |
| 19 | 22 | ||
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 32a3e015f0b..83c5b2f6b10 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -1397,8 +1397,12 @@ similar to an entry in `package-alist'. Save the cached copy to | |||
| 1397 | ;; If we care, check it (perhaps async) and *then* write the file. | 1397 | ;; If we care, check it (perhaps async) and *then* write the file. |
| 1398 | (package--check-signature | 1398 | (package--check-signature |
| 1399 | location file content async | 1399 | location file content async |
| 1400 | ;; This function will be called after signature checking. | ||
| 1400 | (lambda (&optional good-sigs) | 1401 | (lambda (&optional good-sigs) |
| 1401 | (unless (or good-sigs (eq package-check-signature 'allow-unsigned)) | 1402 | (unless (or good-sigs (eq package-check-signature 'allow-unsigned)) |
| 1403 | ;; Even if the sig fails, this download is done, so | ||
| 1404 | ;; remove it from the in-progress list. | ||
| 1405 | (package--update-downloads-in-progress archive) | ||
| 1402 | (error "Unsigned archive `%s'" name)) | 1406 | (error "Unsigned archive `%s'" name)) |
| 1403 | ;; Write out the archives file. | 1407 | ;; Write out the archives file. |
| 1404 | (write-region content nil local-file nil 'silent) | 1408 | (write-region content nil local-file nil 'silent) |
| @@ -1419,7 +1423,11 @@ perform the downloads asynchronously." | |||
| 1419 | package--downloads-in-progress)) | 1423 | package--downloads-in-progress)) |
| 1420 | (dolist (archive package-archives) | 1424 | (dolist (archive package-archives) |
| 1421 | (condition-case-unless-debug nil | 1425 | (condition-case-unless-debug nil |
| 1422 | (package--download-one-archive archive "archive-contents" async) | 1426 | (package--download-one-archive |
| 1427 | archive "archive-contents" | ||
| 1428 | ;; Called if the async download fails | ||
| 1429 | (when async | ||
| 1430 | (lambda () (package--update-downloads-in-progress archive)))) | ||
| 1423 | (error (message "Failed to download `%s' archive." | 1431 | (error (message "Failed to download `%s' archive." |
| 1424 | (car archive)))))) | 1432 | (car archive)))))) |
| 1425 | 1433 | ||