]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid duplicate VC packages in 'package-selected-packages'
authorPhilip Kaludercic <philipk@posteo.net>
Sun, 14 May 2023 19:22:59 +0000 (21:22 +0200)
committerPhilip Kaludercic <philipk@posteo.net>
Tue, 16 May 2023 18:47:34 +0000 (20:47 +0200)
* lisp/emacs-lisp/package-vc.el (package-vc--unpack-1): Check if
'package-selected-packages' already contains the package name.
(bug#63338)

lisp/emacs-lisp/package-vc.el

index 1fcc30595da2fc9cf7a430075c139704b356a3c2..17e93c430c944c369f8781d670d04e3009d7d8d0 100644 (file)
@@ -506,9 +506,11 @@ documentation and marking the package as installed."
         (package--reload-previously-loaded new-desc)))
 
     ;; Mark package as selected
-    (package--save-selected-packages
-     (cons (package-desc-name pkg-desc)
-           package-selected-packages))
+    (let ((name (package-desc-name pkg-desc)))
+      (unless (memq name package-selected-packages)
+        (package--save-selected-packages
+         (cons name package-selected-packages))))
+
     (package--quickstart-maybe-refresh)
 
     ;; Confirm that the installation was successful