emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master b47fe81 1/2: emacs-lisp/package.el: Prevent outdate


From: Artur Malabarba
Subject: [Emacs-diffs] master b47fe81 1/2: emacs-lisp/package.el: Prevent outdated downloads-in-progress.
Date: Sun, 05 Apr 2015 10:08:30 +0000

branch: master
commit b47fe819f70cd48c5ca26e37843b878ecc0d0b66
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>

    emacs-lisp/package.el: Prevent outdated downloads-in-progress.
---
 lisp/ChangeLog             |    3 +++
 lisp/emacs-lisp/package.el |   10 +++++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7fa39b4..0870f0c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -14,6 +14,9 @@
        `package-archives' to `package--downloads-in-progress' instead of
        overwriting it.
        (package--with-work-buffer-async): Protect macro arguments.
+       (package--download-one-archive)
+       (package--download-and-read-archives): Prevent
+       downloads-in-progress list from becoming outdated.
 
 2015-04-04  Michael Albinus  <address@hidden>
 
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 32a3e01..83c5b2f 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
           ;; If we care, check it (perhaps async) and *then* write the file.
           (package--check-signature
            location file content async
+           ;; This function will be called after signature checking.
            (lambda (&optional good-sigs)
              (unless (or good-sigs (eq package-check-signature 
'allow-unsigned))
+               ;; Even if the sig fails, this download is done, so
+               ;; remove it from the in-progress list.
+               (package--update-downloads-in-progress archive)
                (error "Unsigned archive `%s'" name))
              ;; Write out the archives file.
              (write-region content nil local-file nil 'silent)
@@ -1419,7 +1423,11 @@ perform the downloads asynchronously."
                 package--downloads-in-progress))
   (dolist (archive package-archives)
     (condition-case-unless-debug nil
-        (package--download-one-archive archive "archive-contents" async)
+        (package--download-one-archive
+         archive "archive-contents"
+         ;; Called if the async download fails
+         (when async
+           (lambda () (package--update-downloads-in-progress archive))))
       (error (message "Failed to download `%s' archive."
                (car archive))))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]