Initialize more state for package management fns

This commit is contained in:
Henrik Lissner 2017-06-02 22:28:46 +02:00
parent e4a6780775
commit 45627d6ea6

View file

@ -31,7 +31,7 @@
(defun doom-package-backend (name) (defun doom-package-backend (name)
"Get which backend the package NAME was installed with. Can either be elpa, "Get which backend the package NAME was installed with. Can either be elpa,
quelpa or nil (if not installed)." quelpa or nil (if not installed)."
(doom-initialize) (doom-initialize-packages)
(cond ((let ((plist (cdr (assq name doom-packages)))) (cond ((let ((plist (cdr (assq name doom-packages))))
(and (not (plist-get plist :pin)) (and (not (plist-get plist :pin))
(or (quelpa-setup-p) (or (quelpa-setup-p)
@ -49,7 +49,7 @@ quelpa or nil (if not installed)."
"Determine whether NAME (a symbol) is outdated or not. If outdated, returns a "Determine whether NAME (a symbol) is outdated or not. If outdated, returns a
list, whose car is NAME, and cdr the current version list and latest version list, whose car is NAME, and cdr the current version list and latest version
list of the package." list of the package."
(doom-initialize) (doom-initialize-packages)
(when-let (pkg (assq name package-alist)) (when-let (pkg (assq name package-alist))
(let* ((old-version (package-desc-version (cadr pkg))) (let* ((old-version (package-desc-version (cadr pkg)))
(new-version (new-version
@ -220,6 +220,8 @@ appropriate."
(let ((inhibit-message (not doom-debug-mode))) (let ((inhibit-message (not doom-debug-mode)))
(pcase (doom-package-backend name) (pcase (doom-package-backend name)
('quelpa ('quelpa
(or (quelpa-setup-p)
(error "Failed to initialize quelpa"))
(let ((quelpa-upgrade-p t)) (let ((quelpa-upgrade-p t))
(quelpa (assq name quelpa-cache)))) (quelpa (assq name quelpa-cache))))
('elpa ('elpa