core: fix lazy installation of not used packages

Fixes #5591
This commit is contained in:
syl20bnr 2016-03-26 00:46:11 -04:00
parent dd14afaf26
commit 8815868524
1 changed files with 14 additions and 7 deletions

View File

@ -987,13 +987,20 @@ Returns non-nil if the packages have been installed."
(when (dotspacemacs/add-layer layer-name)
(configuration-layer/sync 'no-install))
(let* ((layer (object-assoc layer-name :name configuration-layer--layers))
(packages (delq nil
(mapcar (lambda (x)
(object-assoc
x :name configuration-layer--packages))
(oref layer :packages)))))
(configuration-layer//install-packages packages)
(configuration-layer//configure-packages packages)
(pkgs-to-install
(delq nil (mapcar
(lambda (x)
(object-assoc
x :name configuration-layer--used-distant-packages))
(oref layer :packages))))
(pkgs-to-configure
(delq nil (mapcar
(lambda (x)
(object-assoc
x :name configuration-layer--packages))
(oref layer :packages)))))
(configuration-layer//install-packages pkgs-to-install)
(configuration-layer//configure-packages pkgs-to-configure)
(oset layer :lazy-install nil))
t))