From f3a9d0c03cb06bbd78bf466f8bef1eb5f0d6c1fa Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 14 Jan 2020 21:57:04 -0500 Subject: [PATCH] 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. --- core/cli/packages.el | 4 ++-- core/core-packages.el | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/core/cli/packages.el b/core/cli/packages.el index 19d4bc29c..625ab25ad 100644 --- a/core/cli/packages.el +++ b/core/cli/packages.el @@ -158,8 +158,8 @@ declaration) or dependency thereof that hasn't already been." fetch-p) (unless (or (and (stringp newcommit) (straight-vc-commit-present-p recipe newcommit) - (print! (start "\033[K(%d/%d) Checking out %s for %s...\033[1A") - i total newcommit package)) + (print! (start "\033[K(%d/%d) Checking out %s (%s)...\033[1A") + i total package (substring newcommit 0 7))) (and (print! (start "\033[K(%d/%d) Fetching %s...\033[1A") i total package) (straight-vc-fetch-from-remote recipe) diff --git a/core/core-packages.el b/core/core-packages.el index b51570202..7802ab1fc 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -169,15 +169,6 @@ necessary package metadata is initialized and available for them." (with-plist! (cdr package) (recipe modules disable ignore pin) (if ignore (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) (with-demoted-errors "Package error: %s" (when recipe @@ -190,7 +181,17 @@ necessary package metadata is initialized and available for them." (print! (warn "%s\n%s") (format "You've disabled %S" name) (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 () "Ensure `straight' is installed and was compiled with this version of Emacs."