core: display the list of packages to update

This commit is contained in:
syl20bnr 2016-01-11 00:29:12 -05:00
parent 4be19eff93
commit d610a13d60

View file

@ -947,8 +947,7 @@ path."
If called with a prefix argument ALWAYS-UPDATE, assume yes to update."
(interactive "P")
(spacemacs-buffer/insert-page-break)
(spacemacs-buffer/append (concat "\nUpdating Emacs packages from remote "
"repositories (ELPA, MELPA, etc.)...\n"))
(spacemacs-buffer/append "\nUpdating package archives, please wait...\n")
(configuration-layer/retrieve-package-archives nil 'force)
(setq configuration-layer--skipped-packages nil)
(let* ((update-packages
@ -972,17 +971,21 @@ If called with a prefix argument ALWAYS-UPDATE, assume yes to update."
configuration-layer--skipped-packages
" "))))
;; (message "packages to udpate: %s" update-packages)
(if (> upgrade-count 0)
(if (and (not always-update)
(not (yes-or-no-p (format (concat "%s package(s) to update, "
(if (> skipped-count 0)
(format "%s package(s) skipped, "
skipped-count)
"")
"do you want to continue ? ")
upgrade-count))))
(when (> upgrade-count 0)
(spacemacs-buffer/append
"Packages update has been cancelled.\n")
(format (concat "--> Found %s package(s) to update"
(if (> skipped-count 0)
(format " (skipped %s):\n" skipped-count)
":\n"))
upgrade-count) t)
(mapc (lambda (x)
(spacemacs-buffer/append (format "%s\n" x) t))
update-packages)
(if (and (not always-update)
(not (yes-or-no-p
(format "Do you want to update %s package(s) ? "
upgrade-count))))
(spacemacs-buffer/append "Packages update has been cancelled.\n" t)
;; backup the package directory and construct an alist
;; variable to be cached for easy update and rollback
(spacemacs-buffer/append
@ -1013,7 +1016,8 @@ If called with a prefix argument ALWAYS-UPDATE, assume yes to update."
(spacemacs-buffer/append
"\nEmacs has to be restarted to actually install the new packages.\n")
(configuration-layer//cleanup-rollback-directory)
(spacemacs//redisplay))
(spacemacs//redisplay)))
(when (eq upgrade-count 0)
(spacemacs-buffer/append "--> All packages are up to date.\n")
(spacemacs//redisplay))))