Subject: bug#63338: 29.0.90; package-vc-install'ing the same package multiple times results in duplication in package-selected-packages

From: Jimmy Wong <[email-masked]>
Date: Tue, 9 May 2023 03:56:46 +0100

I don’t think you should dedup the variable that could have been modified by something else such as package-install. This may make debugging harder should package.el itself introduce a bug that duplicates pacakages in the variable. How about just using good old add-to-list?
On 8 May 2023 at 1:03 PM +0100, Eli Zaretskii <[email-masked]>, wrote:
> > Cc: [email-masked]
> > From: Philip Kaludercic <[email-masked]>
> > Date: Mon, 08 May 2023 10:36:55 +0000
> >
> > Jimmy Yuen Ho Wong <[email-masked]> writes:
> >
> > > Reproduction:
> > >
> > > 0. (setq custom-file (const user-emacs-directory "custom.el"))
> > > 1. M-x package-vc-install company
> > > 2. M-x package-vc-install company RET y
> > > 3. C-x C-f ~/.emacs/custom.el
> > > 4. Observe that `company` has been listed twice under
> > > `package-selected-packages`.
> > >
> > > Expectation:
> > >
> > > Installing the same package twice should not result in its duplication
> > > in `package-selected-packages`.
> >
> > An easy fix would be just to ensure that package-selected-packages is
> > always deduplicated before assigning the value:
>
> This is OK for the emacs-29 branch, thanks.