Rewrite how doom-update-package updates from ELPA
This is an attempt to make package updating atomic. Previously, if a package failed to update, it would've been deleted.
This commit is contained in:
parent
77e2a1f6f2
commit
6807a5fda8
1 changed files with 10 additions and 2 deletions
|
@ -225,8 +225,16 @@ appropriate."
|
|||
(let ((quelpa-upgrade-p t))
|
||||
(quelpa (assq name quelpa-cache))))
|
||||
('elpa
|
||||
(doom-delete-package name t)
|
||||
(doom-install-package name))))
|
||||
(let* ((desc (cadr (assq name package-alist)))
|
||||
(archive (cadr (assq name package-archive-contents)))
|
||||
(packages
|
||||
(if (package-desc-p archive)
|
||||
(package-compute-transaction (list archive) (package-desc-reqs archive))
|
||||
(package-compute-transaction () (list (list archive))))))
|
||||
(package-download-transaction packages)
|
||||
(when-let (old-dir (package-desc-dir desc))
|
||||
(when (file-directory-p old-dir)
|
||||
(delete-directory old-dir t)))))))
|
||||
(version-list-=
|
||||
(package-desc-version (cadr (assq name package-alist)))
|
||||
(package-desc-version (cadr (assq name package-archive-contents))))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue