]> code.delx.au - gnu-emacs/commitdiff
emacs-lisp/package.el: Prevent outdated downloads-in-progress.
authorArtur Malabarba <bruce.connor.am@gmail.com>
Sat, 4 Apr 2015 20:00:38 +0000 (21:00 +0100)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Sun, 5 Apr 2015 09:59:18 +0000 (10:59 +0100)
lisp/ChangeLog
lisp/emacs-lisp/package.el

index 7fa39b467275b91b40af4569755d6eaf3240c2b6..0870f0cad31667718bd97d59a66514704a11417a 100644 (file)
@@ -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  <michael.albinus@gmx.de>
 
index 32a3e015f0bea68a63f4fa7a2fc112e293bb6474..83c5b2f6b10d1149b4cdbef028550f23d7cbe580 100644 (file)
@@ -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))))))