configuration: fix redundant update checking

Fixes #13114
This commit is contained in:
Aaron Jensen 2019-12-22 08:22:20 -08:00 committed by Maximilian Wolff
parent 0d7d8ce0ed
commit 840b431cf6
No known key found for this signature in database
GPG Key ID: 2DD07025BFDBD89A
2 changed files with 23 additions and 14 deletions

View File

@ -626,6 +626,7 @@ Other:
- Replaced =destructuring-bind= with =cl-destructuring-bind=
(thanks to duianto)
- Ignore nils in dotspacemacs-configuration-layers (thanks to Ag)
- Fixed redundant package version checking during update (thanks to aaronjensen)
- Other:
- New function =configuration-layer/message= to display message in
=*Messages*= buffer (thanks to Sylvain Benner)

View File

@ -1827,27 +1827,35 @@ RNAME is the name symbol of another existing layer."
"to add a recipe for it in alist %S.")
pkg-name recipes-var))))
(defun configuration-layer//filter-packages-with-deps
(defun configuration-layer//filter-packages-with-deps-recur
(pkg-names filter &optional use-archive)
"Return a filtered PKG-NAMES list where each elements satisfies FILTER."
(when pkg-names
(let (result)
(dolist (pkg-name pkg-names)
;; recursively check dependencies
(let* ((deps
(if use-archive
(configuration-layer//get-package-deps-from-archive
pkg-name)
(configuration-layer//get-package-deps-from-alist pkg-name)))
(install-deps
(when deps (configuration-layer//filter-packages-with-deps
(mapcar 'car deps) filter))))
(when install-deps
(setq result (append install-deps result))))
(when (funcall filter pkg-name)
(add-to-list 'result pkg-name t)))
(when (not (memq pkg-name checked-packages))
(push pkg-name checked-packages)
;; recursively check dependencies
(let* ((deps
(if use-archive
(configuration-layer//get-package-deps-from-archive
pkg-name)
(configuration-layer//get-package-deps-from-alist pkg-name)))
(install-deps
(when deps (configuration-layer//filter-packages-with-deps-recur
(mapcar 'car deps) filter))))
(when install-deps
(setq result (append install-deps result))))
(when (funcall filter pkg-name)
(add-to-list 'result pkg-name t))))
(delete-dups result))))
(defun configuration-layer//filter-packages-with-deps
(pkg-names filter &optional use-archive)
"Return a filtered PKG-NAMES list where each elements satisfies FILTER."
(let ((checked-packages))
(configuration-layer//filter-packages-with-deps-recur pkg-names filter use-archive)))
(defun configuration-layer//get-uninstalled-packages (pkg-names)
"Return a filtered list of PKG-NAMES to install."
(configuration-layer//filter-packages-with-deps