From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jimmy Wong Newsgroups: gmane.emacs.bugs Subject: bug#63338: 29.0.90; package-vc-install'ing the same package multiple times results in duplication in package-selected-packages Date: Tue, 9 May 2023 03:56:46 +0100 Message-ID: <5727a6ad-b2c6-4c8f-ac85-b6478c57a749@Spark> References: <873547jeig.fsf@posteo.net> <83h6snc9ms.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="6459b67e_6d501062_115a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32299"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63338@debbugs.gnu.org To: Philip Kaludercic , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 09 04:58:11 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pwDYI-0008AH-RN for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 May 2023 04:58:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pwDYD-0004KV-9D; Mon, 08 May 2023 22:58:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pwDYA-0004Ik-QX for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 22:58:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pwDYA-0000tV-6k for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 22:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pwDYA-0001SD-2c for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 22:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jimmy Wong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 May 2023 02:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63338 X-GNU-PR-Package: emacs Original-Received: via spool by 63338-submit@debbugs.gnu.org id=B63338.16836010335517 (code B ref 63338); Tue, 09 May 2023 02:58:02 +0000 Original-Received: (at 63338) by debbugs.gnu.org; 9 May 2023 02:57:13 +0000 Original-Received: from localhost ([127.0.0.1]:42088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwDXM-0001Qu-KT for submit@debbugs.gnu.org; Mon, 08 May 2023 22:57:13 -0400 Original-Received: from mail-wm1-f44.google.com ([209.85.128.44]:45062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwDXK-0001Qg-M7 for 63338@debbugs.gnu.org; Mon, 08 May 2023 22:57:11 -0400 Original-Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-3f1950f569eso34594085e9.2 for <63338@debbugs.gnu.org>; Mon, 08 May 2023 19:57:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683601024; x=1686193024; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=+MO9o0LEAr/DOS42vUQ16jtl4wS3HQNYjoIAuzKMnTA=; b=cmjdfYSH2TPQILeeYhgyPF7xq8dZAlCvq8ypWqdZYYevFasAHvzZjGvdVCcMNGj2FV GrW7O9X5w/7IdtiIWIyYLbXz5T1vDO9R1eNqVZ+Bdr/bKWNwqTVjRpqhkApgu8kx62pW fj7dmbPOnBLCGix++LWRaUwhsxGrx6IrofHkzdV/zuhg1qmoUNTWbDHXzbzBGUAHwG/L aLuFJngaqUWdw1+fjRF7oyhwYytkzlMUIG4WfIfzvKA1Nx5YXojnGYjhqYp6gu2ujfrw sbqU8zi1wpONji5fCOxWCnxnWUx0hHPkbngiMnN7+lYLsVUkMff7xuHVDtzxah8ls/KS AzsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683601024; x=1686193024; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+MO9o0LEAr/DOS42vUQ16jtl4wS3HQNYjoIAuzKMnTA=; b=NzMgiVKtjMqPLnYgOFubn2F/J5zh2tC9o9OF/UC9r9IWCU8Z6Uy9P+juwDHbMD1ooJ h66xjfwP5t1w9+EjYNekjEIFKnryw6wLX7ZiWB0Pcq8PXL54kH/N02KEmQrG943BUUQY 5SX9Zpd2fEO8d2X+mo79V4BPsxDIpmujlZeinDLxwNJ1AjYl0IdtZgBi8VdJ0zLIGKRi NIUrGZ+q3lzXQeR1b6+/LL1VtwP9SJYEbFXtKNT5U8YOoV6pX5pC9ENcBJrh5c4zdkRh T4eXFoDHxG/NmNw6d6PYrOKdIsyrEopOwAGjkZIQMuiJc4M2Nb2BOBVnCgTu4EsXph8l 1VjA== X-Gm-Message-State: AC+VfDxRI8H0B1zg8E72CZuvW+ng8Nfg9z9H3ay6oI4sfqxdhVDG6Ioq J3sF69pIOkjuhqztbcxsHgo= X-Google-Smtp-Source: ACHHUZ4EFks7G2gk3b0uV7W2pcQNpVC2ybtHrJJW/p3T3uDcd55+HNDiM+8dVYm6ZL5w5NwuKrr6SA== X-Received: by 2002:a05:600c:22ca:b0:3f4:2158:289b with SMTP id 10-20020a05600c22ca00b003f42158289bmr5451434wmg.18.1683601024335; Mon, 08 May 2023 19:57:04 -0700 (PDT) Original-Received: from [192.168.86.143] ([152.37.102.187]) by smtp.gmail.com with ESMTPSA id o17-20020a5d4091000000b003078a3f3a24sm9030597wrp.114.2023.05.08.19.57.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 May 2023 19:57:03 -0700 (PDT) In-Reply-To: <83h6snc9ms.fsf@gnu.org> X-Readdle-Message-ID: 5727a6ad-b2c6-4c8f-ac85-b6478c57a749@Spark X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:261377 Archived-At: --6459b67e_6d501062_115a Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I don=E2=80=99t think you should dedup the variable that could have been = modified by something else such as package-install. This may make debuggi= ng harder should package.el itself introduce a bug that duplicates pacaka= ges in the variable. How about just using good old add-to-list=3F On 8 May 2023 at 1:03 PM +0100, Eli Zaretskii , wrote: > > Cc: 63338=40debbugs.gnu.org > > =46rom: Philip Kaludercic > > Date: Mon, 08 May 2023 10:36:55 +0000 > > > > Jimmy Yuen Ho Wong writes: > > > > > Reproduction: > > > > > > 0. (setq custom-file (const user-emacs-directory =22custom.el=22)) > > > 1. M-x package-vc-install company > > > 2. M-x package-vc-install company RET y > > > 3. C-x C-f =7E/.emacs/custom.el > > > 4. Observe that =60company=60 has been listed twice under > > > =60package-selected-packages=60. > > > > > > Expectation: > > > > > > Installing the same package twice should not result in its duplicat= ion > > > in =60package-selected-packages=60. > > > > 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. --6459b67e_6d501062_115a Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
I don=E2=80=99t 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=3F
On 8 May 2023 at 1:03 PM +0100, Eli= Zaretskii <eliz=40gnu.org>, wrote:
Cc: 63338=40debbugs.gnu.org
=46rom: Philip Kaludercic <philipk=40posteo.net>
Date: Mon, 08 May 2023 10:36:55 +0000

Jimmy Yuen Ho Wong <wyuenho=40gmail.com> writes:

Reproduction:

0. (setq custom-file (const user-emacs-directory =22custom.el=22))
1. M-x package-vc-install company
2. M-x package-vc-install company RET y
3. C-x C-f =7E/.emacs/custom.el
4. Observe that =60company=60 has been listed twice under
=60package-selected-packages=60.

Expectation:

Installing the same package twice should not result in its duplication in =60package-selected-packages=60.

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.
--6459b67e_6d501062_115a--