diff options
| author | Philip Kaludercic | 2022-11-02 11:56:42 +0100 |
|---|---|---|
| committer | Philip Kaludercic | 2022-11-02 11:56:42 +0100 |
| commit | b5dfd1dfe1147aa3bcceb8a2bc40f358aa1f29a4 (patch) | |
| tree | b796e2efc98c88f1aa9f48e31adb6e618e386934 | |
| parent | b21f80bbb971d5e5193c04823536265ecd2ca8e8 (diff) | |
| download | emacs-b5dfd1dfe1147aa3bcceb8a2bc40f358aa1f29a4.tar.gz emacs-b5dfd1dfe1147aa3bcceb8a2bc40f358aa1f29a4.zip | |
Track file name in 'package--downloads-in-progress'
* lisp/emacs-lisp/package.el (package--download-one-archive): Move
'cl-pushnew' call from 'package--download-one-archive' and cons file
name onto the archive.
(package--download-one-archive): Cons the file name onto the archive.
(package--download-and-read-archives): Remove 'cl-pushnew' call.
| -rw-r--r-- | lisp/emacs-lisp/package.el | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ae3a1b7b830..4593ae7d1b7 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -1783,9 +1783,14 @@ Once it's empty, run `package--post-download-archives-hook'." | |||
| 1783 | ARCHIVE should be a cons cell of the form (NAME . LOCATION), | 1783 | ARCHIVE should be a cons cell of the form (NAME . LOCATION), |
| 1784 | similar to an entry in `package-alist'. Save the cached copy to | 1784 | similar to an entry in `package-alist'. Save the cached copy to |
| 1785 | \"archives/NAME/FILE\" in `package-user-dir'." | 1785 | \"archives/NAME/FILE\" in `package-user-dir'." |
| 1786 | ;; The downloaded archive contents will be read as part of | ||
| 1787 | ;; `package--update-downloads-in-progress'. | ||
| 1788 | (dolist (archive package-archives) | ||
| 1789 | (cl-pushnew (cons archive file) package--downloads-in-progress | ||
| 1790 | :test #'equal)) | ||
| 1786 | (package--with-response-buffer (cdr archive) :file file | 1791 | (package--with-response-buffer (cdr archive) :file file |
| 1787 | :async async | 1792 | :async async |
| 1788 | :error-form (package--update-downloads-in-progress archive) | 1793 | :error-form (package--update-downloads-in-progress (cons archive file)) |
| 1789 | (let* ((location (cdr archive)) | 1794 | (let* ((location (cdr archive)) |
| 1790 | (name (car archive)) | 1795 | (name (car archive)) |
| 1791 | (content (buffer-string)) | 1796 | (content (buffer-string)) |
| @@ -1798,10 +1803,10 @@ similar to an entry in `package-alist'. Save the cached copy to | |||
| 1798 | ;; If we don't care about the signature, save the file and | 1803 | ;; If we don't care about the signature, save the file and |
| 1799 | ;; we're done. | 1804 | ;; we're done. |
| 1800 | (progn | 1805 | (progn |
| 1801 | (cl-assert (not enable-multibyte-characters)) | 1806 | (cl-assert (not enable-multibyte-characters)) |
| 1802 | (let ((coding-system-for-write 'binary)) | 1807 | (let ((coding-system-for-write 'binary)) |
| 1803 | (write-region content nil local-file nil 'silent)) | 1808 | (write-region content nil local-file nil 'silent)) |
| 1804 | (package--update-downloads-in-progress archive)) | 1809 | (package--update-downloads-in-progress (cons archive file))) |
| 1805 | ;; If we care, check it (perhaps async) and *then* write the file. | 1810 | ;; If we care, check it (perhaps async) and *then* write the file. |
| 1806 | (package--check-signature | 1811 | (package--check-signature |
| 1807 | location file content async | 1812 | location file content async |
| @@ -1822,11 +1827,6 @@ Populate `package-archive-contents' with the result. | |||
| 1822 | 1827 | ||
| 1823 | If optional argument ASYNC is non-nil, perform the downloads | 1828 | If optional argument ASYNC is non-nil, perform the downloads |
| 1824 | asynchronously." | 1829 | asynchronously." |
| 1825 | ;; The downloaded archive contents will be read as part of | ||
| 1826 | ;; `package--update-downloads-in-progress'. | ||
| 1827 | (dolist (archive package-archives) | ||
| 1828 | (cl-pushnew archive package--downloads-in-progress | ||
| 1829 | :test #'equal)) | ||
| 1830 | (dolist (archive package-archives) | 1830 | (dolist (archive package-archives) |
| 1831 | (condition-case-unless-debug nil | 1831 | (condition-case-unless-debug nil |
| 1832 | (package--download-one-archive archive "archive-contents" async) | 1832 | (package--download-one-archive archive "archive-contents" async) |