aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Kaludercic2024-12-07 20:02:00 +0100
committerPhilip Kaludercic2024-12-07 20:02:58 +0100
commit3d8e49c41a66a7f05cb96f84e2a10f0f308ac9ca (patch)
treeff73ffff4c301fbfafb6b8e3477708c113475d7b
parent4f2a21cc2a369341b91bb3657e851bdc75e5e053 (diff)
downloademacs-3d8e49c41a66a7f05cb96f84e2a10f0f308ac9ca.tar.gz
emacs-3d8e49c41a66a7f05cb96f84e2a10f0f308ac9ca.zip
Attempt to install package first when upgrading
* lisp/emacs-lisp/package.el (package-upgrade): Swap the 'package-install' and the 'package-delete' invocations. (Bug#74556)
-rw-r--r--lisp/emacs-lisp/package.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 53d04b0d5ec..33d74cc7663 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2272,12 +2272,16 @@ had been enabled."
2272 ;; `pkg-desc' will be nil when the package is an "active built-in". 2272 ;; `pkg-desc' will be nil when the package is an "active built-in".
2273 (if (and pkg-desc (package-vc-p pkg-desc)) 2273 (if (and pkg-desc (package-vc-p pkg-desc))
2274 (package-vc-upgrade pkg-desc) 2274 (package-vc-upgrade pkg-desc)
2275 (when pkg-desc
2276 (package-delete pkg-desc 'force 'dont-unselect))
2277 (package-install package 2275 (package-install package
2278 ;; An active built-in has never been "selected" 2276 ;; An active built-in has never been "selected"
2279 ;; before. Mark it as installed explicitly. 2277 ;; before. Mark it as installed explicitly.
2280 (and pkg-desc 'dont-select))))) 2278 (and pkg-desc 'dont-select))
2279 ;; We delete the old package via the descriptor after installing
2280 ;; the new package to avoid losing the package if there issues
2281 ;; during installation (Bug#74556).
2282 (when pkg-desc
2283 (cl-assert (package-desc-dir pkg-desc))
2284 (package-delete pkg-desc 'force 'dont-unselect)))))
2281 2285
2282(defun package--upgradeable-packages (&optional include-builtins) 2286(defun package--upgradeable-packages (&optional include-builtins)
2283 ;; Initialize the package system to get the list of package 2287 ;; Initialize the package system to get the list of package