Optimize package management commands
Effectively halving run time on package install, update and autoremove commands.
This commit is contained in:
parent
c46bd978fc
commit
82f9fb7027
2 changed files with 19 additions and 16 deletions
|
@ -147,7 +147,7 @@ Warning: this function is expensive; it re-evaluates all of doom's config files.
|
|||
Be careful not to use it in a loop.
|
||||
|
||||
If INSTALLED-ONLY-P, only return packages that are installed."
|
||||
(doom-initialize-packages t)
|
||||
(doom-initialize-packages (not noninteractive))
|
||||
(cl-loop with packages = (append doom-core-packages (mapcar #'car doom-packages))
|
||||
for sym in (cl-delete-duplicates packages)
|
||||
if (and (or (not installed-only-p)
|
||||
|
@ -180,7 +180,7 @@ containing (PACKAGE-SYMBOL OLD-VERSION-LIST NEW-VERSION-LIST).
|
|||
If INCLUDE-FROZEN-P is non-nil, check frozen packages as well.
|
||||
|
||||
Used by `doom//packages-update'."
|
||||
(doom-initialize-packages t)
|
||||
(doom-initialize-packages (not noninteractive))
|
||||
(require 'async)
|
||||
(let (quelpa-pkgs elpa-pkgs)
|
||||
;; Separate quelpa from elpa packages
|
||||
|
@ -201,13 +201,17 @@ Used by `doom//packages-update'."
|
|||
(message "New thread for: %s" pkg))
|
||||
(push (async-start
|
||||
`(lambda ()
|
||||
(setq user-emacs-directory ,user-emacs-directory)
|
||||
(let ((noninteractive t))
|
||||
(load ,(expand-file-name "core.el" doom-core-dir)))
|
||||
(setq doom-packages ',doom-packages
|
||||
doom-modules ',doom-modules
|
||||
quelpa-cache ',quelpa-cache)
|
||||
(doom-package-outdated-p ',pkg)))
|
||||
(let ((doom-init-p 'internal)
|
||||
(noninteractive t)
|
||||
(load-path ',load-path)
|
||||
(doom-packages ',doom-packages)
|
||||
(doom-modules ',doom-modules)
|
||||
(quelpa-cache ',quelpa-cache)
|
||||
(user-emacs-directory ,user-emacs-directory)
|
||||
doom-private-dir)
|
||||
(load ,(expand-file-name "core.el" doom-core-dir))
|
||||
(load ,(expand-file-name "autoload/packages.el" doom-core-dir))
|
||||
(doom-package-outdated-p ',pkg))))
|
||||
futures))
|
||||
(delq nil
|
||||
(append (mapcar #'doom-package-outdated-p elpa-pkgs)
|
||||
|
@ -219,7 +223,7 @@ Used by `doom//packages-update'."
|
|||
depended on.
|
||||
|
||||
Used by `doom//packages-autoremove'."
|
||||
(doom-initialize-packages t)
|
||||
(doom-initialize-packages (not noninteractive))
|
||||
(let ((package-selected-packages
|
||||
(append (mapcar #'car doom-packages) doom-core-packages)))
|
||||
(append (package--removable-packages)
|
||||
|
@ -239,7 +243,7 @@ If INCLUDE-IGNORED-P is non-nil, includes missing packages that are ignored,
|
|||
i.e. they have an :ignore property.
|
||||
|
||||
Used by `doom//packages-install'."
|
||||
(doom-initialize-packages t)
|
||||
(doom-initialize-packages (not noninteractive))
|
||||
(cl-loop for desc in (doom-get-packages)
|
||||
for (name . plist) = desc
|
||||
if (and (or include-ignored-p
|
||||
|
|
|
@ -200,6 +200,8 @@ FORCE-P is non-nil, do it anyway.
|
|||
(require 'subr-x)
|
||||
(require 'cl-lib)
|
||||
(require 'map))
|
||||
(when (eq doom-init-p 'internal)
|
||||
(setq force-p nil))
|
||||
(when (or force-p (not doom-init-p))
|
||||
;; packages.el cache
|
||||
(when (and force-p (file-exists-p doom-packages-file))
|
||||
|
@ -316,12 +318,9 @@ them."
|
|||
(_load (expand-file-name "packages.el" doom-core-dir))
|
||||
(cl-loop for key being the hash-keys of doom-modules
|
||||
for path = (doom-module-expand-file (car key) (cdr key) "packages.el")
|
||||
if (file-exists-p path)
|
||||
do (let ((doom--current-module key)) (_load path)))
|
||||
do (let ((doom--current-module key)) (_load path t)))
|
||||
(cl-loop for dir in doom-psuedo-module-dirs
|
||||
for path = (expand-file-name "packages.el" dir)
|
||||
if (file-exists-p path)
|
||||
do (_load path))))))))
|
||||
do (_load (expand-file-name "packages.el" dir) t))))))))
|
||||
|
||||
|
||||
;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue