From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic 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: Mon, 08 May 2023 10:36:55 +0000 Message-ID: <873547jeig.fsf@posteo.net> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23870"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63338@debbugs.gnu.org To: Jimmy Yuen Ho Wong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 08 12:38:43 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 1pvyGR-00061y-KE for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 May 2023 12:38:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvyG8-0005Zh-6N; Mon, 08 May 2023 06:38:24 -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 1pvyG2-0005VN-95 for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 06:38:18 -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 1pvyFm-0005hH-7D for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 06:38:16 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pvyFm-0005oB-1r for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 06:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 May 2023 10:38: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.168354223222262 (code B ref 63338); Mon, 08 May 2023 10:38:02 +0000 Original-Received: (at 63338) by debbugs.gnu.org; 8 May 2023 10:37:12 +0000 Original-Received: from localhost ([127.0.0.1]:39384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvyEy-0005n0-9Q for submit@debbugs.gnu.org; Mon, 08 May 2023 06:37:12 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:48481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvyEo-0005mL-0F for 63338@debbugs.gnu.org; Mon, 08 May 2023 06:37:11 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id EDF472401C3 for <63338@debbugs.gnu.org>; Mon, 8 May 2023 12:36:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1683542216; bh=43de+NwT7grO7Px8c9KJkdZemcmQDsR8bdE8Orxj8IY=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=UeHM/OGMFRgUEP0p/fzf1CmhnyRPA6GdGPgMZSqFhfsYXgkY7lg+yU6gHk3d99r89 OUqPUA9Beq3rqpdXiARpkeCUsJe43bYksV3A/iPx/dt/Yp59A4fLKU45r4nhoQr0MD VRczSlNIExu4VUQlaZFtXANfchTB0op77j94y656uNYpmPOevcuGihLM+W8+sp2Fw5 RLgP8zfwQgblCFjM7H7XrAJ+d0yKwaDWiVe+bt+QjHQaaMuWSd4WMNHYUCBBPAV5DZ MzO2EYuRhlu0f3COQnXsN2NZxdWwx9bhK+raJ6/AK/ESlA2dYhNpGuUzxCRXog8/UW p1mCiASf78VqA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QFHlq3W65z6tvd; Mon, 8 May 2023 12:36:55 +0200 (CEST) In-Reply-To: (Jimmy Yuen Ho Wong's message of "Sun, 07 May 2023 00:27:24 +0100") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM 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:261302 Archived-At: --=-=-= Content-Type: text/plain Jimmy Yuen Ho Wong 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: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index bbe2b8bb4af..988b92da75b 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1992,7 +1992,7 @@ package--find-non-dependencies (defun package--save-selected-packages (&optional value) "Set and save `package-selected-packages' to VALUE." (when value - (setq package-selected-packages value)) + (setq package-selected-packages (delete-dups value))) (if after-init-time (customize-save-variable 'package-selected-packages package-selected-packages) (add-hook 'after-init-hook #'package--save-selected-packages))) --=-=-=--