diff --git a/core/cli/packages.el b/core/cli/packages.el index 14c7e83de..a72acc241 100644 --- a/core/cli/packages.el +++ b/core/cli/packages.el @@ -446,12 +446,14 @@ Unless AUTO-ACCEPT-P is non-nil, this function will prompt for confirmation with a list of packages that will be removed." (print! (start "Searching for orphaned packages to purge (for the emperor)...")) (cl-destructuring-bind (&optional builds-to-purge repos-to-purge repos-to-regraft) - (list (cl-remove-if (doom-rpartial #'gethash straight--profile-cache) - (straight--directory-files (straight--build-dir))) - (cl-remove-if (doom-rpartial #'straight--checkhash straight--repo-cache) - (straight--directory-files (straight--repos-dir))) - (cl-remove-if-not (doom-rpartial #'straight--checkhash straight--repo-cache) - (straight--directory-files (straight--repos-dir)))) + (let ((rdirs (straight--directory-files (straight--repos-dir) nil nil 'sort)) + (bdirs (straight--directory-files (straight--build-dir) nil nil 'sort))) + (list (cl-delete-if (doom-rpartial #'gethash straight--profile-cache) + bdirs) + (cl-delete-if (doom-rpartial #'straight--checkhash straight--repo-cache) + rdirs) + (cl-delete-if-not (doom-rpartial #'straight--checkhash straight--repo-cache) + rdirs))) (let (success) (print-group! (if (not builds-p)