GNU bug report logs - #76568
'package-install' should not install duplicate packages

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Ship Mints <shipmints@HIDDEN>; Keywords: patch; dated Tue, 25 Feb 2025 20:53:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) patch. Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 76568 <at> debbugs.gnu.org:


Received: (at 76568) by debbugs.gnu.org; 5 Mar 2025 17:01:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 05 12:01:14 2025
Received: from localhost ([127.0.0.1]:39380 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tps7O-00029r-CS
	for submit <at> debbugs.gnu.org; Wed, 05 Mar 2025 12:01:14 -0500
Received: from mail-vk1-xa32.google.com ([2607:f8b0:4864:20::a32]:50196)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1tps7M-00029Y-Aj
 for 76568 <at> debbugs.gnu.org; Wed, 05 Mar 2025 12:01:13 -0500
Received: by mail-vk1-xa32.google.com with SMTP id
 71dfb90a1353d-523909ec175so1577202e0c.0
 for <76568 <at> debbugs.gnu.org>; Wed, 05 Mar 2025 09:01:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741194066; x=1741798866; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=eMxEzi16Q/aM/9YAGJiK5ZOveex8cbrboPYbsVE1fsk=;
 b=JzUL2+6J/evUpHGVELH0RHC5eoTPOGjx2a+N4Uoijo2jDoUDlKWq6M6NV8uIFX/2BS
 lT39V9Vv5nuyKzb++aMH2SH4qfm8tJuLWSLK4PclPnrEUW1i1vkYHOEf1Po0SAEHMDXD
 PhD0jpd8ZuSqXqhRs1cvGr1QO/sBuuDaPTEMuxf3Q09tBR/bFDzu1VvAIbRZi/D3eDp9
 +7abxIK4QTg6cFbjwrl+d9jg516Ee05GNPH3TlCdCqlmfT2Jx7TAbl9fL/NmuCtBE4Dk
 k96Lx1BJm3tEnrTbTMANQX8OlpjS3gWFda71WRfxZXrtot/3NLWkcpkHkK7lRM+Kvcv9
 Qdsg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741194066; x=1741798866;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=eMxEzi16Q/aM/9YAGJiK5ZOveex8cbrboPYbsVE1fsk=;
 b=IOyinJmbSoxphM77p1SVThNwCfUpGyyvkokPyzJACnmPFd5J4Wk1E5xO5Jos4QdhxW
 lMBkw+WbTVK7eVj7MI5haSpeaWSrmA3xUL1JdiV9PtG4OkmB0efUs7DWmEbT+ib29Z60
 R5MeBFR6ND9ErGDUQ1C6LVo88fEGLRLvrxYFiq0qwH0GGH0t1Q0MhI+y56plj2mUURxe
 oGVAZDuiWz4FjWXVl12kGe63Cs8rKYC53u9ekmlRQQ1fPkles1e5oNi30jn0L984M8tI
 +eU/TPnBkNFnV+EQLHKIopJ10W6s8SUI0rU9LZDBTvY/8NgowcnOiH7VCPEM9+bedCU/
 Gscw==
X-Gm-Message-State: AOJu0YwgX16G5Ell7grml5SwUOB4pzWzjjyjMz6zT9LuBIl+lhVv1Trb
 FF72a5cxU10LBDVsT0dHgoRZJxlhTl1hbz3H2cnhmLXzC2GnFiUuUkb45YmlhpJNcepPCbWu868
 Ero4heyTwa4kdkI4xwOpkVai5U84=
X-Gm-Gg: ASbGncudatioY8HaflFva4k+Iz0E2CEqGbvUC2mv4Pljx2bW281OmHI1gzTRw5mulQo
 vDGoOcT3STdRHjAcVBZzlU8DRuAkxEEAYee0gbtVtH3bNv+GXVLxsaFYmj5oJhD0aCH++nfT04n
 ag7GFXmDpX9AimFCZtbzTuFDPgyw==
X-Google-Smtp-Source: AGHT+IFjqI762RT4YHDzAZ3mhr05Jk3AIn/ZkVEyuS35v9wFk/Xi8GOgtFd4YCoXrHLCciwu7XviD38080PQ//+o4eU=
X-Received: by 2002:a05:6122:d21:b0:51f:3ffb:79ab with SMTP id
 71dfb90a1353d-523c62889d4mr2236708e0c.8.1741194066703; Wed, 05 Mar 2025
 09:01:06 -0800 (PST)
MIME-Version: 1.0
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
In-Reply-To: <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Wed, 5 Mar 2025 12:00:55 -0500
X-Gm-Features: AQ5f1JpZxBIC91z3mdKdTkvpmoeo1Vq4bPFQ2_WtZYc0W27WUW5wxIHWlL0uQZ0
Message-ID: <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
To: Stefan Kangas <stefankangas@HIDDEN>
Content-Type: multipart/mixed; boundary="000000000000d4d271062f9b556b"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76568
Cc: 76568 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000d4d271062f9b556b
Content-Type: multipart/alternative; boundary="000000000000d4d26f062f9b5569"

--000000000000d4d26f062f9b5569
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Mar 3, 2025 at 9:34=E2=80=AFPM Stefan Kangas <stefankangas@HIDDEN=
m> wrote:

> Ship Mints <shipmints@HIDDEN> writes:
>
> > As part of my production upgrade to 30.1, and before I wrote a program
> to install my local
> > ELPA tree from scratch, I tried to first curate my packages and change
> from MELPA to
> > generally equivalent GNU ELPA or non-GNU ELPA archives.  The result was
> that I had two of
> > each package installed.
> >
> > I think there's a bug in 'package-install' which, when invoked from
> > 'package-install-button-action', processes the new package spec, and
> incorrectly checks to
> > see if the package is already installed.  Interactive invocation of
> 'package-install' yields the
> > package name from the prompt, not its archive description.
> >
> > If the below is correct, I can submit a patch to make 'package-install'
> behave like
> > 'package-reinstall' for the non-interactive case.
>
> Please submit a patch, but could we also have tests for this please?
>
> Thanks in advance.
>

Patch attached.  It prevents the menu-driven case from erasing the already
installed message.  It could suggest to the user to remove and then install
or we could offer to use package upgrade to the chosen package-desc.  At
the very least, the patch prevents duplicates.

-Stephane

--000000000000d4d26f062f9b5569
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon=
t-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">=
On Mon, Mar 3, 2025 at 9:34=E2=80=AFPM Stefan Kangas &lt;<a href=3D"mailto:=
stefankangas@HIDDEN">stefankangas@HIDDEN</a>&gt; wrote:</span></div><=
/div><div class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"=
gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(20=
4,204,204);padding-left:1ex">Ship Mints &lt;<a href=3D"mailto:shipmints@gma=
il.com" target=3D"_blank">shipmints@HIDDEN</a>&gt; writes:<br>
<br>
&gt; As part of my production upgrade to 30.1, and before I wrote a program=
 to install my local<br>
&gt; ELPA tree from scratch, I tried to first curate my packages and change=
 from MELPA to<br>
&gt; generally equivalent GNU ELPA or non-GNU ELPA archives.=C2=A0 The resu=
lt was that I had two of<br>
&gt; each package installed.<br>
&gt;<br>
&gt; I think there&#39;s a bug in &#39;package-install&#39; which, when inv=
oked from<br>
&gt; &#39;package-install-button-action&#39;, processes the new package spe=
c, and incorrectly checks to<br>
&gt; see if the package is already installed.=C2=A0 Interactive invocation =
of &#39;package-install&#39; yields the<br>
&gt; package name from the prompt, not its archive description.<br>
&gt;<br>
&gt; If the below is correct, I can submit a patch to make &#39;package-ins=
tall&#39; behave like<br>
&gt; &#39;package-reinstall&#39; for the non-interactive case.<br>
<br>
Please submit a patch, but could we also have tests for this please?<br>
<br>
Thanks in advance.<br></blockquote><div><br></div><div class=3D"gmail_defau=
lt" style=3D"font-family:monospace">Patch attached.=C2=A0 It prevents the m=
enu-driven case from erasing the already installed message.=C2=A0 It could =
suggest to the user to remove and then install or we could offer to use pac=
kage upgrade to the chosen package-desc.=C2=A0 At the very least, the patch=
 prevents duplicates.</div><div class=3D"gmail_default" style=3D"font-famil=
y:monospace"><br></div><div class=3D"gmail_default" style=3D"font-family:mo=
nospace">-Stephane</div></div></div>

--000000000000d4d26f062f9b5569--

--000000000000d4d271062f9b556b
Content-Type: application/octet-stream; 
	name="0001-Correct-package-install-to-detect-installed-packages.patch"
Content-Disposition: attachment; 
	filename="0001-Correct-package-install-to-detect-installed-packages.patch"
Content-Transfer-Encoding: base64
Content-ID: <f_m7w5xifu0>
X-Attachment-Id: f_m7w5xifu0

RnJvbSA3YWY5YmNhNDExN2Y1NjNiMzRkYWNiYmNiNjE4MzM0OTdhZWQ2ZjE2IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBzaGlwbWludHMgPHNoaXBtaW50c0BnbWFpbC5jb20+CkRhdGU6
IFdlZCwgNSBNYXIgMjAyNSAxMTozMzowNyAtMDUwMApTdWJqZWN0OiBbUEFUQ0hdIENvcnJlY3Qg
J3BhY2thZ2UtaW5zdGFsbCcgdG8gZGV0ZWN0IGluc3RhbGxlZCBwYWNrYWdlcwogKGJ1ZyM3NjU2
OCkKCiogbGlzcC9lbWFjcy1saXNwL3BhY2thZ2UuZWwKKHBhY2thZ2UtaW5zdGFsbCk6IENoZWNr
IGZvciBhbHJlYWR5IGluc3RhbGxlZCBwYWNrYWdlIHVzaW5nIGl0cyBzeW1ib2wKcmF0aGVyIHRo
YW4gcmVseSBvbiBkaWZmZXJpbmcgYXJjaGl2ZSBkaXJlY3Rvcnkgc3RydWN0dXJlcy4gIFJldHVy
biB0IGlmCmluc3RhbGxlZCwgbmlsIG90aGVyd2lzZS4KKHBhY2thZ2UtaW5zdGFsbC1idXR0b24t
YWN0aW9uKTogJ2Rlc2NyaWJlLXBhY2thZ2UnIG9ubHkgd2hlbgoncGFja2FnZS1pbnN0YWxsJyBh
Y3R1YWxseSBpbnN0YWxsZWQgdGhlIHBhY2thZ2UuCiogdGVzdC9saXNwL2VtYWNzLWxpc3AvcGFj
a2FnZS10ZXN0cy5lbCAocGFja2FnZS10ZXN0LWluc3RhbGwtc2luZ2xlKToKQWRkIGFscmVhZHkt
aW5zdGFsbGVkIHRlc3QgdXNpbmcgJ3BhY2thZ2UtaW5zdGFsbCcgd2l0aCBhCidwYWNrYWdlLWRl
c2MnLgotL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ICAg
IChidWZmZXItc3RyaW5nKSkpKQogICAgIChzaG91bGQgKHBhY2thZ2UtaW5zdGFsbGVkLXAgJ3Np
bXBsZS1zaW5nbGUpKQorICAgIDs7IFRlc3QgZm9yIGBwYWNrYWdlLWluc3RhbGwnIGFscmVhZHkg
aW5zdGFsbGVkIHVzaW5nIGEKKyAgICA7OyBwYWNrYWdlLWRlc2MuICBgcGFja2FnZS1pbnN0YWxs
JyByZXR1cm5zIG5pbCBpZiBhbHJlYWR5CisgICAgOzsgaW5zdGFsbGVkLgorICAgIChzaG91bGQt
bm90IChwYWNrYWdlLWluc3RhbGwgc2ltcGxlLXNpbmdsZS1kZXNjKSkKICAgICAobGV0KiAoKHNp
bXBsZS1wa2ctZGlyIChmaWxlLW5hbWUtYXMtZGlyZWN0b3J5CiAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgKGV4cGFuZC1maWxlLW5hbWUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
InNpbXBsZS1zaW5nbGUtMS4zIgotLSAKMi40Ny4xCgo=
--000000000000d4d271062f9b556b--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76568; Package emacs. Full text available.

Message received at 76568 <at> debbugs.gnu.org:


Received: (at 76568) by debbugs.gnu.org; 4 Mar 2025 02:35:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 03 21:35:04 2025
Received: from localhost ([127.0.0.1]:53646 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tpI7b-0004zi-TP
	for submit <at> debbugs.gnu.org; Mon, 03 Mar 2025 21:35:04 -0500
Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]:52544)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1tpI7a-0004yT-6I
 for 76568 <at> debbugs.gnu.org; Mon, 03 Mar 2025 21:35:02 -0500
Received: by mail-ej1-x634.google.com with SMTP id
 a640c23a62f3a-aaedd529ba1so592931866b.1
 for <76568 <at> debbugs.gnu.org>; Mon, 03 Mar 2025 18:35:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741055696; x=1741660496; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=3d5B/EKbO22Gcx1tYdqrJasMPAqMpzLfFQku7P9Kaa0=;
 b=C5jl27zM4AorMMt4y7T5zE3xFgf9nCcMqytEbI+DJNlyEakxdcGfjMnusBdYYVNb0w
 x89UNwH9Hm2MzGhTZTlbJBVl+rFWJU8F0TkA4iylnZRWSaRyjFSenchsO/N0G4MmGYl5
 I/b/4u4QOhR/c+g3k46ogpK3aI2Uwo1q4SbRfJc1B+UkOq/z49GOwHAfN9ghi7Rnj4Zn
 GQLa8b41kAdCqbp3yw2Qkyw5ZtXg+8P1X7oaxk5P29psWe5C5gSEcbm0EzGyOpKX8lhd
 WA0L3/9njFAOZIDOaLsZTXtEHBEbTKBNFoCTsE38x+FqDMuwPFT2mZtt7/SZ+7FkPQSF
 3aCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741055696; x=1741660496;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=3d5B/EKbO22Gcx1tYdqrJasMPAqMpzLfFQku7P9Kaa0=;
 b=RKwpx9eKKWolvyvn23O2sI9M7a5MAwG7eYSIGcT6/vtycYJ6OT/ZnMjhkYde6kJ/IC
 9xDexUFu4sdHGfiSQMqMI04NHJFD/kbqSNIrSnCqvKEQsJRzIB/D73M1yg7IpMLvJ88h
 UvxUNLZgA68IpeQDA1OjvDHMBv/CEhhXeJRM164ptz8YqdT99YcG/qx/fJlKad+dRFjZ
 ZFCgFKs+nVlOIqc9wlcvYiqfrl81riTiREM60EwQ8QyMUvKVmY+UU16dtSHswQc1HaFT
 7OGrDIuTMFdxnMl6WvBaJKVOH8RnRLjKmB1aAfYGTkLBt4nc8JNNecB4LSyoU1v76oHs
 UTsA==
X-Gm-Message-State: AOJu0Ywlomn9fCE8MuSqySEF5AHe59F9X+WgmQSr3B+LlfQijPDsCtXh
 +LlvanZi1NqeedsLSCcSaAG3WhJpeg1OukatXf8HCBWa2mCKS3iePQlMmEb4jSXeoLEopq+umlN
 mQuYcRfuEOL6tDDzpQ0HKwah9GN4=
X-Gm-Gg: ASbGncu6Xe3Wsytrr8SLJH8JIeNAfdhWcuqgJWXRA+0hEnLD2m6ogt/YCUMfOuVprh0
 I4TXt4u9SMPutkWxet8qlxx2dqqxdASd+S00VV6JgQ0ZOtBvXSP4furAjcn7nSkAs7SqURKMt4N
 i8XsDD0fqkD3tCEI6v1/gbY1Q47GM=
X-Google-Smtp-Source: AGHT+IG8tCPXtcm5hgb784rDRbQeEWec8nsgC58ZJElYI+Hx9S0pbKvSIv/A6LDKALSXfk17CusVG9GHf4g6GDC+jK4=
X-Received: by 2002:a05:6402:34c6:b0:5de:4a8b:4c9c with SMTP id
 4fb4d7f45d1cf-5e4d6b62f6emr40575969a12.32.1741055695701; Mon, 03 Mar 2025
 18:34:55 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Tue, 4 Mar 2025 02:34:54 +0000
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
MIME-Version: 1.0
Date: Tue, 4 Mar 2025 02:34:54 +0000
X-Gm-Features: AQ5f1JqDYRVT6cgnaMkjr3l8s6LhJ-GDXNCguoQE-MMkHLqrmeoL3YHGoJkYAOA
Message-ID: <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
To: Ship Mints <shipmints@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76568
Cc: 76568 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Ship Mints <shipmints@HIDDEN> writes:

> As part of my production upgrade to 30.1, and before I wrote a program to install my local
> ELPA tree from scratch, I tried to first curate my packages and change from MELPA to
> generally equivalent GNU ELPA or non-GNU ELPA archives.  The result was that I had two of
> each package installed.
>
> I think there's a bug in 'package-install' which, when invoked from
> 'package-install-button-action', processes the new package spec, and incorrectly checks to
> see if the package is already installed.  Interactive invocation of 'package-install' yields the
> package name from the prompt, not its archive description.
>
> If the below is correct, I can submit a patch to make 'package-install' behave like
> 'package-reinstall' for the non-interactive case.

Please submit a patch, but could we also have tests for this please?

Thanks in advance.

>
> (defun package-install (pkg &optional dont-select)
> ...
>     (if-let* ((transaction
>                (if (package-desc-p pkg)
> ;; Problem seems to be here.  If the new pkg desc is for a
> ;; different archive directory name style, package-installed-p
> ;; fails as it checks to see if the new directory exists (which
> ;; does not), ignoring the old archive directory.
>                    (unless (package-installed-p pkg)
>                      (package-compute-transaction (list pkg)
>                                                   (package-desc-reqs pkg)))
>
> In contrast, 'package-reinstall' does the right thing by first deleting the existing package before
> installing the new one.
>
> (defun package-reinstall (pkg)
> ...
>   (package-delete
>    (if (package-desc-p pkg) pkg (cadr (assq pkg package-alist)))
>    'force 'nosave)
>   (package-install pkg 'dont-select))
>
> -Stephane




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76568; Package emacs. Full text available.

Message received at 76568 <at> debbugs.gnu.org:


Received: (at 76568) by debbugs.gnu.org; 26 Feb 2025 13:32:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 26 08:32:06 2025
Received: from localhost ([127.0.0.1]:51524 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tnHW9-0001GV-NL
	for submit <at> debbugs.gnu.org; Wed, 26 Feb 2025 08:32:06 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:43712)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tnHW8-0001Fy-4q
 for 76568 <at> debbugs.gnu.org; Wed, 26 Feb 2025 08:32:04 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1tnHVx-00028a-Ma; Wed, 26 Feb 2025 08:31:54 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=vn2jFeB6MbfwMCd9PblhgOR6SC/cBoQgnVRHFJbKJEY=; b=rZCTcNTlpB4E
 jkP9zUH/uagmM0VKqOQnFUtIE3L9lk/QL852m22LgqDnkigp+/X3IlvWybM2jSGMyOiDIzBnUjLYy
 yE1sWg6jiJkt6l9rId7Ku/xf0r9k7WYxG2GJJXY89N+Dlq0Uo4m6gfSybwt2Vxy6v4xjDPDsxpWzr
 oLNKMb+rI09Gdw6fTAhQRm8BuTzmD0cb2pnrZ26LiqdfiZj3E1MX8Ex1HwUHbCs17gXfqk2JFdTVV
 0fjAFF/JtPVsrDrbSvwmzoqTSz5Lv+qXvqPH+COCka0y+9ldC6SEbLJGTff1Q0/J43++hqI1pIsAS
 6EvTAXZJfRlcQiX6Yv7hHA==;
Date: Wed, 26 Feb 2025 15:31:52 +0200
Message-Id: <861pvkx25z.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ship Mints <shipmints@HIDDEN>, Philip Kaludercic <philipk@HIDDEN>
In-Reply-To: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 (message from Ship Mints on Tue, 25 Feb 2025 15:52:02 -0500)
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76568
Cc: 76568 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Ship Mints <shipmints@HIDDEN>
> Date: Tue, 25 Feb 2025 15:52:02 -0500
> 
> As part of my production upgrade to 30.1, and before I wrote a program to install my local ELPA tree from
> scratch, I tried to first curate my packages and change from MELPA to generally equivalent GNU ELPA or
> non-GNU ELPA archives.  The result was that I had two of each package installed.
> 
> I think there's a bug in 'package-install' which, when invoked from 'package-install-button-action', processes
> the new package spec, and incorrectly checks to see if the package is already installed.  Interactive
> invocation of 'package-install' yields the package name from the prompt, not its archive description.
> 
> If the below is correct, I can submit a patch to make 'package-install' behave like 'package-reinstall' for the
> non-interactive case.
> 
> (defun package-install (pkg &optional dont-select)
> ...
>     (if-let* ((transaction
>                (if (package-desc-p pkg)
> ;; Problem seems to be here.  If the new pkg desc is for a 
> ;; different archive directory name style, package-installed-p
> ;; fails as it checks to see if the new directory exists (which
> ;; does not), ignoring the old archive directory.
>                    (unless (package-installed-p pkg)
>                      (package-compute-transaction (list pkg)
>                                                   (package-desc-reqs pkg)))
> 
> In contrast, 'package-reinstall' does the right thing by first deleting the existing package before installing the
> new one.
> 
> (defun package-reinstall (pkg)
> ...
>   (package-delete
>    (if (package-desc-p pkg) pkg (cadr (assq pkg package-alist)))
>    'force 'nosave)
>   (package-install pkg 'dont-select))

Philip, any comments or suggestions?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76568; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Feb 2025 20:52:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 25 15:52:26 2025
Received: from localhost ([127.0.0.1]:48691 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tn1uj-0001L4-MO
	for submit <at> debbugs.gnu.org; Tue, 25 Feb 2025 15:52:26 -0500
Received: from lists.gnu.org ([2001:470:142::17]:42974)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1tn1uh-0001Kq-Ux
 for submit <at> debbugs.gnu.org; Tue, 25 Feb 2025 15:52:24 -0500
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 <shipmints@HIDDEN>)
 id 1tn1ub-000850-Kk
 for bug-gnu-emacs@HIDDEN; Tue, 25 Feb 2025 15:52:18 -0500
Received: from mail-ua1-x936.google.com ([2607:f8b0:4864:20::936])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shipmints@HIDDEN>)
 id 1tn1uZ-0003hb-Sp
 for bug-gnu-emacs@HIDDEN; Tue, 25 Feb 2025 15:52:17 -0500
Received: by mail-ua1-x936.google.com with SMTP id
 a1e0cc1a2514c-86b2cc5b3c4so57131241.3
 for <bug-gnu-emacs@HIDDEN>; Tue, 25 Feb 2025 12:52:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740516734; x=1741121534; darn=gnu.org;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=3BagMnZ1SFrt3AsAJTDbwOJFTMuAgBX3WGlaZ1vPOB0=;
 b=WxWpkC3p9kR7xcwXbJFern+BJXFjfB+7L0oBlabJwUlUAz9c0J6PTOIZUXEvpMPZQU
 4CM50C1REMY1Dignq98xQtur58Trp0khxNetVo3Mdi9/30hH08D2wGWopSFUrAmVFniE
 b9lV7L2ovj2oWe2EipR3OBLTKotumTobp5i2VHgSP67M4psWkkkU6802cFl0979wHRIZ
 D0jIQsGlp3Kij5KVjSNVl7xRa8T68jo6s6CWOVncY4ZjcVf9Z4aJe5zndFhQpfr/Hz8x
 qpFVD++AuW//0bkbuBuLpJRPUrM/LRMKi7T6/rFPf0aqFkJZapO7RU4dUc1b9lOOmUzS
 qNMQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740516734; x=1741121534;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=3BagMnZ1SFrt3AsAJTDbwOJFTMuAgBX3WGlaZ1vPOB0=;
 b=lt4XAwA3utYS+2QwTUq87dxBSwyJ4sgHbF5dAh/oVcpP2LLHoFnRrtXduSgCIMcs0S
 bv8xbDSjZEtXDjkM/oV5aQIlVuGpum766jpQPpZjtJ6N96bXirjhXVp37yeyTNWsObCw
 BruRqrOjB7zV11kH1HU+yvW2nmrXYQBjC9CE0owBVmFb7MpXMp5b5M7/V81b/5TpZ8fc
 ruw778UY90YrEQUkfDv6hPMqHTCw7WsgOq43EyEnU/d6O++tt9CiScvF98kNuhGRBvHE
 /cZaR/EzcDy1AJ+pY2nug5hrHA7A00b3X9vzNrRm13HDrpk0VQNfvPQIqEyG2o1dwaNO
 e9kg==
X-Gm-Message-State: AOJu0YyYAMTUM3P2ruw8r24C5g5S2uuFeUwV8bqFpMBFtkZG1+6KT7Rn
 l8RWrZojyty+QLXQfLEbjm1OqrfGpvmwr8vLstrVbGOOuQjw080xHj/JbJ6Rypa4c4fQn4M8526
 9+2V4KCS63zag7wMB8Bhx3HWy024/YmFi
X-Gm-Gg: ASbGncvjHgcOEyUPozxqQeg7Tc4+3Alqj4Yk/6qHfA1g4K4PWXOqVBR3ig5aC5OhruS
 IYuDb/Cd9fHim4gWXwlPjgBw4fZIA5iAR3BleocrsJwGxB44xsDIntl7/Z7Zs8KIXACzDTA9Q6i
 Jippg55pU=
X-Google-Smtp-Source: AGHT+IHUgOPGrLrW1JdoGcJbOGAk6RsW273UUSA0LnUbWRJXy1Dt8sN0HYwOBlVQHt2nlJrQdSb3R9kTlNT4su9s7yQ=
X-Received: by 2002:a05:6122:2528:b0:51b:b750:8303 with SMTP id
 71dfb90a1353d-5223cd6e736mr2695019e0c.11.1740516734024; Tue, 25 Feb 2025
 12:52:14 -0800 (PST)
MIME-Version: 1.0
From: Ship Mints <shipmints@HIDDEN>
Date: Tue, 25 Feb 2025 15:52:02 -0500
X-Gm-Features: AQ5f1JofZwIYLTHUmqw66JMvLFm138cFBOIF_gVNMW-g8Q9QClEvXorfFkYARww
Message-ID: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
Subject: 'package-install' should not install duplicate packages
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary="000000000000a84331062efda169"
Received-SPF: pass client-ip=2607:f8b0:4864:20::936;
 envelope-from=shipmints@HIDDEN; helo=mail-ua1-x936.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--000000000000a84331062efda169
Content-Type: text/plain; charset="UTF-8"

As part of my production upgrade to 30.1, and before I wrote a program to
install my local ELPA tree from scratch, I tried to first curate my
packages and change from MELPA to generally equivalent GNU ELPA or non-GNU
ELPA archives.  The result was that I had two of each package installed.

I think there's a bug in 'package-install' which, when invoked from
'package-install-button-action', processes the new package spec, and
incorrectly checks to see if the package is already installed.  Interactive
invocation of 'package-install' yields the package name from the prompt,
not its archive description.

If the below is correct, I can submit a patch to make 'package-install'
behave like 'package-reinstall' for the non-interactive case.

(defun package-install (pkg &optional dont-select)
...
    (if-let* ((transaction
               (if (package-desc-p pkg)
;; Problem seems to be here.  If the new pkg desc is for a
;; different archive directory name style, package-installed-p
;; fails as it checks to see if the new directory exists (which
;; does not), ignoring the old archive directory.
                   (unless (package-installed-p pkg)
                     (package-compute-transaction (list pkg)
                                                  (package-desc-reqs pkg)))

In contrast, 'package-reinstall' does the right thing by first deleting the
existing package before installing the new one.

(defun package-reinstall (pkg)
...
  (package-delete
   (if (package-desc-p pkg) pkg (cadr (assq pkg package-alist)))
   'force 'nosave)
  (package-install pkg 'dont-select))

-Stephane

--000000000000a84331062efda169
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e">As part of my production upgrade to 30.1, and before I wrote a program t=
o install my local ELPA tree from scratch, I tried to first curate my packa=
ges and change from MELPA to generally equivalent GNU ELPA or non-GNU ELPA =
archives.=C2=A0 The result was that I had two of each package installed.</d=
iv><div class=3D"gmail_default" style=3D"font-family:monospace"><br></div><=
div class=3D"gmail_default" style=3D"font-family:monospace">I think there&#=
39;s a bug in &#39;package-install&#39; which, when invoked from &#39;packa=
ge-install-button-action&#39;, processes the new package spec, and incorrec=
tly checks to see if the package is already installed.=C2=A0 Interactive in=
vocation=C2=A0of &#39;package-install&#39; yields the package name from the=
 prompt, not its archive description.</div><div class=3D"gmail_default" sty=
le=3D"font-family:monospace"><br></div><div class=3D"gmail_default" style=
=3D"font-family:monospace">If the below is correct, I can submit a patch to=
 make &#39;package-install&#39; behave like &#39;package-reinstall&#39; for=
 the non-interactive case.</div><div class=3D"gmail_default" style=3D"font-=
family:monospace"><br></div><div class=3D"gmail_default" style=3D"font-fami=
ly:monospace">(defun package-install (pkg &amp;optional dont-select)<br></d=
iv><div class=3D"gmail_default" style=3D"font-family:monospace">...</div><d=
iv class=3D"gmail_default" style=3D"font-family:monospace">=C2=A0 =C2=A0 (i=
f-let* ((transaction<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0(if (package-desc-p pkg)</div><div class=3D"gmail_default" style=3D"f=
ont-family:monospace">;;=C2=A0Problem seems to be here.=C2=A0 If the new pk=
g desc is for a=C2=A0</div><div class=3D"gmail_default" style=3D"font-famil=
y:monospace">;; different archive directory name style, package-installed-p=
</div><div class=3D"gmail_default" style=3D"font-family:monospace">;; fails=
 as it checks to see if the new directory exists (which</div><div class=3D"=
gmail_default" style=3D"font-family:monospace">;; does not), ignoring the o=
ld archive directory.<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0(unless (package-installed-p pkg)<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(package-compute=
-transaction (list pkg)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (package-desc-reqs pkg=
)))<br></div><div class=3D"gmail_default" style=3D"font-family:monospace"><=
br></div><div class=3D"gmail_default" style=3D""><span style=3D"font-family=
:monospace">In contrast, &#39;package-reinstall&#39; does the right thing b=
y first deleting the exi</span><font face=3D"monospace">sting package befor=
e installing the new one.</font></div><div class=3D"gmail_default" style=3D=
""><font face=3D"monospace"><br></font></div><font face=3D"monospace">(defu=
n package-reinstall (pkg)</font><div><div class=3D"gmail_default" style=3D"=
"><font face=3D"monospace">...</font></div><div class=3D"gmail_default" sty=
le=3D""><font face=3D"monospace">=C2=A0 (package-delete<br>=C2=A0 =C2=A0(if=
 (package-desc-p pkg) pkg (cadr (assq pkg package-alist)))<br>=C2=A0 =C2=A0=
&#39;force &#39;nosave)<br></font></div><div class=3D"gmail_default" style=
=3D""><font face=3D"monospace">=C2=A0 (package-install pkg &#39;dont-select=
))</font></div><div class=3D"gmail_default" style=3D"font-family:monospace"=
><br>-Stephane</div></div></div>

--000000000000a84331062efda169--




Acknowledgement sent to Ship Mints <shipmints@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#76568; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 5 Mar 2025 18:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.