Resolve pinned packages based on overridden recipes

And rearrange "Checking out ..." message during 'doom upgrade' to
display package first, then commit (and abbreviated), rather than the
other around. It's easier to read.
This commit is contained in:
Henrik Lissner 2020-01-14 21:57:04 -05:00
parent b7e81bc042
commit f3a9d0c03c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 13 additions and 12 deletions

View file

@ -158,8 +158,8 @@ declaration) or dependency thereof that hasn't already been."
fetch-p) fetch-p)
(unless (or (and (stringp newcommit) (unless (or (and (stringp newcommit)
(straight-vc-commit-present-p recipe newcommit) (straight-vc-commit-present-p recipe newcommit)
(print! (start "\033[K(%d/%d) Checking out %s for %s...\033[1A") (print! (start "\033[K(%d/%d) Checking out %s (%s)...\033[1A")
i total newcommit package)) i total package (substring newcommit 0 7)))
(and (print! (start "\033[K(%d/%d) Fetching %s...\033[1A") (and (print! (start "\033[K(%d/%d) Fetching %s...\033[1A")
i total package) i total package)
(straight-vc-fetch-from-remote recipe) (straight-vc-fetch-from-remote recipe)

View file

@ -169,15 +169,6 @@ necessary package metadata is initialized and available for them."
(with-plist! (cdr package) (recipe modules disable ignore pin) (with-plist! (cdr package) (recipe modules disable ignore pin)
(if ignore (if ignore
(doom-log "Ignoring package %S" name) (doom-log "Ignoring package %S" name)
(when pin
(doom-log "Pinning package %S to %S" name pin)
(setf (alist-get
(if-let* ((recipe (cdr (straight-recipes-retrieve name)))
(repo (straight-vc-local-repo-name recipe)))
repo
(symbol-name name))
doom-pinned-packages nil nil #'equal)
pin))
(if (not disable) (if (not disable)
(with-demoted-errors "Package error: %s" (with-demoted-errors "Package error: %s"
(when recipe (when recipe
@ -190,7 +181,17 @@ necessary package metadata is initialized and available for them."
(print! (warn "%s\n%s") (print! (warn "%s\n%s")
(format "You've disabled %S" name) (format "You've disabled %S" name)
(indent 2 (concat "This is a core package. Disabling it will cause errors, as Doom assumes\n" (indent 2 (concat "This is a core package. Disabling it will cause errors, as Doom assumes\n"
"core packages are always available. Disable their minor-modes or hooks instead."))))))))))) "core packages are always available. Disable their minor-modes or hooks instead.")))))
(when pin
(let ((realname
(if-let* ((recipe (cdr (straight-recipes-retrieve name)))
(repo (straight-vc-local-repo-name recipe)))
repo
(symbol-name name))))
(doom-log "Pinning package %S to %S" realname pin)
(setf (alist-get realname doom-pinned-packages
nil nil #'equal)
pin)))))))))
(defun doom-ensure-straight () (defun doom-ensure-straight ()
"Ensure `straight' is installed and was compiled with this version of Emacs." "Ensure `straight' is installed and was compiled with this version of Emacs."