]> git.eshelyaron.com Git - emacs.git/commitdiff
Have 'package-vc-selected-packages' consider all installed packages
authorPhilip Kaludercic <philipk@posteo.net>
Sat, 12 Nov 2022 08:14:33 +0000 (09:14 +0100)
committerPhilip Kaludercic <philipk@posteo.net>
Thu, 17 Nov 2022 19:37:28 +0000 (20:37 +0100)
* lisp/emacs-lisp/package-vc.el
(package-vc-install-selected-packages): Consider more than just one
value in `package-alist', in case there are multiple installations.

lisp/emacs-lisp/package-vc.el

index 7fed1b5885e1f53c9f0c2e4b3037e753a83d97d3..62724d398c13dc6778a11f673c77187a51a4a563 100644 (file)
@@ -119,9 +119,8 @@ the `clone' function."
   (pcase-dolist (`(,name . ,spec) package-vc-selected-packages)
     (when (stringp name)
       (setq name (intern name)))
-    (let ((pkg-desc (cadr (assoc name package-alist #'string=))))
-      (unless (and name (package-installed-p name)
-                   (package-vc-p pkg-desc))
+    (let ((pkg-descs (assoc name package-alist #'string=)))
+      (unless (seq-some #'package-vc-p (cdr pkg-descs))
         (cond
          ((null spec)
           (package-vc-install name))
@@ -129,7 +128,7 @@ the `clone' function."
           (package-vc-install name nil spec))
          ((listp spec)
           (package-vc--archives-initialize)
-          (package-vc--unpack pkg-desc spec)))))))
+          (package-vc--unpack (cadr pkg-descs) spec)))))))
 
 ;;;###autoload
 (defcustom package-vc-selected-packages '()