From b5bfd808c6b40f47fdef8eb9986bc3127ca63c12 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 14 May 2023 21:22:59 +0200 Subject: [PATCH] Avoid duplicate VC packages in 'package-selected-packages' * 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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index 1fcc30595da..17e93c430c9 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -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 -- 2.39.5