From: Philip Kaludercic Date: Sun, 14 May 2023 19:22:59 +0000 (+0200) Subject: Avoid duplicate VC packages in 'package-selected-packages' X-Git-Tag: emacs-29.0.92~140 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b5bfd808c6b40f47fdef8eb9986bc3127ca63c12;p=emacs.git 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) --- 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