summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2022-11-02 11:56:42 +0100
committerPhilip Kaludercic <philipk@posteo.net>2022-11-02 11:56:42 +0100
commitb5dfd1dfe1147aa3bcceb8a2bc40f358aa1f29a4 (patch)
treeb796e2efc98c88f1aa9f48e31adb6e618e386934
parentb21f80bbb971d5e5193c04823536265ecd2ca8e8 (diff)
downloademacs-b5dfd1dfe1147aa3bcceb8a2bc40f358aa1f29a4.tar.gz
emacs-b5dfd1dfe1147aa3bcceb8a2bc40f358aa1f29a4.tar.bz2
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.el20
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'."
ARCHIVE should be a cons cell of the form (NAME . LOCATION),
similar to an entry in `package-alist'. Save the cached copy to
\"archives/NAME/FILE\" in `package-user-dir'."
+ ;; The downloaded archive contents will be read as part of
+ ;; `package--update-downloads-in-progress'.
+ (dolist (archive package-archives)
+ (cl-pushnew (cons archive file) package--downloads-in-progress
+ :test #'equal))
(package--with-response-buffer (cdr archive) :file file
:async async
- :error-form (package--update-downloads-in-progress archive)
+ :error-form (package--update-downloads-in-progress (cons archive file))
(let* ((location (cdr archive))
(name (car archive))
(content (buffer-string))
@@ -1798,10 +1803,10 @@ similar to an entry in `package-alist'. Save the cached copy to
;; If we don't care about the signature, save the file and
;; we're done.
(progn
- (cl-assert (not enable-multibyte-characters))
- (let ((coding-system-for-write 'binary))
- (write-region content nil local-file nil 'silent))
- (package--update-downloads-in-progress archive))
+ (cl-assert (not enable-multibyte-characters))
+ (let ((coding-system-for-write 'binary))
+ (write-region content nil local-file nil 'silent))
+ (package--update-downloads-in-progress (cons archive file)))
;; If we care, check it (perhaps async) and *then* write the file.
(package--check-signature
location file content async
@@ -1822,11 +1827,6 @@ Populate `package-archive-contents' with the result.
If optional argument ASYNC is non-nil, perform the downloads
asynchronously."
- ;; The downloaded archive contents will be read as part of
- ;; `package--update-downloads-in-progress'.
- (dolist (archive package-archives)
- (cl-pushnew archive package--downloads-in-progress
- :test #'equal))
(dolist (archive package-archives)
(condition-case-unless-debug nil
(package--download-one-archive archive "archive-contents" async)