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.

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


Received: (at 76568) by debbugs.gnu.org; 14 Jun 2025 22:40:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 14 18:40:11 2025
Received: from localhost ([127.0.0.1]:47058 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uQZXg-0006kA-IZ
	for submit <at> debbugs.gnu.org; Sat, 14 Jun 2025 18:40:10 -0400
Received: from mout01.posteo.de ([185.67.36.65]:34891)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <philipk@HIDDEN>)
 id 1uQZXd-0006iT-4J
 for 76568 <at> debbugs.gnu.org; Sat, 14 Jun 2025 18:40:03 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id C9D58240027
 for <76568 <at> debbugs.gnu.org>; Sun, 15 Jun 2025 00:39:54 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net;
 s=1984.ea087b; t=1749940794;
 bh=zAg9Sp07wkc1xuus/OcqooNtR+tBZKOmAesTViZjEoM=;
 h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version:
 Content-Type:Content-Transfer-Encoding:From;
 b=WBHY9m9zHCPgjIgiUDljHUyuP0g0nrYoz/72N1oxZx3xmiKrucrRqRT3cDZ5IntR0
 WlFyMCZfpAxpye5KHDrvBaF6XO4N69YztkjvBs0eWy5unDwGKBDoCq5c7MtT8KkVEF
 WPi1kGHplqrmlMW31T+5cLTgXtC8VTwvAUrt4GaTHNpFVdESiLC48kuEEWbN0bt7JM
 ckT/JxY6MHR+qLsBDpKs1ht7+SLI77ES1PPnyFj3iOv/fHjQG9vGIu/O125NP7427v
 KA6IMEn58h4xGtVbS5aocivq6Rwae81DEN2fKo2CfSBZ0tK2goT5Ft4+IuagsPPSsj
 0HVbSTkA9Q9VxfFvFtI0onYhwlfqvi8sGC8FTOEl4OgA582m1lodnLh+984dN3RMYb
 WWy/L7WqOu9nEzuieNPwQq0xcGuHXU/WQzQommol6rjoJspCqSoI8lxEgTeg/z5pDA
 jq08x1v6v2OcnTJdNdx+iYQY6nvkAIQKy3wieA131dwzBJ7t4U+
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4bKWRY6JLjz9rxB;
 Sun, 15 Jun 2025 00:39:53 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: =?utf-8?Q?St=C3=A9phane?= Marks <shipmints@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
In-Reply-To: <CAN+1Hbq0HqaJpbo0K0mdpTq1Jk2ztwCxjL9JOG=roo0JyPa8cA@HIDDEN>
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
 <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
 <CAN+1HbqUdBGz5WmTA8aa0Yf=rKEj8Zf=-604C+HmNVUSyJhyTw@HIDDEN>
 <CAN+1Hbo8+aF87-ogd8qJ5C+YXO6Hiww5OytmJDrrUyfp1H+JpA@HIDDEN>
 <CAN+1Hbo8XiRcgNZQB2bLadFrPJEujXD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6u6R2EScxtpKnWof
 z4oM
OpenPGP: id=philipk@HIDDEN;
 url="https://keys.openpgp.org/vks/v1/by-email/philipk@HIDDEN";
 preference=signencrypt
Date: Sat, 14 Jun 2025 22:39:53 +0000
Message-ID: <87o6uqdk1y.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76568
Cc: 76568 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, stefankangas@HIDDEN,
 Stefan Monnier <monnier@HIDDEN>
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 (---)

St=C3=A9phane Marks <shipmints@HIDDEN> writes:

> On Sat, Jun 7, 2025 at 11:23=E2=80=AFPM Philip Kaludercic <philipk@posteo=
.net>
> wrote:
>
>> Eli Zaretskii <eliz@HIDDEN> writes:
>>
>> > Ping!  Can we make further progress with this issue?
>>
>> Sorry, understanding this bug report still takes me forever...  Just
>> composing this message took me an hour.  I have added Stefan to the CCs
>> to get some more input.
>>
>> >> From: Ship Mints <shipmints@HIDDEN>
>> >> Date: Sun, 25 May 2025 11:08:20 -0400
>> >> Cc: 76568 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
>> >>      Stefan Kangas <stefankangas@HIDDEN>
>> >>
>> >> On Sun, May 25, 2025 at 11:01=E2=80=AFAM Philip Kaludercic <philipk@p=
osteo.net>
>> wrote:
>> >>
>> >>  Ship Mints <shipmints@HIDDEN> writes:
>> >>
>> >>  [...]
>> >>
>> >>  >> Can you please summarise the relevant parts of this discussion?  I
>> see
>> >>  >> that a patch is being mentioned above, should I review it?
>> >>  >>
>> >>  >
>> >>  > The latest version of this patch from this discussion is attached.
>> It
>> >>  > amends both the menu-driven package upgrade and the package-upgrade
>> command
>> >>  > to assist the user with avoiding (or permitting) installing a
>> package more
>> >>  > than once.
>> >>  >
>> >>
>> >>  [...]
>> >>
>> >>  >
>> >>  > -Stephane
>> >>  > From 9deee448e27f94c21469e59677fde2cbce8f9bcd Mon Sep 17 00:00:00
>> 2001
>> >>  > From: shipmints <shipmints@HIDDEN>
>> >>  > Date: Wed, 5 Mar 2025 11:33:07 -0500
>> >>  > Subject: [PATCH] Correct 'package-install' to detect installed
>> packages
>> >>  >  (bug#76568)
>> >>  >
>> >>  > * lisp/emacs-lisp/package.el
>> >>  > (package-install): Check for already installed package using its
>> symbol
>> >>  > rather than rely on differing archive directory structures.  Return
>> t if
>>              ^
>>              Why are you mentioning this here?
>>
>
> That's the root source of duplicate package installations--packages that
> exist in multiple archives.  Expanding the language to be more expansive =
is
> useful and as we move ahead with this, I'll update the text.

My point why are you documenting a fix that you are not implementing in
this patch?

>>>  > installed, nil otherwise.
>> >>  > (package-install-button-action): 'describe-package' only when
>> >>  > 'package-install' actually installed the package.  Prompt the user=
 to
>> >>  > install or upgrade an already installed package.
>> >>  > * test/lisp/emacs-lisp/package-tests.el
>> (package-test-install-single):
>> >>  > Add already-installed test using 'package-install' with a
>> >>  > 'package-desc'.
>> >>  > ---
>> >>  >  lisp/emacs-lisp/package.el            | 54
>> +++++++++++++++++++++------
>> >>  >  test/lisp/emacs-lisp/package-tests.el |  4 ++
>> >>  >  2 files changed, 47 insertions(+), 11 deletions(-)
>> >>  >
>> >>  > diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.=
el
>> >>  > index 8d498c216dc..7c7e99168aa 100644
>> >>  > --- a/lisp/emacs-lisp/package.el
>> >>  > +++ b/lisp/emacs-lisp/package.el
>> >>  > @@ -2194,7 +2194,7 @@ package-install-upgrade-built-in
>> >>  >    :version "29.1")
>> >>  >
>> >>  >  ;;;###autoload
>> >>  > -(defun package-install (pkg &optional dont-select)
>> >>  > +(defun package-install (pkg &optional dont-select
>> allow-mult-or-reinstall)
>> >>  >    "Install the package PKG.
>> >>  >
>> >>  >  PKG can be a `package-desc', or a symbol naming one of the availa=
ble
>> >>  > @@ -2207,8 +2207,13 @@ package-install
>> >>  >  non-nil, install the package but do not add it to
>> >>  >  `package-selected-packages'.
>> >>  >
>> >>  > -If PKG is a `package-desc' and it is already installed, don't try
>> >>  > -to install it but still mark it as selected.
>> >>  > +When called from Lisp and optional argument ALLOW-MULT-OR-REINSTA=
LL
>> is
>> >>  > +non-nil, install the package even if it is already installed from
>> >>  > +another source, allowing more than one simultaneous version.
>> >>  > +
>> >>  > +If PKG is a `package-desc' and it is already installed, and
>> >>  > +ALLOW-MULT-OR-REINSTALL is nil, don't try to install it but still
>> mark
>> >>  > +it as selected.
>> >>
>> >>  Why is this yet another optional argument, instead of a user option?
>> >>
>> >> As the maintainer, you pick what suits your taste.
>>
>> No, what I meant is if there is a reason that we should sometimes allow
>> installing multiple versions of a package in some cases and not in
>> others?  Is that a genuine use-case, or do you (as the person
>> experiencing the issue you are trying to solve) assume that most people
>> with the same problem would be OK with setting this once via a
>> user-option.  I am under the impression that that would simplify the
>> change.
>>
>
> I figured there's someone out there that depends on this for some reason
> and Emacs tries to provide backward compatibility.  I prefer the simpler
> route, if agreed.
>
> (Also, if we go with the optional argument, please rename it to
>> something cleaner like "allow-multiple".  Perhaps it is just me, but an
>> "-or-" in a argument name bugs me.)
>>
>
> Sure.

Thanks.

>>>  >  If the command is invoked with a prefix argument, it will allow
>> >>  >  upgrading of built-in packages, as if
>> `package-install-upgrade-built-in'
>> >>  > @@ -2243,16 +2248,22 @@ package-install
>> >>  >                 (package--active-built-in-p pkg))
>> >>  >        (setq pkg (or (cadr (assq name package-archive-contents))
>> pkg)))
>> >>  >      (if-let* ((transaction
>> >>  > +               ;; Test for already installed using the pkg symbol,
>> not
>> >>  > +               ;; the archive-specific directory structure.
>> >>  >                 (if (package-desc-p pkg)
>> >>  > -                   (unless (package-installed-p pkg)
>> >>  > +                   (unless (and (not allow-mult-or-reinstall)
>> >>  > +                                (package-installed-p
>> (package-desc-name pkg)))
>> >>  >                       (package-compute-transaction (list pkg)
>> >>  >
>> (package-desc-reqs pkg)))
>> >>  > -                 (package-compute-transaction () (list (list
>> pkg))))))
>> >>  > +                 (unless (and (not allow-mult-or-reinstall)
>> >>  > +                              (package-installed-p pkg))
>> >>  > +                   (package-compute-transaction () (list (list
>> pkg)))))))
>> >>  >          (progn
>> >>  >            (package-download-transaction transaction)
>> >>  >            (package--quickstart-maybe-refresh)
>> >>  >            (message  "Package `%s' installed." name))
>> >>  > -      (message "`%s' is already installed" name))))
>> >>  > +      (message "`%s' is already installed" name)
>> >>  > +      nil)))
>>
>> This last change appears to be unrelated to the remaining patch?
>>
>
> Last meaning the message, or last meaning the whole of the above?

I meant the addition of returning `nil'.  But I have since understood
that you needed to add this for the test to work.

>>>  >  (declare-function package-vc-upgrade "package-vc" (pkg))
>> >>  >
>> >>  > @@ -2587,7 +2598,7 @@ package-reinstall
>> >>  >    (package-delete
>> >>  >     (if (package-desc-p pkg) pkg (cadr (assq pkg package-alist)))
>> >>  >     'force 'nosave)
>> >>  > -  (package-install pkg 'dont-select))
>> >>  > +  (package-install pkg 'dont-select 'allow-mult-or-reinstall))
>> >>  >
>> >>  >  ;;;###autoload
>> >>  >  (defun package-recompile (pkg)
>> >>  > @@ -3051,10 +3062,31 @@ package-install-button-action
>>
>> (OK, one of the things that had me confused is that I misread the diff
>> and assumed you were patching `package-recompile' ^^)
>>
>> >>  >  Used for the `action' property of buttons in the buffer created by
>> >>  >  `describe-package'."
>> >>  >    (let ((pkg-desc (button-get button 'package-desc)))
>> >>  > -    (when (y-or-n-p (format-message "Install package `%s'? "
>> >>  > -                                    (package-desc-full-name
>> pkg-desc)))
>> >>  > -      (package-install pkg-desc nil)
>> >>  > -      (describe-package (package-desc-name pkg-desc)))))
>> >>  > +    (if (package-installed-p (package-desc-name pkg-desc))
>> >>  > +        (let ((installed-pkg-desc (cadr (assq
>> >>  > +                                         (package-desc-name
>> pkg-desc)
>> >>  > +                                         package-alist))))
>> >>  > +          (pcase (let ((read-answer-short t))
>>
>> I don't think you should shadow the user's preference here.
>>
>
> I need more coffee.  Not following.

I don't think you should bind `read-answer-short'.  If the user prefers
to input short answers, they would adjust the user option.  Otherwise,
I think it is more consistent to stick to the defaults.

>>>  > +                   (read-answer
>> >>  > +                    (format-message
>> >>  > +                     "Replace `%s' with `%s', or Install both
>> (advanced users) "
>>
>> Without some additional explanation here, I would assume that this
>> prompt could confuse users.  If we go with this approach, can you look
>> into describing why the user would be interested in either replacing or
>> keeping both versions of a package somewhere?
>>
>
> If we decide to disallow multiple side-by-side installs, this becomes moo=
t.

No, I don't think we should do that for backwards compatibility reasons,
but it might be worthwhile considering it as something to deprecate at
some point...

> Also, why not move this prompt into `package-install', that the user
>> would get presented with if they invoke the command interactively?
>>
>
> I'd have to reread this from scratch to see as I can't recall.

OK, I can take a closer look at the code as well and see if things can
be adjusted before pushing to master.

>>>  > +                     (package-desc-full-name installed-pkg-desc)
>> >>  > +                     (package-desc-full-name pkg-desc))
>> >>  > +                    '(("replace" ?r "Replace existing")
>> >>  > +                      ("install" ?i "Install both")
>> >>  > +                      ("help" ?h "Help")
>> >>  > +                      ("quit" ?q "Quit to abort"))))
>> >>  > +            ("replace"
>> >>  > +             (package-delete installed-pkg-desc 'force
>> 'dont-unselect)
>> >>  > +             (when (package-install pkg-desc nil)
>> >>  > +               (describe-package (package-desc-name pkg-desc))))
>> >>  > +            ("install"
>> >>  > +             (when (package-install pkg-desc nil
>> 'allow-mult-or-reinstall)
>> >>  > +               (describe-package (package-desc-name pkg-desc))))))
>>
>> I think it would be good to add a message confirming that the "quit"
>> operation.
>>
>
> Alright.
>
>
>> >>  > +      (when (y-or-n-p (format-message "Install package `%s'? "
>> >>  > +                                      (package-desc-full-name
>> pkg-desc)))
>> >>  > +        (when (package-install pkg-desc nil)
>> >>  > +          (describe-package (package-desc-name pkg-desc)))))))
>> >>  >
>> >>  >  (defun package-delete-button-action (button)
>> >>  >    "Run `package-delete' on the package BUTTON points to.
>> >>  > diff --git a/test/lisp/emacs-lisp/package-tests.el
>> b/test/lisp/emacs-lisp/package-tests.el
>> >>  > index d8e260319bd..36617ed6f6e 100644
>> >>  > --- a/test/lisp/emacs-lisp/package-tests.el
>> >>  > +++ b/test/lisp/emacs-lisp/package-tests.el
>> >>  > @@ -248,6 +248,10 @@ package-test-install-single
>> >>  >        (should (string-match "^[`=E2=80=98']simple-single[=E2=80=
=99'] is already
>> installed\n?\\'"
>> >>  >                              (buffer-string))))
>> >>  >      (should (package-installed-p 'simple-single))
>> >>  > +    ;; Test for `package-install' already installed using a
>> >>  > +    ;; package-desc.  `package-install' returns nil if already
>> >>  > +    ;; installed.
>> >>  > +    (should-not (package-install simple-single-desc))
>> >>  >      (let* ((simple-pkg-dir (file-name-as-directory
>> >>  >                              (expand-file-name
>> >>  >                               "simple-single-1.3"
>> >>
>> >>  For some reason I find this patch very difficult to follow...  Perha=
ps
>> I
>> >>  don't understand the issue you are trying to fix, or how it is relat=
ed
>> >>  to your patch.
>> >>
>> >> The issue is that package install will install multiple versions of t=
he
>> same package (from the same archive)
>> >> without warning.  This will and does confuse users especially using t=
he
>> interactive package menu.  The
>> >> patch works for me.
>>
>> Thanks for the explanation!  I would rephrase the commit message to
>> express the
>>
>>         "Warn user when installing multiple versions of the same
>>         package"
>>
>> part more prominently.
>>
>
> Okay.
>
>>> The related issue is that multiple versions of the same packages that
>> come from different archives are also
>> >> installed but this patch does not attempt to deal with that.  I
>> proposed that we segregate archives under the
>> >> package tree to ease the package infrastructure's ability to detect
>> that.
>>
>> That is a different issue, one that I would like to solve ideally by
>> convincing package maintainers not to have their packages on multiple
>> archives, but that is not an issue we can solve here.
>>
>
> I suppose the "convenience" of MELPA's publish on most recent commit is
> attractive to some.
>
> Doesn't this still bite us if people use both ELPA devel and ELPA
> production since they're treated as different archives?  Perhaps we can
> unify duplicate package detection at least in the core Emacs archives.

That is true, though I am also of the opinion that end-users ought not
to use ELPA-devel directly.  In that case, we can at least rely on
sensible version number handling.

> -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; 13 Jun 2025 06:39:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 13 02:39:42 2025
Received: from localhost ([127.0.0.1]:37507 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uPy4d-0007Tn-SL
	for submit <at> debbugs.gnu.org; Fri, 13 Jun 2025 02:39:42 -0400
Received: from mail-vs1-xe33.google.com ([2607:f8b0:4864:20::e33]:53745)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1uPy4X-0007Rn-9D
 for 76568 <at> debbugs.gnu.org; Fri, 13 Jun 2025 02:39:33 -0400
Received: by mail-vs1-xe33.google.com with SMTP id
 ada2fe7eead31-4e7b9cbd19dso456839137.3
 for <76568 <at> debbugs.gnu.org>; Thu, 12 Jun 2025 23:39:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1749796763; x=1750401563; 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=veNZqc600FsvQCAelBGlOs1gE/kNugS/lieNpRKD4+4=;
 b=m4pxE+Vuu/wAGUIEt6tNCNyTD4r9x+tCBCM5iVKKyUvlhUw2jeeRPxxHB0MF/ByA5N
 /B9Id1B3/lbZjru/4HgeY7mDxFT/ZynmF4wfgMXo7CD7nBfZEaimlLaZhh9xOmaR05vX
 n+/BuzfOuSV4wJ6KJ9LA+XJ0P924uaaEUXQFGkJoWpL9z6kfwqjNDu46RLyqwQmlmtHE
 lwEqwYSD2H7EXE3rcsCKtIoWLt63/IccjY7MPBqfjwKiNDY89QFxXCoi5m3feSd0meGQ
 txb8w6c+WIFhj3kAJYEDkDr6THCwQgBxWyV9HTY9KOWXRLVgCzHvZZlXpPp94LSDTDcd
 V2ug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1749796763; x=1750401563;
 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=veNZqc600FsvQCAelBGlOs1gE/kNugS/lieNpRKD4+4=;
 b=PKEOU3SweDzz390RuD5Xavj8FjwOXt/4hgyKCDLXOthM/K7e85MASnlvUtnSL4r9tC
 5oK+FIS1/1twWscZAskELduBqbmL13phhtJAEEHh4+FRGb71JzXEdwNFCiNniMeBAh4Y
 u5H6/a8PBjVLU5L69Fmku5Vf4SDMZlwv819bX6khQ1h4gtEnQJiWyYmW9rSogWpWFJWw
 vaIX4ht8bfwJ0ct6dKj+yzvfl6hKa1xoCsSwYnCgnS4BhSWzWf5ULwJ7aak+Bvqx9jjY
 TvIhQbmDOhz5+hakPK5Gx3LE00AHWx5Kkx48DwW4MFwXNvHOzuph+E+QWLPIxPRoPYDC
 WZBg==
X-Forwarded-Encrypted: i=1;
 AJvYcCWL9as62fYDEURPwoLjIEEXYur3v82A0+uXXq/WCqn88nxGoKbTD9sXs4KDdp7s27K2PI9S6Q==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YyO0tdFlKVQ2GsQlymt/v6J/D5YZZ/27Ajs0c2dFs9Yuzz6QEN4
 Rd7+uOowekrkV8maG1YjWEMLbBKs2xqQcgfnIZPj0rYg+VuupEbCWnOT9cFJ4T9ZCchwnPxUm+h
 pXOLnCs5wsSvbdqF3eB8GI98zIB1u37E=
X-Gm-Gg: ASbGncuKhWDNUao7wzV0cjB9xwtK95WgkKyoHgi821S0MdTDwPC8/QDkGIoN/kqqMxj
 PnYiQlFKZ9LrQWeneFy+mRZz2W2SmmGsizaI0Wp6sd+pvrPrPH9luWj9sADhkGlvCwunEA7dpdk
 KSL2jhdHlBABTyCAs0duUj9TMJDP8aSi/hY+jxOMFdselDpL8JHHJ7vV0VDUWSlwpM5kcx+W5pO
 g==
X-Google-Smtp-Source: AGHT+IHl1QaRp4E0i6hs8Zqm6iqr1SZbKqOqfMVGdVQZduXQatmxcYQYsEI7n8DyXARWhNw4ZJrq2u5serAoxrwClZ0=
X-Received: by 2002:a05:6102:5786:b0:4e6:d911:dd89 with SMTP id
 ada2fe7eead31-4e7e3c6f50fmr1115106137.21.1749796763071; Thu, 12 Jun 2025
 23:39:23 -0700 (PDT)
MIME-Version: 1.0
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
 <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
 <CAN+1HbqUdBGz5WmTA8aa0Yf=rKEj8Zf=-604C+HmNVUSyJhyTw@HIDDEN>
 <CAN+1Hbo8+aF87-ogd8qJ5C+YXO6Hiww5OytmJDrrUyfp1H+JpA@HIDDEN>
 <CAN+1Hbo8XiRcgNZQB2bLadFrPJEujXDZJdv5Fuj9jEs6goTMzw@HIDDEN>
 <CAN+1HbpYF8+GKJTESnvsi2k-v1fHQykEFoRJx7kzUP3oVL4BVQ@HIDDEN>
 <CAN+1Hbox9VFa=__SZS3Mb8GMuoUVQNtw993yAHVnFRTLre1MOA@HIDDEN>
 <87h61kd0tv.fsf@HIDDEN>
 <CAN+1Hboh1pJpFzk41dMEfXjYXnUjX7fC8MsNLmNf=Mf5c-5S9A@HIDDEN>
 <87y0uklony.fsf@HIDDEN>
 <CAN+1Hbq09yuqh9y99p9G_BDVKBW2zRNEsUmMoHwPz6aC1yUXDw@HIDDEN>
 <861prwj6dz.fsf@HIDDEN> <87msajdz5s.fsf@HIDDEN>
In-Reply-To: <87msajdz5s.fsf@HIDDEN>
From: =?UTF-8?Q?St=C3=A9phane_Marks?= <shipmints@HIDDEN>
Date: Fri, 13 Jun 2025 08:39:11 +0200
X-Gm-Features: AX0GCFuSIw1AWb7c6h4V4dIDomqebrZk-ZTG0wDzyM2k7aa2fht6tRTPtjGv2V0
Message-ID: <CAN+1Hbq0HqaJpbo0K0mdpTq1Jk2ztwCxjL9JOG=roo0JyPa8cA@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
To: Philip Kaludercic <philipk@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000007df9c706376e4eed"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76568
Cc: 76568 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, stefankangas@HIDDEN,
 Stefan Monnier <monnier@HIDDEN>
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 (-)

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

On Sat, Jun 7, 2025 at 11:23=E2=80=AFPM Philip Kaludercic <philipk@HIDDEN=
et>
wrote:

> Eli Zaretskii <eliz@HIDDEN> writes:
>
> > Ping!  Can we make further progress with this issue?
>
> Sorry, understanding this bug report still takes me forever...  Just
> composing this message took me an hour.  I have added Stefan to the CCs
> to get some more input.
>
> >> From: Ship Mints <shipmints@HIDDEN>
> >> Date: Sun, 25 May 2025 11:08:20 -0400
> >> Cc: 76568 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
> >>      Stefan Kangas <stefankangas@HIDDEN>
> >>
> >> On Sun, May 25, 2025 at 11:01=E2=80=AFAM Philip Kaludercic <philipk@po=
steo.net>
> wrote:
> >>
> >>  Ship Mints <shipmints@HIDDEN> writes:
> >>
> >>  [...]
> >>
> >>  >> Can you please summarise the relevant parts of this discussion?  I
> see
> >>  >> that a patch is being mentioned above, should I review it?
> >>  >>
> >>  >
> >>  > The latest version of this patch from this discussion is attached.
> It
> >>  > amends both the menu-driven package upgrade and the package-upgrade
> command
> >>  > to assist the user with avoiding (or permitting) installing a
> package more
> >>  > than once.
> >>  >
> >>
> >>  [...]
> >>
> >>  >
> >>  > -Stephane
> >>  > From 9deee448e27f94c21469e59677fde2cbce8f9bcd Mon Sep 17 00:00:00
> 2001
> >>  > From: shipmints <shipmints@HIDDEN>
> >>  > Date: Wed, 5 Mar 2025 11:33:07 -0500
> >>  > Subject: [PATCH] Correct 'package-install' to detect installed
> packages
> >>  >  (bug#76568)
> >>  >
> >>  > * lisp/emacs-lisp/package.el
> >>  > (package-install): Check for already installed package using its
> symbol
> >>  > rather than rely on differing archive directory structures.  Return
> t if
>              ^
>              Why are you mentioning this here?
>

That's the root source of duplicate package installations--packages that
exist in multiple archives.  Expanding the language to be more expansive is
useful and as we move ahead with this, I'll update the text.

>>  > installed, nil otherwise.
> >>  > (package-install-button-action): 'describe-package' only when
> >>  > 'package-install' actually installed the package.  Prompt the user =
to
> >>  > install or upgrade an already installed package.
> >>  > * test/lisp/emacs-lisp/package-tests.el
> (package-test-install-single):
> >>  > Add already-installed test using 'package-install' with a
> >>  > 'package-desc'.
> >>  > ---
> >>  >  lisp/emacs-lisp/package.el            | 54
> +++++++++++++++++++++------
> >>  >  test/lisp/emacs-lisp/package-tests.el |  4 ++
> >>  >  2 files changed, 47 insertions(+), 11 deletions(-)
> >>  >
> >>  > diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.e=
l
> >>  > index 8d498c216dc..7c7e99168aa 100644
> >>  > --- a/lisp/emacs-lisp/package.el
> >>  > +++ b/lisp/emacs-lisp/package.el
> >>  > @@ -2194,7 +2194,7 @@ package-install-upgrade-built-in
> >>  >    :version "29.1")
> >>  >
> >>  >  ;;;###autoload
> >>  > -(defun package-install (pkg &optional dont-select)
> >>  > +(defun package-install (pkg &optional dont-select
> allow-mult-or-reinstall)
> >>  >    "Install the package PKG.
> >>  >
> >>  >  PKG can be a `package-desc', or a symbol naming one of the availab=
le
> >>  > @@ -2207,8 +2207,13 @@ package-install
> >>  >  non-nil, install the package but do not add it to
> >>  >  `package-selected-packages'.
> >>  >
> >>  > -If PKG is a `package-desc' and it is already installed, don't try
> >>  > -to install it but still mark it as selected.
> >>  > +When called from Lisp and optional argument ALLOW-MULT-OR-REINSTAL=
L
> is
> >>  > +non-nil, install the package even if it is already installed from
> >>  > +another source, allowing more than one simultaneous version.
> >>  > +
> >>  > +If PKG is a `package-desc' and it is already installed, and
> >>  > +ALLOW-MULT-OR-REINSTALL is nil, don't try to install it but still
> mark
> >>  > +it as selected.
> >>
> >>  Why is this yet another optional argument, instead of a user option?
> >>
> >> As the maintainer, you pick what suits your taste.
>
> No, what I meant is if there is a reason that we should sometimes allow
> installing multiple versions of a package in some cases and not in
> others?  Is that a genuine use-case, or do you (as the person
> experiencing the issue you are trying to solve) assume that most people
> with the same problem would be OK with setting this once via a
> user-option.  I am under the impression that that would simplify the
> change.
>

I figured there's someone out there that depends on this for some reason
and Emacs tries to provide backward compatibility.  I prefer the simpler
route, if agreed.

(Also, if we go with the optional argument, please rename it to
> something cleaner like "allow-multiple".  Perhaps it is just me, but an
> "-or-" in a argument name bugs me.)
>

Sure.

>>  >  If the command is invoked with a prefix argument, it will allow
> >>  >  upgrading of built-in packages, as if
> `package-install-upgrade-built-in'
> >>  > @@ -2243,16 +2248,22 @@ package-install
> >>  >                 (package--active-built-in-p pkg))
> >>  >        (setq pkg (or (cadr (assq name package-archive-contents))
> pkg)))
> >>  >      (if-let* ((transaction
> >>  > +               ;; Test for already installed using the pkg symbol,
> not
> >>  > +               ;; the archive-specific directory structure.
> >>  >                 (if (package-desc-p pkg)
> >>  > -                   (unless (package-installed-p pkg)
> >>  > +                   (unless (and (not allow-mult-or-reinstall)
> >>  > +                                (package-installed-p
> (package-desc-name pkg)))
> >>  >                       (package-compute-transaction (list pkg)
> >>  >
> (package-desc-reqs pkg)))
> >>  > -                 (package-compute-transaction () (list (list
> pkg))))))
> >>  > +                 (unless (and (not allow-mult-or-reinstall)
> >>  > +                              (package-installed-p pkg))
> >>  > +                   (package-compute-transaction () (list (list
> pkg)))))))
> >>  >          (progn
> >>  >            (package-download-transaction transaction)
> >>  >            (package--quickstart-maybe-refresh)
> >>  >            (message  "Package `%s' installed." name))
> >>  > -      (message "`%s' is already installed" name))))
> >>  > +      (message "`%s' is already installed" name)
> >>  > +      nil)))
>
> This last change appears to be unrelated to the remaining patch?
>

Last meaning the message, or last meaning the whole of the above?

>>  >  (declare-function package-vc-upgrade "package-vc" (pkg))
> >>  >
> >>  > @@ -2587,7 +2598,7 @@ package-reinstall
> >>  >    (package-delete
> >>  >     (if (package-desc-p pkg) pkg (cadr (assq pkg package-alist)))
> >>  >     'force 'nosave)
> >>  > -  (package-install pkg 'dont-select))
> >>  > +  (package-install pkg 'dont-select 'allow-mult-or-reinstall))
> >>  >
> >>  >  ;;;###autoload
> >>  >  (defun package-recompile (pkg)
> >>  > @@ -3051,10 +3062,31 @@ package-install-button-action
>
> (OK, one of the things that had me confused is that I misread the diff
> and assumed you were patching `package-recompile' ^^)
>
> >>  >  Used for the `action' property of buttons in the buffer created by
> >>  >  `describe-package'."
> >>  >    (let ((pkg-desc (button-get button 'package-desc)))
> >>  > -    (when (y-or-n-p (format-message "Install package `%s'? "
> >>  > -                                    (package-desc-full-name
> pkg-desc)))
> >>  > -      (package-install pkg-desc nil)
> >>  > -      (describe-package (package-desc-name pkg-desc)))))
> >>  > +    (if (package-installed-p (package-desc-name pkg-desc))
> >>  > +        (let ((installed-pkg-desc (cadr (assq
> >>  > +                                         (package-desc-name
> pkg-desc)
> >>  > +                                         package-alist))))
> >>  > +          (pcase (let ((read-answer-short t))
>
> I don't think you should shadow the user's preference here.
>

I need more coffee.  Not following.

>>  > +                   (read-answer
> >>  > +                    (format-message
> >>  > +                     "Replace `%s' with `%s', or Install both
> (advanced users) "
>
> Without some additional explanation here, I would assume that this
> prompt could confuse users.  If we go with this approach, can you look
> into describing why the user would be interested in either replacing or
> keeping both versions of a package somewhere?
>

If we decide to disallow multiple side-by-side installs, this becomes moot.

Also, why not move this prompt into `package-install', that the user
> would get presented with if they invoke the command interactively?
>

I'd have to reread this from scratch to see as I can't recall.

>>  > +                     (package-desc-full-name installed-pkg-desc)
> >>  > +                     (package-desc-full-name pkg-desc))
> >>  > +                    '(("replace" ?r "Replace existing")
> >>  > +                      ("install" ?i "Install both")
> >>  > +                      ("help" ?h "Help")
> >>  > +                      ("quit" ?q "Quit to abort"))))
> >>  > +            ("replace"
> >>  > +             (package-delete installed-pkg-desc 'force
> 'dont-unselect)
> >>  > +             (when (package-install pkg-desc nil)
> >>  > +               (describe-package (package-desc-name pkg-desc))))
> >>  > +            ("install"
> >>  > +             (when (package-install pkg-desc nil
> 'allow-mult-or-reinstall)
> >>  > +               (describe-package (package-desc-name pkg-desc))))))
>
> I think it would be good to add a message confirming that the "quit"
> operation.
>

Alright.


> >>  > +      (when (y-or-n-p (format-message "Install package `%s'? "
> >>  > +                                      (package-desc-full-name
> pkg-desc)))
> >>  > +        (when (package-install pkg-desc nil)
> >>  > +          (describe-package (package-desc-name pkg-desc)))))))
> >>  >
> >>  >  (defun package-delete-button-action (button)
> >>  >    "Run `package-delete' on the package BUTTON points to.
> >>  > diff --git a/test/lisp/emacs-lisp/package-tests.el
> b/test/lisp/emacs-lisp/package-tests.el
> >>  > index d8e260319bd..36617ed6f6e 100644
> >>  > --- a/test/lisp/emacs-lisp/package-tests.el
> >>  > +++ b/test/lisp/emacs-lisp/package-tests.el
> >>  > @@ -248,6 +248,10 @@ package-test-install-single
> >>  >        (should (string-match "^[`=E2=80=98']simple-single[=E2=80=99=
'] is already
> installed\n?\\'"
> >>  >                              (buffer-string))))
> >>  >      (should (package-installed-p 'simple-single))
> >>  > +    ;; Test for `package-install' already installed using a
> >>  > +    ;; package-desc.  `package-install' returns nil if already
> >>  > +    ;; installed.
> >>  > +    (should-not (package-install simple-single-desc))
> >>  >      (let* ((simple-pkg-dir (file-name-as-directory
> >>  >                              (expand-file-name
> >>  >                               "simple-single-1.3"
> >>
> >>  For some reason I find this patch very difficult to follow...  Perhap=
s
> I
> >>  don't understand the issue you are trying to fix, or how it is relate=
d
> >>  to your patch.
> >>
> >> The issue is that package install will install multiple versions of th=
e
> same package (from the same archive)
> >> without warning.  This will and does confuse users especially using th=
e
> interactive package menu.  The
> >> patch works for me.
>
> Thanks for the explanation!  I would rephrase the commit message to
> express the
>
>         "Warn user when installing multiple versions of the same
>         package"
>
> part more prominently.
>

Okay.

>> The related issue is that multiple versions of the same packages that
> come from different archives are also
> >> installed but this patch does not attempt to deal with that.  I
> proposed that we segregate archives under the
> >> package tree to ease the package infrastructure's ability to detect
> that.
>
> That is a different issue, one that I would like to solve ideally by
> convincing package maintainers not to have their packages on multiple
> archives, but that is not an issue we can solve here.
>

I suppose the "convenience" of MELPA's publish on most recent commit is
attractive to some.

Doesn't this still bite us if people use both ELPA devel and ELPA
production since they're treated as different archives?  Perhaps we can
unify duplicate package detection at least in the core Emacs archives.

-Stephane

--0000000000007df9c706376e4eed
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 Sat, Jun 7, 2025 at 11:23=E2=80=AFPM Philip Kaludercic &lt;<a href=3D"ma=
ilto:philipk@HIDDEN">philipk@HIDDEN</a>&gt; wrote:</span></div></di=
v><div class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gma=
il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,2=
04,204);padding-left:1ex">Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN"=
 target=3D"_blank">eliz@HIDDEN</a>&gt; writes:<br>
<br>
&gt; Ping!=C2=A0 Can we make further progress with this issue?<br>
<br>
Sorry, understanding this bug report still takes me forever...=C2=A0 Just<b=
r>
composing this message took me an hour.=C2=A0 I have added Stefan to the CC=
s<br>
to get some more input.<br>
<br>
&gt;&gt; From: Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN" target=
=3D"_blank">shipmints@HIDDEN</a>&gt;<br>
&gt;&gt; Date: Sun, 25 May 2025 11:08:20 -0400<br>
&gt;&gt; Cc: <a href=3D"mailto:76568 <at> debbugs.gnu.org" target=3D"_blank">765=
68 <at> debbugs.gnu.org</a>, Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN" t=
arget=3D"_blank">eliz@HIDDEN</a>&gt;, <br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 Stefan Kangas &lt;<a href=3D"mailto:stefankang=
as@HIDDEN" target=3D"_blank">stefankangas@HIDDEN</a>&gt;<br>
&gt;&gt; <br>
&gt;&gt; On Sun, May 25, 2025 at 11:01=E2=80=AFAM Philip Kaludercic &lt;<a =
href=3D"mailto:philipk@HIDDEN" target=3D"_blank">philipk@HIDDEN</a>=
&gt; wrote:<br>
&gt;&gt; <br>
&gt;&gt;=C2=A0 Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN" target=
=3D"_blank">shipmints@HIDDEN</a>&gt; writes:<br>
&gt;&gt; <br>
&gt;&gt;=C2=A0 [...]<br>
&gt;&gt; <br>
&gt;&gt;=C2=A0 &gt;&gt; Can you please summarise the relevant parts of this=
 discussion?=C2=A0 I see<br>
&gt;&gt;=C2=A0 &gt;&gt; that a patch is being mentioned above, should I rev=
iew it?<br>
&gt;&gt;=C2=A0 &gt;&gt;<br>
&gt;&gt;=C2=A0 &gt;<br>
&gt;&gt;=C2=A0 &gt; The latest version of this patch from this discussion i=
s attached.=C2=A0 It<br>
&gt;&gt;=C2=A0 &gt; amends both the menu-driven package upgrade and the pac=
kage-upgrade command<br>
&gt;&gt;=C2=A0 &gt; to assist the user with avoiding (or permitting) instal=
ling a package more<br>
&gt;&gt;=C2=A0 &gt; than once.<br>
&gt;&gt;=C2=A0 &gt;<br>
&gt;&gt; <br>
&gt;&gt;=C2=A0 [...]<br>
&gt;&gt; <br>
&gt;&gt;=C2=A0 &gt;<br>
&gt;&gt;=C2=A0 &gt; -Stephane<br>
&gt;&gt;=C2=A0 &gt; From 9deee448e27f94c21469e59677fde2cbce8f9bcd Mon Sep 1=
7 00:00:00 2001<br>
&gt;&gt;=C2=A0 &gt; From: shipmints &lt;<a href=3D"mailto:shipmints@HIDDEN=
om" target=3D"_blank">shipmints@HIDDEN</a>&gt;<br>
&gt;&gt;=C2=A0 &gt; Date: Wed, 5 Mar 2025 11:33:07 -0500<br>
&gt;&gt;=C2=A0 &gt; Subject: [PATCH] Correct &#39;package-install&#39; to d=
etect installed packages<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 (bug#76568)<br>
&gt;&gt;=C2=A0 &gt;<br>
&gt;&gt;=C2=A0 &gt; * lisp/emacs-lisp/package.el<br>
&gt;&gt;=C2=A0 &gt; (package-install): Check for already installed package =
using its symbol<br>
&gt;&gt;=C2=A0 &gt; rather than rely on differing archive directory structu=
res.=C2=A0 Return t if<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Why are you mentioning this=
 here?<br></blockquote><div><br></div><div class=3D"gmail_default" style=3D=
"font-family:monospace">That&#39;s the root source of duplicate package ins=
tallations--packages that exist in multiple archives.=C2=A0 Expanding the l=
anguage to be more expansive is useful and as we move ahead with this, I&#3=
9;ll update the text.</div><div class=3D"gmail_default" style=3D"font-famil=
y:monospace"><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0p=
x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt;&gt;=C2=A0 &gt; installed, nil otherwise.<br>
&gt;&gt;=C2=A0 &gt; (package-install-button-action): &#39;describe-package&=
#39; only when<br>
&gt;&gt;=C2=A0 &gt; &#39;package-install&#39; actually installed the packag=
e.=C2=A0 Prompt the user to<br>
&gt;&gt;=C2=A0 &gt; install or upgrade an already installed package.<br>
&gt;&gt;=C2=A0 &gt; * test/lisp/emacs-lisp/package-tests.el (package-test-i=
nstall-single):<br>
&gt;&gt;=C2=A0 &gt; Add already-installed test using &#39;package-install&#=
39; with a<br>
&gt;&gt;=C2=A0 &gt; &#39;package-desc&#39;.<br>
&gt;&gt;=C2=A0 &gt; ---<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 lisp/emacs-lisp/package.el=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 | 54 +++++++++++++++++++++------<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 test/lisp/emacs-lisp/package-tests.el |=C2=A0 4 +=
+<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 2 files changed, 47 insertions(+), 11 deletions(-=
)<br>
&gt;&gt;=C2=A0 &gt;<br>
&gt;&gt;=C2=A0 &gt; diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-li=
sp/package.el<br>
&gt;&gt;=C2=A0 &gt; index 8d498c216dc..7c7e99168aa 100644<br>
&gt;&gt;=C2=A0 &gt; --- a/lisp/emacs-lisp/package.el<br>
&gt;&gt;=C2=A0 &gt; +++ b/lisp/emacs-lisp/package.el<br>
&gt;&gt;=C2=A0 &gt; @@ -2194,7 +2194,7 @@ package-install-upgrade-built-in<=
br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 :version &quot;29.1&quot;)<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 <br>
&gt;&gt;=C2=A0 &gt;=C2=A0 ;;;###autoload<br>
&gt;&gt;=C2=A0 &gt; -(defun package-install (pkg &amp;optional dont-select)=
<br>
&gt;&gt;=C2=A0 &gt; +(defun package-install (pkg &amp;optional dont-select =
allow-mult-or-reinstall)<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 &quot;Install the package PKG.<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 <br>
&gt;&gt;=C2=A0 &gt;=C2=A0 PKG can be a `package-desc&#39;, or a symbol nami=
ng one of the available<br>
&gt;&gt;=C2=A0 &gt; @@ -2207,8 +2207,13 @@ package-install<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 non-nil, install the package but do not add it to=
<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 `package-selected-packages&#39;.<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 <br>
&gt;&gt;=C2=A0 &gt; -If PKG is a `package-desc&#39; and it is already insta=
lled, don&#39;t try<br>
&gt;&gt;=C2=A0 &gt; -to install it but still mark it as selected.<br>
&gt;&gt;=C2=A0 &gt; +When called from Lisp and optional argument ALLOW-MULT=
-OR-REINSTALL is<br>
&gt;&gt;=C2=A0 &gt; +non-nil, install the package even if it is already ins=
talled from<br>
&gt;&gt;=C2=A0 &gt; +another source, allowing more than one simultaneous ve=
rsion.<br>
&gt;&gt;=C2=A0 &gt; +<br>
&gt;&gt;=C2=A0 &gt; +If PKG is a `package-desc&#39; and it is already insta=
lled, and<br>
&gt;&gt;=C2=A0 &gt; +ALLOW-MULT-OR-REINSTALL is nil, don&#39;t try to insta=
ll it but still mark<br>
&gt;&gt;=C2=A0 &gt; +it as selected.<br>
&gt;&gt; <br>
&gt;&gt;=C2=A0 Why is this yet another optional argument, instead of a user=
 option?<br>
&gt;&gt; <br>
&gt;&gt; As the maintainer, you pick what suits your taste.<br>
<br>
No, what I meant is if there is a reason that we should sometimes allow<br>
installing multiple versions of a package in some cases and not in<br>
others?=C2=A0 Is that a genuine use-case, or do you (as the person<br>
experiencing the issue you are trying to solve) assume that most people<br>
with the same problem would be OK with setting this once via a<br>
user-option.=C2=A0 I am under the impression that that would simplify the<b=
r>
change.<br></blockquote><div><br></div><div><div class=3D"gmail_default" st=
yle=3D"font-family:monospace">I figured there&#39;s someone out there that =
depends on this for some reason and Emacs tries to provide backward compati=
bility.=C2=A0 I prefer the simpler route, if agreed.</div></div><div><br></=
div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bor=
der-left:1px solid rgb(204,204,204);padding-left:1ex">
(Also, if we go with the optional argument, please rename it to<br>
something cleaner like &quot;allow-multiple&quot;.=C2=A0 Perhaps it is just=
 me, but an<br>
&quot;-or-&quot; in a argument name bugs me.)<br></blockquote><div><br></di=
v><div class=3D"gmail_default" style=3D"font-family:monospace">Sure.</div><=
div class=3D"gmail_default" style=3D"font-family:monospace"><br></div><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:=
1px solid rgb(204,204,204);padding-left:1ex">&gt;&gt;=C2=A0 &gt;=C2=A0 If t=
he command is invoked with a prefix argument, it will allow<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 upgrading of built-in packages, as if `package-in=
stall-upgrade-built-in&#39;<br>
&gt;&gt;=C2=A0 &gt; @@ -2243,16 +2248,22 @@ package-install<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0(package--active-built-in-p pkg))<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq pkg (or (cadr (assq na=
me package-archive-contents)) pkg)))<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0 (if-let* ((transaction<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0;; Test for already installed using the pkg symbol, not<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0;; the archive-specific directory structure.<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0(if (package-desc-p pkg)<br>
&gt;&gt;=C2=A0 &gt; -=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>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0(unless (and (not allow-mult-or-reinstall)<br>
&gt;&gt;=C2=A0 &gt; +=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-instal=
led-p (package-desc-name pkg)))<br>
&gt;&gt;=C2=A0 &gt;=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-compute-transaction (list pkg)<br>
&gt;&gt;=C2=A0 &gt;=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 =C2=A0 (package-desc-reqs pkg=
)))<br>
&gt;&gt;=C2=A0 &gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0(package-compute-transaction () (list (list pkg))))))<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0(unless (and (not allow-mult-or-reinstall)<br>
&gt;&gt;=C2=A0 &gt; +=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-installed-p p=
kg))<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0(package-compute-transaction () (list (list pkg)))))))<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (progn<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (package-downl=
oad-transaction transaction)<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (package--quic=
kstart-maybe-refresh)<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message=C2=A0=
 &quot;Package `%s&#39; installed.&quot; name))<br>
&gt;&gt;=C2=A0 &gt; -=C2=A0 =C2=A0 =C2=A0 (message &quot;`%s&#39; is alread=
y installed&quot; name))))<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 (message &quot;`%s&#39; is alread=
y installed&quot; name)<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 nil)))<br>
<br>
This last change appears to be unrelated to the remaining patch?<br></block=
quote><div><br></div><div><div class=3D"gmail_default" style=3D"font-family=
:monospace">Last meaning the message, or last meaning the whole of the abov=
e?</div></div><div class=3D"gmail_default" style=3D"font-family:monospace">=
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8=
ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt;&gt;=C2=A0 =
&gt;=C2=A0 (declare-function package-vc-upgrade &quot;package-vc&quot; (pkg=
))<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 <br>
&gt;&gt;=C2=A0 &gt; @@ -2587,7 +2598,7 @@ package-reinstall<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 (package-delete<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0(if (package-desc-p pkg) pkg (cadr (=
assq pkg package-alist)))<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0&#39;force &#39;nosave)<br>
&gt;&gt;=C2=A0 &gt; -=C2=A0 (package-install pkg &#39;dont-select))<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 (package-install pkg &#39;dont-select &#39;allo=
w-mult-or-reinstall))<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 <br>
&gt;&gt;=C2=A0 &gt;=C2=A0 ;;;###autoload<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 (defun package-recompile (pkg)<br>
&gt;&gt;=C2=A0 &gt; @@ -3051,10 +3062,31 @@ package-install-button-action<b=
r>
<br>
(OK, one of the things that had me confused is that I misread the diff<br>
and assumed you were patching `package-recompile&#39; ^^)<br>
<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 Used for the `action&#39; property of buttons in =
the buffer created by<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 `describe-package&#39;.&quot;<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 (let ((pkg-desc (button-get button &#39;pa=
ckage-desc)))<br>
&gt;&gt;=C2=A0 &gt; -=C2=A0 =C2=A0 (when (y-or-n-p (format-message &quot;In=
stall package `%s&#39;? &quot;<br>
&gt;&gt;=C2=A0 &gt; -=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-full-name pkg-desc)))<br>
&gt;&gt;=C2=A0 &gt; -=C2=A0 =C2=A0 =C2=A0 (package-install pkg-desc nil)<br=
>
&gt;&gt;=C2=A0 &gt; -=C2=A0 =C2=A0 =C2=A0 (describe-package (package-desc-n=
ame pkg-desc)))))<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 (if (package-installed-p (package-desc-n=
ame pkg-desc))<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((installed-pkg-desc =
(cadr (assq<br>
&gt;&gt;=C2=A0 &gt; +=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-name pkg-desc)<br>
&gt;&gt;=C2=A0 &gt; +=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=A0package-alist))))<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (pcase (let ((read-=
answer-short t))<br>
<br>
I don&#39;t think you should shadow the user&#39;s preference here.<br></bl=
ockquote><div><br></div><div class=3D"gmail_default" style=3D"font-family:m=
onospace">I need more coffee.=C2=A0 Not following.</div><div class=3D"gmail=
_default" style=3D"font-family:monospace"><br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,=
204,204);padding-left:1ex">
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0(read-answer<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 (format-message<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0&quot;Replace `%s&#39; with `%s&#39;, or Install bo=
th (advanced users) &quot;<br>
<br>
Without some additional explanation here, I would assume that this<br>
prompt could confuse users.=C2=A0 If we go with this approach, can you look=
<br>
into describing why the user would be interested in either replacing or<br>
keeping both versions of a package somewhere?<br></blockquote><div><br></di=
v><div><div class=3D"gmail_default" style=3D"font-family:monospace">If we d=
ecide to disallow multiple side-by-side installs, this becomes moot.</div><=
/div><div class=3D"gmail_default" style=3D"font-family:monospace"><br></div=
><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border=
-left:1px solid rgb(204,204,204);padding-left:1ex">
Also, why not move this prompt into `package-install&#39;, that the user<br=
>
would get presented with if they invoke the command interactively?<br></blo=
ckquote><div><br></div><div><div class=3D"gmail_default" style=3D"font-fami=
ly:monospace">I&#39;d have to reread this from scratch to see as I can&#39;=
t recall.</div></div><div class=3D"gmail_default" style=3D"font-family:mono=
space"><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(package-desc-full-name installed-pkg-desc)<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(package-desc-full-name pkg-desc))<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 &#39;((&quot;replace&quot; ?r &quot;Replace existing&quot=
;)<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 (&quot;install&quot; ?i &quot;Install both&quot;)<=
br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 (&quot;help&quot; ?h &quot;Help&quot;)<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 (&quot;quit&quot; ?q &quot;Quit to abort&quot;))))=
<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (&quot;repla=
ce&quot;<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(packa=
ge-delete installed-pkg-desc &#39;force &#39;dont-unselect)<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when =
(package-install pkg-desc nil)<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0(describe-package (package-desc-name pkg-desc))))<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (&quot;insta=
ll&quot;<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when =
(package-install pkg-desc nil &#39;allow-mult-or-reinstall)<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0(describe-package (package-desc-name pkg-desc))))))<br>
<br>
I think it would be good to add a message confirming that the &quot;quit&qu=
ot; operation.<br></blockquote><div><br></div><div><div class=3D"gmail_defa=
ult" style=3D"font-family:monospace">Alright.</div></div><div>=C2=A0</div><=
blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l=
eft:1px solid rgb(204,204,204);padding-left:1ex">
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 (when (y-or-n-p (format-message &=
quot;Install package `%s&#39;? &quot;<br>
&gt;&gt;=C2=A0 &gt; +=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-full-name pkg-desc)))<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (when (package-install pkg=
-desc nil)<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (describe-package (=
package-desc-name pkg-desc)))))))<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 <br>
&gt;&gt;=C2=A0 &gt;=C2=A0 (defun package-delete-button-action (button)<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 &quot;Run `package-delete&#39; on the pack=
age BUTTON points to.<br>
&gt;&gt;=C2=A0 &gt; diff --git a/test/lisp/emacs-lisp/package-tests.el b/te=
st/lisp/emacs-lisp/package-tests.el<br>
&gt;&gt;=C2=A0 &gt; index d8e260319bd..36617ed6f6e 100644<br>
&gt;&gt;=C2=A0 &gt; --- a/test/lisp/emacs-lisp/package-tests.el<br>
&gt;&gt;=C2=A0 &gt; +++ b/test/lisp/emacs-lisp/package-tests.el<br>
&gt;&gt;=C2=A0 &gt; @@ -248,6 +248,10 @@ package-test-install-single<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 (should (string-match &quot;=
^[`=E2=80=98&#39;]simple-single[=E2=80=99&#39;] is already installed\n?\\&#=
39;&quot;<br>
&gt;&gt;=C2=A0 &gt;=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 (buffer-string))))<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0 (should (package-installed-p &#39;s=
imple-single))<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 ;; Test for `package-install&#39; alread=
y installed using a<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 ;; package-desc.=C2=A0 `package-install&=
#39; returns nil if already<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 ;; installed.<br>
&gt;&gt;=C2=A0 &gt; +=C2=A0 =C2=A0 (should-not (package-install simple-sing=
le-desc))<br>
&gt;&gt;=C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0 (let* ((simple-pkg-dir (file-name-a=
s-directory<br>
&gt;&gt;=C2=A0 &gt;=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 (expand-file-name<br>
&gt;&gt;=C2=A0 &gt;=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&quot;simple-single-=
1.3&quot;<br>
&gt;&gt; <br>
&gt;&gt;=C2=A0 For some reason I find this patch very difficult to follow..=
.=C2=A0 Perhaps I<br>
&gt;&gt;=C2=A0 don&#39;t understand the issue you are trying to fix, or how=
 it is related<br>
&gt;&gt;=C2=A0 to your patch.<br>
&gt;&gt; <br>
&gt;&gt; The issue is that package install will install multiple versions o=
f the same package (from the same archive)<br>
&gt;&gt; without warning.=C2=A0 This will and does confuse users especially=
 using the interactive package menu.=C2=A0 The<br>
&gt;&gt; patch works for me.<br>
<br>
Thanks for the explanation!=C2=A0 I would rephrase the commit message to<br=
>
express the<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Warn user when installing multiple versio=
ns of the same<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 package&quot;<br>
<br>
part more prominently.<br></blockquote><div><br></div><div class=3D"gmail_d=
efault" style=3D"font-family:monospace">Okay.</div><div class=3D"gmail_defa=
ult" style=3D"font-family:monospace"><br></div><blockquote class=3D"gmail_q=
uote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,2=
04);padding-left:1ex">
&gt;&gt; The related issue is that multiple versions of the same packages t=
hat come from different archives are also<br>
&gt;&gt; installed but this patch does not attempt to deal with that.=C2=A0=
 I proposed that we segregate archives under the<br>
&gt;&gt; package tree to ease the package infrastructure&#39;s ability to d=
etect that.<br>
<br>
That is a different issue, one that I would like to solve ideally by<br>
convincing package maintainers not to have their packages on multiple<br>
archives, but that is not an issue we can solve here.<br></blockquote><div>=
<br></div><div class=3D"gmail_default" style=3D"font-family:monospace">I su=
ppose the=C2=A0&quot;convenience&quot; of MELPA&#39;s=C2=A0publish on most =
recent commit is attractive to=C2=A0some.</div><div class=3D"gmail_default"=
 style=3D"font-family:monospace"><br></div><div class=3D"gmail_default" sty=
le=3D"font-family:monospace">Doesn&#39;t this still bite=C2=A0us if people =
use both ELPA devel and ELPA production since they&#39;re treated as differ=
ent archives?=C2=A0 Perhaps we can unify duplicate package detection at lea=
st in the core Emacs archives.</div><div class=3D"gmail_default" style=3D"f=
ont-family:monospace"><br></div><div class=3D"gmail_default" style=3D"font-=
family:monospace">-Stephane</div></div></div>

--0000000000007df9c706376e4eed--




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; 8 Jun 2025 04:38:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 08 00:38:20 2025
Received: from localhost ([127.0.0.1]:50349 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uO7nY-0005ot-5V
	for submit <at> debbugs.gnu.org; Sun, 08 Jun 2025 00:38:20 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:41880)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uO7nU-0005oc-Te
 for 76568 <at> debbugs.gnu.org; Sun, 08 Jun 2025 00:38:17 -0400
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 1uO7nN-0002A1-LY; Sun, 08 Jun 2025 00:38:10 -0400
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=UdSL7qRA2022PqcqzRV6RIwP+PT8DN92zPntc7+VOfQ=; b=T/lkkAGDPEmo
 5jvBzMEBASHbDk3tccfrnNIltANP/nMGRTm7mulpWryxsUvM1a7fytjQuiOSODbfn5GaCzvlt95cN
 Vu52U4km0pVUfEq8X2kS/BXdiVr33rlPDfqgVjpQjCZkzqa3y+deS1dGIfjFgn2MNtxymbr04KFJ0
 CJRZQ/JryVc4faFA5I6PB9k/sGbgbv02a1pQIgeIopYw7SR1wb3pWisYH59b4BEgXWKqzjIz887pH
 KOGLtf+dYvjD3GRibw4Ynk3NysWMy70Dkte40imt16U78VRI4XiiXqM8lRzuIPHkvH4WYboIVLxkP
 j/udOuxVQGi68OIa6I69kw==;
Date: Sun, 08 Jun 2025 07:38:05 +0300
Message-Id: <86jz5mhmqa.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
In-Reply-To: <87msajdz5s.fsf@HIDDEN> (message from Philip Kaludercic on
 Sat, 07 Jun 2025 21:23:11 +0000)
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
 <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
 <CAN+1HbqUdBGz5WmTA8aa0Yf=rKEj8Zf=-604C+HmNVUSyJhyTw@HIDDEN>
 <CAN+1Hbo8+aF87-ogd8qJ5C+YXO6Hiww5OytmJDrrUyfp1H+JpA@HIDDEN>
 <CAN+1Hbo8XiRcgNZQB2bLadFrPJEujXDZJdv5Fuj9jEs6goTMzw@HIDDEN>
 <CAN+1HbpYF8+GKJTESnvsi2k-v1fHQykEFoRJx7kzUP3oVL4BVQ@HIDDEN>
 <CAN+1Hbox9VFa=__SZS3Mb8GMuoUVQNtw993yAHVnFRTLre1MOA@HIDDEN>
 <87h61kd0tv.fsf@HIDDEN>
 <CAN+1Hboh1pJpFzk41dMEfXjYXnUjX7fC8MsNLmNf=Mf5c-5S9A@HIDDEN>
 <87y0uklony.fsf@HIDDEN>
 <CAN+1Hbq09yuqh9y99p9G_BDVKBW2zRNEsUmMoHwPz6aC1yUXDw@HIDDEN>
 <861prwj6dz.fsf@HIDDEN> <87msajdz5s.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76568
Cc: 76568 <at> debbugs.gnu.org, shipmints@HIDDEN, monnier@HIDDEN,
 stefankangas@HIDDEN
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: Philip Kaludercic <philipk@HIDDEN>
> Cc: Ship Mints <shipmints@HIDDEN>,  76568 <at> debbugs.gnu.org,
>   stefankangas@HIDDEN, "Stefan Monnier" <monnier@HIDDEN>
> Date: Sat, 07 Jun 2025 21:23:11 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > Ping!  Can we make further progress with this issue?
> 
> Sorry, understanding this bug report still takes me forever...  Just
> composing this message took me an hour.  I have added Stefan to the CCs
> to get some more input.

Thank you for your efforts.




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; 7 Jun 2025 21:23:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 07 17:23:25 2025
Received: from localhost ([127.0.0.1]:49780 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uO10e-00028a-Ic
	for submit <at> debbugs.gnu.org; Sat, 07 Jun 2025 17:23:25 -0400
Received: from mout01.posteo.de ([185.67.36.65]:44347)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <philipk@HIDDEN>)
 id 1uO10a-000289-8L
 for 76568 <at> debbugs.gnu.org; Sat, 07 Jun 2025 17:23:22 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 4C19D240027
 for <76568 <at> debbugs.gnu.org>; Sat,  7 Jun 2025 23:23:13 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net;
 s=1984.ea087b; t=1749331393;
 bh=XoEid3sT233dP1ZgvF/F+QK4Yv9IGZBjwjoScklgejQ=;
 h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version:
 Content-Type:Content-Transfer-Encoding:From;
 b=hQskH6PrPiXgm7lH/PkWAxoIFD6jpngnGkfwN16fKsd79QfUcO0d4oscdpWg7P3QT
 PrabZncJEuebC5XkRcG8V/h6qIiiexX6ukyiHzxoImzxYAkGNR7P8IsYOBcwfvETic
 Hp3wn3aK+D6rsN/Y8Ng22Uaf9AaP7NUts6Q7MBXStyZW3yMW5zl5d7xIKDcjodjQFX
 sqfl7UMhI5FG4GBosqF9/W6QXPbOAYVe1AyNEiCHZ235bZZuLKorv89tX+8Odfl31q
 4OqLXK97xIgzr3NTwyzUqvVF7VogYKMvL23RpMKHuMqKjkY6RDw6hY+yscErBv0Rpa
 gYg0EaYaWHNUnNHU387dg+tRyQKlLctjaRbRHYMvt63eaPgWRGTEMuFZZuZYEGJ8yW
 id25hG8lOSHfvwradI5j/B0Ojo2FISRaCwR5QnWbosTdUd1/oTSpGi/9N8W3toeDQ6
 pmdvWej6kfoQwzheqEL2SIjYsrUaEblnDeR7lpE7AqsY3n4uxI3
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4bFB4J19m1z6tvq;
 Sat,  7 Jun 2025 23:23:11 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
In-Reply-To: <861prwj6dz.fsf@HIDDEN>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Q8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0
 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB
 BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE
 Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK
 NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof
 z4oM
OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66;
 url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66";
 preference=signencrypt
Date: Sat, 07 Jun 2025 21:23:11 +0000
Message-ID: <87msajdz5s.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76568
Cc: 76568 <at> debbugs.gnu.org, Ship Mints <shipmints@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, stefankangas@HIDDEN
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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

> Ping!  Can we make further progress with this issue?

Sorry, understanding this bug report still takes me forever...  Just
composing this message took me an hour.  I have added Stefan to the CCs
to get some more input.

>> From: Ship Mints <shipmints@HIDDEN>
>> Date: Sun, 25 May 2025 11:08:20 -0400
>> Cc: 76568 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,=20
>> 	Stefan Kangas <stefankangas@HIDDEN>
>>=20
>> On Sun, May 25, 2025 at 11:01=E2=80=AFAM Philip Kaludercic <philipk@post=
eo.net> wrote:
>>=20
>>  Ship Mints <shipmints@HIDDEN> writes:
>>=20
>>  [...]
>>=20
>>  >> Can you please summarise the relevant parts of this discussion?  I s=
ee
>>  >> that a patch is being mentioned above, should I review it?
>>  >>
>>  >
>>  > The latest version of this patch from this discussion is attached.  It
>>  > amends both the menu-driven package upgrade and the package-upgrade c=
ommand
>>  > to assist the user with avoiding (or permitting) installing a package=
 more
>>  > than once.
>>  >
>>=20
>>  [...]
>>=20
>>  >
>>  > -Stephane
>>  > From 9deee448e27f94c21469e59677fde2cbce8f9bcd Mon Sep 17 00:00:00 2001
>>  > From: shipmints <shipmints@HIDDEN>
>>  > Date: Wed, 5 Mar 2025 11:33:07 -0500
>>  > Subject: [PATCH] Correct 'package-install' to detect installed packag=
es
>>  >  (bug#76568)
>>  >
>>  > * lisp/emacs-lisp/package.el
>>  > (package-install): Check for already installed package using its symb=
ol
>>  > rather than rely on differing archive directory structures.  Return t=
 if
             ^
             Why are you mentioning this here?

>>  > installed, nil otherwise.
>>  > (package-install-button-action): 'describe-package' only when
>>  > 'package-install' actually installed the package.  Prompt the user to
>>  > install or upgrade an already installed package.
>>  > * test/lisp/emacs-lisp/package-tests.el (package-test-install-single):
>>  > Add already-installed test using 'package-install' with a
>>  > 'package-desc'.
>>  > ---
>>  >  lisp/emacs-lisp/package.el            | 54 +++++++++++++++++++++----=
--
>>  >  test/lisp/emacs-lisp/package-tests.el |  4 ++
>>  >  2 files changed, 47 insertions(+), 11 deletions(-)
>>  >
>>  > diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
>>  > index 8d498c216dc..7c7e99168aa 100644
>>  > --- a/lisp/emacs-lisp/package.el
>>  > +++ b/lisp/emacs-lisp/package.el
>>  > @@ -2194,7 +2194,7 @@ package-install-upgrade-built-in
>>  >    :version "29.1")
>>  >=20=20
>>  >  ;;;###autoload
>>  > -(defun package-install (pkg &optional dont-select)
>>  > +(defun package-install (pkg &optional dont-select allow-mult-or-rein=
stall)
>>  >    "Install the package PKG.
>>  >=20=20
>>  >  PKG can be a `package-desc', or a symbol naming one of the available
>>  > @@ -2207,8 +2207,13 @@ package-install
>>  >  non-nil, install the package but do not add it to
>>  >  `package-selected-packages'.
>>  >=20=20
>>  > -If PKG is a `package-desc' and it is already installed, don't try
>>  > -to install it but still mark it as selected.
>>  > +When called from Lisp and optional argument ALLOW-MULT-OR-REINSTALL =
is
>>  > +non-nil, install the package even if it is already installed from
>>  > +another source, allowing more than one simultaneous version.
>>  > +
>>  > +If PKG is a `package-desc' and it is already installed, and
>>  > +ALLOW-MULT-OR-REINSTALL is nil, don't try to install it but still ma=
rk
>>  > +it as selected.
>>=20
>>  Why is this yet another optional argument, instead of a user option?
>>=20
>> As the maintainer, you pick what suits your taste.

No, what I meant is if there is a reason that we should sometimes allow
installing multiple versions of a package in some cases and not in
others?  Is that a genuine use-case, or do you (as the person
experiencing the issue you are trying to solve) assume that most people
with the same problem would be OK with setting this once via a
user-option.  I am under the impression that that would simplify the
change.

(Also, if we go with the optional argument, please rename it to
something cleaner like "allow-multiple".  Perhaps it is just me, but an
"-or-" in a argument name bugs me.)

>>  >=20=20
>>  >  If the command is invoked with a prefix argument, it will allow
>>  >  upgrading of built-in packages, as if `package-install-upgrade-built=
-in'
>>  > @@ -2243,16 +2248,22 @@ package-install
>>  >                 (package--active-built-in-p pkg))
>>  >        (setq pkg (or (cadr (assq name package-archive-contents)) pkg)=
))
>>  >      (if-let* ((transaction
>>  > +               ;; Test for already installed using the pkg symbol, n=
ot
>>  > +               ;; the archive-specific directory structure.
>>  >                 (if (package-desc-p pkg)
>>  > -                   (unless (package-installed-p pkg)
>>  > +                   (unless (and (not allow-mult-or-reinstall)
>>  > +                                (package-installed-p (package-desc-n=
ame pkg)))
>>  >                       (package-compute-transaction (list pkg)
>>  >                                                    (package-desc-reqs=
 pkg)))
>>  > -                 (package-compute-transaction () (list (list pkg))))=
))
>>  > +                 (unless (and (not allow-mult-or-reinstall)
>>  > +                              (package-installed-p pkg))
>>  > +                   (package-compute-transaction () (list (list pkg))=
)))))
>>  >          (progn
>>  >            (package-download-transaction transaction)
>>  >            (package--quickstart-maybe-refresh)
>>  >            (message  "Package `%s' installed." name))
>>  > -      (message "`%s' is already installed" name))))
>>  > +      (message "`%s' is already installed" name)
>>  > +      nil)))

This last change appears to be unrelated to the remaining patch?

>>  >=20=20
>>  >  (declare-function package-vc-upgrade "package-vc" (pkg))
>>  >=20=20
>>  > @@ -2587,7 +2598,7 @@ package-reinstall
>>  >    (package-delete
>>  >     (if (package-desc-p pkg) pkg (cadr (assq pkg package-alist)))
>>  >     'force 'nosave)
>>  > -  (package-install pkg 'dont-select))
>>  > +  (package-install pkg 'dont-select 'allow-mult-or-reinstall))
>>  >=20=20
>>  >  ;;;###autoload
>>  >  (defun package-recompile (pkg)
>>  > @@ -3051,10 +3062,31 @@ package-install-button-action

(OK, one of the things that had me confused is that I misread the diff
and assumed you were patching `package-recompile' ^^)

>>  >  Used for the `action' property of buttons in the buffer created by
>>  >  `describe-package'."
>>  >    (let ((pkg-desc (button-get button 'package-desc)))
>>  > -    (when (y-or-n-p (format-message "Install package `%s'? "
>>  > -                                    (package-desc-full-name pkg-desc=
)))
>>  > -      (package-install pkg-desc nil)
>>  > -      (describe-package (package-desc-name pkg-desc)))))
>>  > +    (if (package-installed-p (package-desc-name pkg-desc))
>>  > +        (let ((installed-pkg-desc (cadr (assq
>>  > +                                         (package-desc-name pkg-desc)
>>  > +                                         package-alist))))
>>  > +          (pcase (let ((read-answer-short t))

I don't think you should shadow the user's preference here.

>>  > +                   (read-answer
>>  > +                    (format-message
>>  > +                     "Replace `%s' with `%s', or Install both (advan=
ced users) "

Without some additional explanation here, I would assume that this
prompt could confuse users.  If we go with this approach, can you look
into describing why the user would be interested in either replacing or
keeping both versions of a package somewhere?

Also, why not move this prompt into `package-install', that the user
would get presented with if they invoke the command interactively?

>>  > +                     (package-desc-full-name installed-pkg-desc)
>>  > +                     (package-desc-full-name pkg-desc))
>>  > +                    '(("replace" ?r "Replace existing")
>>  > +                      ("install" ?i "Install both")
>>  > +                      ("help" ?h "Help")
>>  > +                      ("quit" ?q "Quit to abort"))))
>>  > +            ("replace"
>>  > +             (package-delete installed-pkg-desc 'force 'dont-unselec=
t)
>>  > +             (when (package-install pkg-desc nil)
>>  > +               (describe-package (package-desc-name pkg-desc))))
>>  > +            ("install"
>>  > +             (when (package-install pkg-desc nil 'allow-mult-or-rein=
stall)
>>  > +               (describe-package (package-desc-name pkg-desc))))))

I think it would be good to add a message confirming that the "quit" operat=
ion.

>>  > +      (when (y-or-n-p (format-message "Install package `%s'? "
>>  > +                                      (package-desc-full-name pkg-de=
sc)))
>>  > +        (when (package-install pkg-desc nil)
>>  > +          (describe-package (package-desc-name pkg-desc)))))))
>>  >=20=20
>>  >  (defun package-delete-button-action (button)
>>  >    "Run `package-delete' on the package BUTTON points to.
>>  > diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-=
lisp/package-tests.el
>>  > index d8e260319bd..36617ed6f6e 100644
>>  > --- a/test/lisp/emacs-lisp/package-tests.el
>>  > +++ b/test/lisp/emacs-lisp/package-tests.el
>>  > @@ -248,6 +248,10 @@ package-test-install-single
>>  >        (should (string-match "^[`=E2=80=98']simple-single[=E2=80=99']=
 is already installed\n?\\'"
>>  >                              (buffer-string))))
>>  >      (should (package-installed-p 'simple-single))
>>  > +    ;; Test for `package-install' already installed using a
>>  > +    ;; package-desc.  `package-install' returns nil if already
>>  > +    ;; installed.
>>  > +    (should-not (package-install simple-single-desc))
>>  >      (let* ((simple-pkg-dir (file-name-as-directory
>>  >                              (expand-file-name
>>  >                               "simple-single-1.3"
>>=20
>>  For some reason I find this patch very difficult to follow...  Perhaps I
>>  don't understand the issue you are trying to fix, or how it is related
>>  to your patch.
>>=20
>> The issue is that package install will install multiple versions of the =
same package (from the same archive)
>> without warning.  This will and does confuse users especially using the =
interactive package menu.  The
>> patch works for me.

Thanks for the explanation!  I would rephrase the commit message to
express the

        "Warn user when installing multiple versions of the same
        package"

part more prominently.

>> The related issue is that multiple versions of the same packages that co=
me from different archives are also
>> installed but this patch does not attempt to deal with that.  I proposed=
 that we segregate archives under the
>> package tree to ease the package infrastructure's ability to detect that.

That is a different issue, one that I would like to solve ideally by
convincing package maintainers not to have their packages on multiple
archives, but that is not an issue we can solve here.




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; 7 Jun 2025 08:36:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 07 04:36:03 2025
Received: from localhost ([127.0.0.1]:46791 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uNp22-0005SB-GI
	for submit <at> debbugs.gnu.org; Sat, 07 Jun 2025 04:36:03 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51548)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uNp20-0005Rd-EO
 for 76568 <at> debbugs.gnu.org; Sat, 07 Jun 2025 04:36:01 -0400
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 1uNp1u-0004wU-VR; Sat, 07 Jun 2025 04:35:54 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=c1wOGvJs7yzXNbdPzMQPkWHdACEyBKoXTnFY74y+huQ=; b=HdIq1gKyP3BU0CXEcKha
 jOBR1U8iDI7jLF9hxFH5KzhMzZeT2ar70MbfrXNeQTuUxk6fyknP8eKsY205BSKcE+M8pMwEBcz8x
 mdgDQOKS+zHFPxs49rfE6X6nwkKVrTw7k3yc9VDGDj6pjnlmg98Frg4IHgBDLIldXyTS5hHHsqBvp
 4qSguyqeNAjvMcTKILR5ljDaYoos414fGKWQTtbpoIF1onUgCjPI42Yl+WMtHkjQh2TRAofG888RU
 I1hZTQBO6t7ogkbQIhLGtj87zf6jsqCdViBmEf8lMGbQ9onP3mwsNB7Z66eiQclF9vfr3dUc3oTH5
 3rkCBB6vAU83FQ==;
Date: Sat, 07 Jun 2025 11:35:52 +0300
Message-Id: <861prwj6dz.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: philipk@HIDDEN, Ship Mints <shipmints@HIDDEN>
In-Reply-To: <CAN+1Hbq09yuqh9y99p9G_BDVKBW2zRNEsUmMoHwPz6aC1yUXDw@HIDDEN>
 (message from Ship Mints on Sun, 25 May 2025 11:08:20 -0400)
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
 <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
 <CAN+1HbqUdBGz5WmTA8aa0Yf=rKEj8Zf=-604C+HmNVUSyJhyTw@HIDDEN>
 <CAN+1Hbo8+aF87-ogd8qJ5C+YXO6Hiww5OytmJDrrUyfp1H+JpA@HIDDEN>
 <CAN+1Hbo8XiRcgNZQB2bLadFrPJEujXDZJdv5Fuj9jEs6goTMzw@HIDDEN>
 <CAN+1HbpYF8+GKJTESnvsi2k-v1fHQykEFoRJx7kzUP3oVL4BVQ@HIDDEN>
 <CAN+1Hbox9VFa=__SZS3Mb8GMuoUVQNtw993yAHVnFRTLre1MOA@HIDDEN>
 <87h61kd0tv.fsf@HIDDEN>
 <CAN+1Hboh1pJpFzk41dMEfXjYXnUjX7fC8MsNLmNf=Mf5c-5S9A@HIDDEN>
 <87y0uklony.fsf@HIDDEN>
 <CAN+1Hbq09yuqh9y99p9G_BDVKBW2zRNEsUmMoHwPz6aC1yUXDw@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76568
Cc: 76568 <at> debbugs.gnu.org, stefankangas@HIDDEN
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 (---)

Ping!  Can we make further progress with this issue?

> From: Ship Mints <shipmints@HIDDEN>
> Date: Sun, 25 May 2025 11:08:20 -0400
> Cc: 76568 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, 
> 	Stefan Kangas <stefankangas@HIDDEN>
> 
> On Sun, May 25, 2025 at 11:01 AM Philip Kaludercic <philipk@HIDDEN> wrote:
> 
>  Ship Mints <shipmints@HIDDEN> writes:
> 
>  [...]
> 
>  >> Can you please summarise the relevant parts of this discussion?  I see
>  >> that a patch is being mentioned above, should I review it?
>  >>
>  >
>  > The latest version of this patch from this discussion is attached.  It
>  > amends both the menu-driven package upgrade and the package-upgrade command
>  > to assist the user with avoiding (or permitting) installing a package more
>  > than once.
>  >
> 
>  [...]
> 
>  >
>  > -Stephane
>  > From 9deee448e27f94c21469e59677fde2cbce8f9bcd Mon Sep 17 00:00:00 2001
>  > From: shipmints <shipmints@HIDDEN>
>  > Date: Wed, 5 Mar 2025 11:33:07 -0500
>  > Subject: [PATCH] Correct 'package-install' to detect installed packages
>  >  (bug#76568)
>  >
>  > * lisp/emacs-lisp/package.el
>  > (package-install): Check for already installed package using its symbol
>  > rather than rely on differing archive directory structures.  Return t if
>  > installed, nil otherwise.
>  > (package-install-button-action): 'describe-package' only when
>  > 'package-install' actually installed the package.  Prompt the user to
>  > install or upgrade an already installed package.
>  > * test/lisp/emacs-lisp/package-tests.el (package-test-install-single):
>  > Add already-installed test using 'package-install' with a
>  > 'package-desc'.
>  > ---
>  >  lisp/emacs-lisp/package.el            | 54 +++++++++++++++++++++------
>  >  test/lisp/emacs-lisp/package-tests.el |  4 ++
>  >  2 files changed, 47 insertions(+), 11 deletions(-)
>  >
>  > diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
>  > index 8d498c216dc..7c7e99168aa 100644
>  > --- a/lisp/emacs-lisp/package.el
>  > +++ b/lisp/emacs-lisp/package.el
>  > @@ -2194,7 +2194,7 @@ package-install-upgrade-built-in
>  >    :version "29.1")
>  >  
>  >  ;;;###autoload
>  > -(defun package-install (pkg &optional dont-select)
>  > +(defun package-install (pkg &optional dont-select allow-mult-or-reinstall)
>  >    "Install the package PKG.
>  >  
>  >  PKG can be a `package-desc', or a symbol naming one of the available
>  > @@ -2207,8 +2207,13 @@ package-install
>  >  non-nil, install the package but do not add it to
>  >  `package-selected-packages'.
>  >  
>  > -If PKG is a `package-desc' and it is already installed, don't try
>  > -to install it but still mark it as selected.
>  > +When called from Lisp and optional argument ALLOW-MULT-OR-REINSTALL is
>  > +non-nil, install the package even if it is already installed from
>  > +another source, allowing more than one simultaneous version.
>  > +
>  > +If PKG is a `package-desc' and it is already installed, and
>  > +ALLOW-MULT-OR-REINSTALL is nil, don't try to install it but still mark
>  > +it as selected.
> 
>  Why is this yet another optional argument, instead of a user option?
> 
> As the maintainer, you pick what suits your taste.
> 
>  >  
>  >  If the command is invoked with a prefix argument, it will allow
>  >  upgrading of built-in packages, as if `package-install-upgrade-built-in'
>  > @@ -2243,16 +2248,22 @@ package-install
>  >                 (package--active-built-in-p pkg))
>  >        (setq pkg (or (cadr (assq name package-archive-contents)) pkg)))
>  >      (if-let* ((transaction
>  > +               ;; Test for already installed using the pkg symbol, not
>  > +               ;; the archive-specific directory structure.
>  >                 (if (package-desc-p pkg)
>  > -                   (unless (package-installed-p pkg)
>  > +                   (unless (and (not allow-mult-or-reinstall)
>  > +                                (package-installed-p (package-desc-name pkg)))
>  >                       (package-compute-transaction (list pkg)
>  >                                                    (package-desc-reqs pkg)))
>  > -                 (package-compute-transaction () (list (list pkg))))))
>  > +                 (unless (and (not allow-mult-or-reinstall)
>  > +                              (package-installed-p pkg))
>  > +                   (package-compute-transaction () (list (list pkg)))))))
>  >          (progn
>  >            (package-download-transaction transaction)
>  >            (package--quickstart-maybe-refresh)
>  >            (message  "Package `%s' installed." name))
>  > -      (message "`%s' is already installed" name))))
>  > +      (message "`%s' is already installed" name)
>  > +      nil)))
>  >  
>  >  (declare-function package-vc-upgrade "package-vc" (pkg))
>  >  
>  > @@ -2587,7 +2598,7 @@ package-reinstall
>  >    (package-delete
>  >     (if (package-desc-p pkg) pkg (cadr (assq pkg package-alist)))
>  >     'force 'nosave)
>  > -  (package-install pkg 'dont-select))
>  > +  (package-install pkg 'dont-select 'allow-mult-or-reinstall))
>  >  
>  >  ;;;###autoload
>  >  (defun package-recompile (pkg)
>  > @@ -3051,10 +3062,31 @@ package-install-button-action
>  >  Used for the `action' property of buttons in the buffer created by
>  >  `describe-package'."
>  >    (let ((pkg-desc (button-get button 'package-desc)))
>  > -    (when (y-or-n-p (format-message "Install package `%s'? "
>  > -                                    (package-desc-full-name pkg-desc)))
>  > -      (package-install pkg-desc nil)
>  > -      (describe-package (package-desc-name pkg-desc)))))
>  > +    (if (package-installed-p (package-desc-name pkg-desc))
>  > +        (let ((installed-pkg-desc (cadr (assq
>  > +                                         (package-desc-name pkg-desc)
>  > +                                         package-alist))))
>  > +          (pcase (let ((read-answer-short t))
>  > +                   (read-answer
>  > +                    (format-message
>  > +                     "Replace `%s' with `%s', or Install both (advanced users) "
>  > +                     (package-desc-full-name installed-pkg-desc)
>  > +                     (package-desc-full-name pkg-desc))
>  > +                    '(("replace" ?r "Replace existing")
>  > +                      ("install" ?i "Install both")
>  > +                      ("help" ?h "Help")
>  > +                      ("quit" ?q "Quit to abort"))))
>  > +            ("replace"
>  > +             (package-delete installed-pkg-desc 'force 'dont-unselect)
>  > +             (when (package-install pkg-desc nil)
>  > +               (describe-package (package-desc-name pkg-desc))))
>  > +            ("install"
>  > +             (when (package-install pkg-desc nil 'allow-mult-or-reinstall)
>  > +               (describe-package (package-desc-name pkg-desc))))))
>  > +      (when (y-or-n-p (format-message "Install package `%s'? "
>  > +                                      (package-desc-full-name pkg-desc)))
>  > +        (when (package-install pkg-desc nil)
>  > +          (describe-package (package-desc-name pkg-desc)))))))
>  >  
>  >  (defun package-delete-button-action (button)
>  >    "Run `package-delete' on the package BUTTON points to.
>  > diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el
>  > index d8e260319bd..36617ed6f6e 100644
>  > --- a/test/lisp/emacs-lisp/package-tests.el
>  > +++ b/test/lisp/emacs-lisp/package-tests.el
>  > @@ -248,6 +248,10 @@ package-test-install-single
>  >        (should (string-match "^[`‘']simple-single[’'] is already installed\n?\\'"
>  >                              (buffer-string))))
>  >      (should (package-installed-p 'simple-single))
>  > +    ;; Test for `package-install' already installed using a
>  > +    ;; package-desc.  `package-install' returns nil if already
>  > +    ;; installed.
>  > +    (should-not (package-install simple-single-desc))
>  >      (let* ((simple-pkg-dir (file-name-as-directory
>  >                              (expand-file-name
>  >                               "simple-single-1.3"
> 
>  For some reason I find this patch very difficult to follow...  Perhaps I
>  don't understand the issue you are trying to fix, or how it is related
>  to your patch.
> 
> The issue is that package install will install multiple versions of the same package (from the same archive)
> without warning.  This will and does confuse users especially using the interactive package menu.  The
> patch works for me.
> 
> The related issue is that multiple versions of the same packages that come from different archives are also
> installed but this patch does not attempt to deal with that.  I proposed that we segregate archives under the
> package tree to ease the package infrastructure's ability to detect that.




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; 25 May 2025 15:08:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 25 11:08:54 2025
Received: from localhost ([127.0.0.1]:46690 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uJCy5-0003aM-EN
	for submit <at> debbugs.gnu.org; Sun, 25 May 2025 11:08:54 -0400
Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]:55602)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1uJCy1-0003Zs-Ct
 for 76568 <at> debbugs.gnu.org; Sun, 25 May 2025 11:08:50 -0400
Received: by mail-qv1-xf2e.google.com with SMTP id
 6a1803df08f44-6faa4307e15so14213496d6.3
 for <76568 <at> debbugs.gnu.org>; Sun, 25 May 2025 08:08:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1748185723; x=1748790523; 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=O7DfLX4pHOS23C+dPEwWGqMzG46wPBvF771ymj3KzAs=;
 b=Foo5XkqBBZYRuZxnrhB8YuUyYxD0i8Rq83RjxWUzo79mWsrtu9MlV+m+FrAVqKGrqB
 wobDBPO6dMu5SS+BxoLDWYQz3S2M+NFRjCziFg4mPsnhlqZ5PT1aLp1D5ZppRj9CmePt
 q6AZ43UgXQ66XqMPjvT4LlsvEBIO2AxQceBoon1doW/NHJ7eu42+KKoPHdgdClZAxsOH
 t2e8CKGrLgoxxl0e6B72yf3Ut1YfH6X59hdnkvnE/P/N0z6rr9Y9fzB8yX9ECGkaD487
 NOPILZ8MeuQxfPYVONlXc9kUXi7f0IBaftTgNCpDD+FlaxTmuU/5CpQujzQzwO1jF9yh
 oIKQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1748185723; x=1748790523;
 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=O7DfLX4pHOS23C+dPEwWGqMzG46wPBvF771ymj3KzAs=;
 b=CCyTttfRVaipOyms3sGjWah1aVvWHtA4VJOMutkxSqczx4VGZ/cZEQUye9tbpLA78l
 /HaPkpcOFha+rNEHLVNA2iu/HsmITzEhinloP+Jh6CNCA9DRZzjSRmzNZWJzVZ+xBMOj
 Q0sOGPz4FKkkvHMisSS7PjrQoR0zMLwLxMv1HuSQ/ZWTwb+FIwB4nMd4jzUmTlhj4hhe
 IuF5NuaPItV3MiSHnbxNmkHB0ag0k/ILjbJ8aTZyOHGjX3G9IoS+romWhM66IWW0+UUT
 aKu55nXNRKAFpYUYfRx4rWVPfFKZ7+VX8gPhijhv82T04qzh7wmaF1HYjzo5TC5/Hwc6
 2lZg==
X-Gm-Message-State: AOJu0YxAw5k0HLyTRJjl+rQxe3gxTNdBt5JzucC1Tgz4J3tOjq1qVSpF
 S5NBeCvBZEmAsnPjTntnoUNj3bb06gzDBcodJguq2vVo89E7jlcYbwAz0gjx+1hJ0YdGBfmpIHH
 WAfnh5rdc+q857ZoqnN6DXxqKxns6wrqOQA==
X-Gm-Gg: ASbGncvT8BLsAh/+ONyuqMNv1lS3SZzWfW1PI44p7Jz+sbQK5Ds7sbrQ/+01mAJVX4U
 KDT4Egp6yXbA46yRfjxFAhsvEYrFbUjCvyTGG3O6EP6uWPuPvEpx3JBAjfB5ULcYtzuvDJ0rhUo
 LA55SzTWfS5e+05eY6DVZDu84JQ1eLd3fpPZg=
X-Google-Smtp-Source: AGHT+IGQQpXZ3Slb42S/gXL/s9cCqZWx7bi4o67Ed73RKoyKtGP8hVOMQB+1DCGA3Fad7TxCYKQg/yJlXgnhIh6KsYI=
X-Received: by 2002:a05:620a:44c6:b0:7cc:fef2:51b9 with SMTP id
 af79cd13be357-7ceecc4597fmr955576885a.52.1748185711760; Sun, 25 May 2025
 08:08:31 -0700 (PDT)
MIME-Version: 1.0
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
 <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
 <CAN+1HbqUdBGz5WmTA8aa0Yf=rKEj8Zf=-604C+HmNVUSyJhyTw@HIDDEN>
 <CAN+1Hbo8+aF87-ogd8qJ5C+YXO6Hiww5OytmJDrrUyfp1H+JpA@HIDDEN>
 <CAN+1Hbo8XiRcgNZQB2bLadFrPJEujXDZJdv5Fuj9jEs6goTMzw@HIDDEN>
 <CAN+1HbpYF8+GKJTESnvsi2k-v1fHQykEFoRJx7kzUP3oVL4BVQ@HIDDEN>
 <CAN+1Hbox9VFa=__SZS3Mb8GMuoUVQNtw993yAHVnFRTLre1MOA@HIDDEN>
 <87h61kd0tv.fsf@HIDDEN>
 <CAN+1Hboh1pJpFzk41dMEfXjYXnUjX7fC8MsNLmNf=Mf5c-5S9A@HIDDEN>
 <87y0uklony.fsf@HIDDEN>
In-Reply-To: <87y0uklony.fsf@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Sun, 25 May 2025 11:08:20 -0400
X-Gm-Features: AX0GCFvwQVpYAwSzRSSrokJMGfh3TrbBq-3cTatF6otpO647NCA9HkeB22e9BOk
Message-ID: <CAN+1Hbq09yuqh9y99p9G_BDVKBW2zRNEsUmMoHwPz6aC1yUXDw@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
To: Philip Kaludercic <philipk@HIDDEN>
Content-Type: multipart/alternative; boundary="00000000000059da380635f73436"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76568
Cc: 76568 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Stefan Kangas <stefankangas@HIDDEN>
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 (-)

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

On Sun, May 25, 2025 at 11:01=E2=80=AFAM Philip Kaludercic <philipk@posteo.=
net>
wrote:

> Ship Mints <shipmints@HIDDEN> writes:
>
>
> [...]
>
> >> Can you please summarise the relevant parts of this discussion?  I see
> >> that a patch is being mentioned above, should I review it?
> >>
> >
> > The latest version of this patch from this discussion is attached.  It
> > amends both the menu-driven package upgrade and the package-upgrade
> command
> > to assist the user with avoiding (or permitting) installing a package
> more
> > than once.
> >
>
> [...]
>
> >
> > -Stephane
> > From 9deee448e27f94c21469e59677fde2cbce8f9bcd Mon Sep 17 00:00:00 2001
> > From: shipmints <shipmints@HIDDEN>
> > Date: Wed, 5 Mar 2025 11:33:07 -0500
> > Subject: [PATCH] Correct 'package-install' to detect installed packages
> >  (bug#76568)
> >
> > * lisp/emacs-lisp/package.el
> > (package-install): Check for already installed package using its symbol
> > rather than rely on differing archive directory structures.  Return t i=
f
> > installed, nil otherwise.
> > (package-install-button-action): 'describe-package' only when
> > 'package-install' actually installed the package.  Prompt the user to
> > install or upgrade an already installed package.
> > * test/lisp/emacs-lisp/package-tests.el (package-test-install-single):
> > Add already-installed test using 'package-install' with a
> > 'package-desc'.
> > ---
> >  lisp/emacs-lisp/package.el            | 54 +++++++++++++++++++++------
> >  test/lisp/emacs-lisp/package-tests.el |  4 ++
> >  2 files changed, 47 insertions(+), 11 deletions(-)
> >
> > diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> > index 8d498c216dc..7c7e99168aa 100644
> > --- a/lisp/emacs-lisp/package.el
> > +++ b/lisp/emacs-lisp/package.el
> > @@ -2194,7 +2194,7 @@ package-install-upgrade-built-in
> >    :version "29.1")
> >
> >  ;;;###autoload
> > -(defun package-install (pkg &optional dont-select)
> > +(defun package-install (pkg &optional dont-select
> allow-mult-or-reinstall)
> >    "Install the package PKG.
> >
> >  PKG can be a `package-desc', or a symbol naming one of the available
> > @@ -2207,8 +2207,13 @@ package-install
> >  non-nil, install the package but do not add it to
> >  `package-selected-packages'.
> >
> > -If PKG is a `package-desc' and it is already installed, don't try
> > -to install it but still mark it as selected.
> > +When called from Lisp and optional argument ALLOW-MULT-OR-REINSTALL is
> > +non-nil, install the package even if it is already installed from
> > +another source, allowing more than one simultaneous version.
> > +
> > +If PKG is a `package-desc' and it is already installed, and
> > +ALLOW-MULT-OR-REINSTALL is nil, don't try to install it but still mark
> > +it as selected.
>
> Why is this yet another optional argument, instead of a user option?
>

As the maintainer, you pick what suits your taste.

>
> >  If the command is invoked with a prefix argument, it will allow
> >  upgrading of built-in packages, as if `package-install-upgrade-built-i=
n'
> > @@ -2243,16 +2248,22 @@ package-install
> >                 (package--active-built-in-p pkg))
> >        (setq pkg (or (cadr (assq name package-archive-contents)) pkg)))
> >      (if-let* ((transaction
> > +               ;; Test for already installed using the pkg symbol, not
> > +               ;; the archive-specific directory structure.
> >                 (if (package-desc-p pkg)
> > -                   (unless (package-installed-p pkg)
> > +                   (unless (and (not allow-mult-or-reinstall)
> > +                                (package-installed-p (package-desc-nam=
e
> pkg)))
> >                       (package-compute-transaction (list pkg)
> >                                                    (package-desc-reqs
> pkg)))
> > -                 (package-compute-transaction () (list (list pkg))))))
> > +                 (unless (and (not allow-mult-or-reinstall)
> > +                              (package-installed-p pkg))
> > +                   (package-compute-transaction () (list (list
> pkg)))))))
> >          (progn
> >            (package-download-transaction transaction)
> >            (package--quickstart-maybe-refresh)
> >            (message  "Package `%s' installed." name))
> > -      (message "`%s' is already installed" name))))
> > +      (message "`%s' is already installed" name)
> > +      nil)))
> >
> >  (declare-function package-vc-upgrade "package-vc" (pkg))
> >
> > @@ -2587,7 +2598,7 @@ package-reinstall
> >    (package-delete
> >     (if (package-desc-p pkg) pkg (cadr (assq pkg package-alist)))
> >     'force 'nosave)
> > -  (package-install pkg 'dont-select))
> > +  (package-install pkg 'dont-select 'allow-mult-or-reinstall))
> >
> >  ;;;###autoload
> >  (defun package-recompile (pkg)
> > @@ -3051,10 +3062,31 @@ package-install-button-action
> >  Used for the `action' property of buttons in the buffer created by
> >  `describe-package'."
> >    (let ((pkg-desc (button-get button 'package-desc)))
> > -    (when (y-or-n-p (format-message "Install package `%s'? "
> > -                                    (package-desc-full-name pkg-desc))=
)
> > -      (package-install pkg-desc nil)
> > -      (describe-package (package-desc-name pkg-desc)))))
> > +    (if (package-installed-p (package-desc-name pkg-desc))
> > +        (let ((installed-pkg-desc (cadr (assq
> > +                                         (package-desc-name pkg-desc)
> > +                                         package-alist))))
> > +          (pcase (let ((read-answer-short t))
> > +                   (read-answer
> > +                    (format-message
> > +                     "Replace `%s' with `%s', or Install both (advance=
d
> users) "
> > +                     (package-desc-full-name installed-pkg-desc)
> > +                     (package-desc-full-name pkg-desc))
> > +                    '(("replace" ?r "Replace existing")
> > +                      ("install" ?i "Install both")
> > +                      ("help" ?h "Help")
> > +                      ("quit" ?q "Quit to abort"))))
> > +            ("replace"
> > +             (package-delete installed-pkg-desc 'force 'dont-unselect)
> > +             (when (package-install pkg-desc nil)
> > +               (describe-package (package-desc-name pkg-desc))))
> > +            ("install"
> > +             (when (package-install pkg-desc nil
> 'allow-mult-or-reinstall)
> > +               (describe-package (package-desc-name pkg-desc))))))
> > +      (when (y-or-n-p (format-message "Install package `%s'? "
> > +                                      (package-desc-full-name
> pkg-desc)))
> > +        (when (package-install pkg-desc nil)
> > +          (describe-package (package-desc-name pkg-desc)))))))
> >
> >  (defun package-delete-button-action (button)
> >    "Run `package-delete' on the package BUTTON points to.
> > diff --git a/test/lisp/emacs-lisp/package-tests.el
> b/test/lisp/emacs-lisp/package-tests.el
> > index d8e260319bd..36617ed6f6e 100644
> > --- a/test/lisp/emacs-lisp/package-tests.el
> > +++ b/test/lisp/emacs-lisp/package-tests.el
> > @@ -248,6 +248,10 @@ package-test-install-single
> >        (should (string-match "^[`=E2=80=98']simple-single[=E2=80=99'] i=
s already
> installed\n?\\'"
> >                              (buffer-string))))
> >      (should (package-installed-p 'simple-single))
> > +    ;; Test for `package-install' already installed using a
> > +    ;; package-desc.  `package-install' returns nil if already
> > +    ;; installed.
> > +    (should-not (package-install simple-single-desc))
> >      (let* ((simple-pkg-dir (file-name-as-directory
> >                              (expand-file-name
> >                               "simple-single-1.3"
>
> For some reason I find this patch very difficult to follow...  Perhaps I
> don't understand the issue you are trying to fix, or how it is related
> to your patch.
>

The issue is that package install will install multiple versions of the
same package (from the same archive) without warning.  This will and does
confuse users especially using the interactive package menu.  The patch
works for me.

The related issue is that multiple versions of the same packages that come
from different archives are also installed but this patch does not attempt
to deal with that.  I proposed that we segregate archives under the package
tree to ease the package infrastructure's ability to detect that.

--00000000000059da380635f73436
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 Sun, May 25, 2025 at 11:01=E2=80=AFAM Philip Kaludercic &lt;<a href=3D"m=
ailto:philipk@HIDDEN">philipk@HIDDEN</a>&gt; wrote:</span></div></d=
iv><div class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gm=
ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,=
204,204);padding-left:1ex">Ship Mints &lt;<a href=3D"mailto:shipmints@gmail=
.com" target=3D"_blank">shipmints@HIDDEN</a>&gt; writes:<br>
<br>
<br>
[...]<br>
<br>
&gt;&gt; Can you please summarise the relevant parts of this discussion?=C2=
=A0 I see<br>
&gt;&gt; that a patch is being mentioned above, should I review it?<br>
&gt;&gt;<br>
&gt;<br>
&gt; The latest version of this patch from this discussion is attached.=C2=
=A0 It<br>
&gt; amends both the menu-driven package upgrade and the package-upgrade co=
mmand<br>
&gt; to assist the user with avoiding (or permitting) installing a package =
more<br>
&gt; than once.<br>
&gt;<br>
<br>
[...]<br>
<br>
&gt;<br>
&gt; -Stephane<br>
&gt; From 9deee448e27f94c21469e59677fde2cbce8f9bcd Mon Sep 17 00:00:00 2001=
<br>
&gt; From: shipmints &lt;<a href=3D"mailto:shipmints@HIDDEN" target=3D"_=
blank">shipmints@HIDDEN</a>&gt;<br>
&gt; Date: Wed, 5 Mar 2025 11:33:07 -0500<br>
&gt; Subject: [PATCH] Correct &#39;package-install&#39; to detect installed=
 packages<br>
&gt;=C2=A0 (bug#76568)<br>
&gt;<br>
&gt; * lisp/emacs-lisp/package.el<br>
&gt; (package-install): Check for already installed package using its symbo=
l<br>
&gt; rather than rely on differing archive directory structures.=C2=A0 Retu=
rn t if<br>
&gt; installed, nil otherwise.<br>
&gt; (package-install-button-action): &#39;describe-package&#39; only when<=
br>
&gt; &#39;package-install&#39; actually installed the package.=C2=A0 Prompt=
 the user to<br>
&gt; install or upgrade an already installed package.<br>
&gt; * test/lisp/emacs-lisp/package-tests.el (package-test-install-single):=
<br>
&gt; Add already-installed test using &#39;package-install&#39; with a<br>
&gt; &#39;package-desc&#39;.<br>
&gt; ---<br>
&gt;=C2=A0 lisp/emacs-lisp/package.el=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 | 54 +++++++++++++++++++++------<br>
&gt;=C2=A0 test/lisp/emacs-lisp/package-tests.el |=C2=A0 4 ++<br>
&gt;=C2=A0 2 files changed, 47 insertions(+), 11 deletions(-)<br>
&gt;<br>
&gt; diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el<b=
r>
&gt; index 8d498c216dc..7c7e99168aa 100644<br>
&gt; --- a/lisp/emacs-lisp/package.el<br>
&gt; +++ b/lisp/emacs-lisp/package.el<br>
&gt; @@ -2194,7 +2194,7 @@ package-install-upgrade-built-in<br>
&gt;=C2=A0 =C2=A0 :version &quot;29.1&quot;)<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 ;;;###autoload<br>
&gt; -(defun package-install (pkg &amp;optional dont-select)<br>
&gt; +(defun package-install (pkg &amp;optional dont-select allow-mult-or-r=
einstall)<br>
&gt;=C2=A0 =C2=A0 &quot;Install the package PKG.<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 PKG can be a `package-desc&#39;, or a symbol naming one of the a=
vailable<br>
&gt; @@ -2207,8 +2207,13 @@ package-install<br>
&gt;=C2=A0 non-nil, install the package but do not add it to<br>
&gt;=C2=A0 `package-selected-packages&#39;.<br>
&gt;=C2=A0 <br>
&gt; -If PKG is a `package-desc&#39; and it is already installed, don&#39;t=
 try<br>
&gt; -to install it but still mark it as selected.<br>
&gt; +When called from Lisp and optional argument ALLOW-MULT-OR-REINSTALL i=
s<br>
&gt; +non-nil, install the package even if it is already installed from<br>
&gt; +another source, allowing more than one simultaneous version.<br>
&gt; +<br>
&gt; +If PKG is a `package-desc&#39; and it is already installed, and<br>
&gt; +ALLOW-MULT-OR-REINSTALL is nil, don&#39;t try to install it but still=
 mark<br>
&gt; +it as selected.<br>
<br>
Why is this yet another optional argument, instead of a user option?<br></b=
lockquote><div><br></div><div><div class=3D"gmail_default" style=3D"font-fa=
mily:monospace">As the maintainer, you pick what suits your taste.</div></d=
iv><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px=
 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt;=C2=A0 <br>
&gt;=C2=A0 If the command is invoked with a prefix argument, it will allow<=
br>
&gt;=C2=A0 upgrading of built-in packages, as if `package-install-upgrade-b=
uilt-in&#39;<br>
&gt; @@ -2243,16 +2248,22 @@ package-install<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(package-=
-active-built-in-p pkg))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq pkg (or (cadr (assq name package-arch=
ive-contents)) pkg)))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 (if-let* ((transaction<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Test for al=
ready installed using the pkg symbol, not<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; the archive=
-specific directory structure.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if (pack=
age-desc-p pkg)<br>
&gt; -=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>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
(unless (and (not allow-mult-or-reinstall)<br>
&gt; +=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-installed-p (package-de=
sc-name pkg)))<br>
&gt;=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-compute-transaction (list pkg)<br>
&gt;=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 =C2=A0 (package-desc-reqs pkg)))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(packag=
e-compute-transaction () (list (list pkg))))))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(unless=
 (and (not allow-mult-or-reinstall)<br>
&gt; +=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-installed-p pkg))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
(package-compute-transaction () (list (list pkg)))))))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (progn<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (package-download-transaction=
 transaction)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (package--quickstart-maybe-re=
fresh)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message=C2=A0 &quot;Package =
`%s&#39; installed.&quot; name))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 (message &quot;`%s&#39; is already installed&quo=
t; name))))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 (message &quot;`%s&#39; is already installed&quo=
t; name)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 nil)))<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 (declare-function package-vc-upgrade &quot;package-vc&quot; (pkg=
))<br>
&gt;=C2=A0 <br>
&gt; @@ -2587,7 +2598,7 @@ package-reinstall<br>
&gt;=C2=A0 =C2=A0 (package-delete<br>
&gt;=C2=A0 =C2=A0 =C2=A0(if (package-desc-p pkg) pkg (cadr (assq pkg packag=
e-alist)))<br>
&gt;=C2=A0 =C2=A0 =C2=A0&#39;force &#39;nosave)<br>
&gt; -=C2=A0 (package-install pkg &#39;dont-select))<br>
&gt; +=C2=A0 (package-install pkg &#39;dont-select &#39;allow-mult-or-reins=
tall))<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 ;;;###autoload<br>
&gt;=C2=A0 (defun package-recompile (pkg)<br>
&gt; @@ -3051,10 +3062,31 @@ package-install-button-action<br>
&gt;=C2=A0 Used for the `action&#39; property of buttons in the buffer crea=
ted by<br>
&gt;=C2=A0 `describe-package&#39;.&quot;<br>
&gt;=C2=A0 =C2=A0 (let ((pkg-desc (button-get button &#39;package-desc)))<b=
r>
&gt; -=C2=A0 =C2=A0 (when (y-or-n-p (format-message &quot;Install package `=
%s&#39;? &quot;<br>
&gt; -=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-full=
-name pkg-desc)))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 (package-install pkg-desc nil)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 (describe-package (package-desc-name pkg-desc)))=
))<br>
&gt; +=C2=A0 =C2=A0 (if (package-installed-p (package-desc-name pkg-desc))<=
br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((installed-pkg-desc (cadr (assq<br>
&gt; +=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-name pkg-desc)<br>
&gt; +=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=
=A0package-alist))))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (pcase (let ((read-answer-short t)=
)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
(read-answer<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 (format-message<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0&quot;Replace `%s&#39; with `%s&#39;, or Install both (advanced user=
s) &quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0(package-desc-full-name installed-pkg-desc)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0(package-desc-full-name pkg-desc))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 &#39;((&quot;replace&quot; ?r &quot;Replace existing&quot;)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 (&quot;install&quot; ?i &quot;Install both&quot;)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 (&quot;help&quot; ?h &quot;Help&quot;)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 (&quot;quit&quot; ?q &quot;Quit to abort&quot;))))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (&quot;replace&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(package-delete insta=
lled-pkg-desc &#39;force &#39;dont-unselect)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when (package-instal=
l pkg-desc nil)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(describe-pack=
age (package-desc-name pkg-desc))))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (&quot;install&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when (package-instal=
l pkg-desc nil &#39;allow-mult-or-reinstall)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(describe-pack=
age (package-desc-name pkg-desc))))))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 (when (y-or-n-p (format-message &quot;Install pa=
ckage `%s&#39;? &quot;<br>
&gt; +=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-de=
sc-full-name pkg-desc)))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (when (package-install pkg-desc nil)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (describe-package (package-desc-na=
me pkg-desc)))))))<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 (defun package-delete-button-action (button)<br>
&gt;=C2=A0 =C2=A0 &quot;Run `package-delete&#39; on the package BUTTON poin=
ts to.<br>
&gt; diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-l=
isp/package-tests.el<br>
&gt; index d8e260319bd..36617ed6f6e 100644<br>
&gt; --- a/test/lisp/emacs-lisp/package-tests.el<br>
&gt; +++ b/test/lisp/emacs-lisp/package-tests.el<br>
&gt; @@ -248,6 +248,10 @@ package-test-install-single<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 (should (string-match &quot;^[`=E2=80=98&#3=
9;]simple-single[=E2=80=99&#39;] is already installed\n?\\&#39;&quot;<br>
&gt;=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 (buffer-string))))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 (should (package-installed-p &#39;simple-single))<=
br>
&gt; +=C2=A0 =C2=A0 ;; Test for `package-install&#39; already installed usi=
ng a<br>
&gt; +=C2=A0 =C2=A0 ;; package-desc.=C2=A0 `package-install&#39; returns ni=
l if already<br>
&gt; +=C2=A0 =C2=A0 ;; installed.<br>
&gt; +=C2=A0 =C2=A0 (should-not (package-install simple-single-desc))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 (let* ((simple-pkg-dir (file-name-as-directory<br>
&gt;=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 (expand-file-name<br>
&gt;=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&quot;simple-single-1.3&quot;<br>
<br>
For some reason I find this patch very difficult to follow...=C2=A0 Perhaps=
 I<br>
don&#39;t understand the issue you are trying to fix, or how it is related<=
br>
to your patch.<br></blockquote><div><br></div><div class=3D"gmail_default" =
style=3D"font-family:monospace">The issue is that package install will inst=
all multiple versions of the same package (from the same archive) without w=
arning.=C2=A0 This will and does confuse users especially using the interac=
tive package menu.=C2=A0 The patch works for me.</div><div class=3D"gmail_d=
efault" style=3D"font-family:monospace"><br></div><div class=3D"gmail_defau=
lt" style=3D"font-family:monospace">The related issue is that multiple vers=
ions of the same packages that come from different archives are also instal=
led but this patch does not attempt to deal with that.=C2=A0 I proposed tha=
t we segregate archives under the package tree to ease the package infrastr=
ucture&#39;s ability to detect that.</div></div></div>

--00000000000059da380635f73436--




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; 25 May 2025 15:02:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 25 11:02:05 2025
Received: from localhost ([127.0.0.1]:46646 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uJCrU-00031G-DY
	for submit <at> debbugs.gnu.org; Sun, 25 May 2025 11:02:05 -0400
Received: from mout02.posteo.de ([185.67.36.66]:51209)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <philipk@HIDDEN>)
 id 1uJCrR-00030R-39
 for 76568 <at> debbugs.gnu.org; Sun, 25 May 2025 11:02:02 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id B65D5240101
 for <76568 <at> debbugs.gnu.org>; Sun, 25 May 2025 17:01:54 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1748185314; bh=eQHS9Rl2YMdREx4AmQNBL9hWG0NAssEMS3fNpQz6ucw=;
 h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version:
 Content-Type:Content-Transfer-Encoding:From;
 b=Tzh99lxZZJuz1R/b5H2zzaCIDHyrcpWf00LlA96iU4ayMeyXYPYcFIbaO28LV+Jyl
 1x99O3YXGuBZe8KsE/fjjQwx2IL+xJK+Ge3x/kiixwAMV5XE/Wz9PbfGlgXiZwhoas
 1Df4QPiY4ds3LpDAXpQr3FepK1MVqbIikPgliWzFUfz1YBG/cNcyQgL50EbFaqtkZQ
 /hIXkqOQjYyrWRcGEJbihMPn+x7RREURIV0WQxzsL2CpTyPiXAVduxcbrbgbp1xMeD
 pAyBiN5DkqhnHXr4bbg9NflxQNB1DCcIXltbg5Uf0aGzdsA0ZOY+bqkPJP6a4h99SO
 nDl6SZW4iOBWA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4b52DK602Gz9rxF;
 Sun, 25 May 2025 17:01:53 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Ship Mints <shipmints@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
In-Reply-To: <CAN+1Hboh1pJpFzk41dMEfXjYXnUjX7fC8MsNLmNf=Mf5c-5S9A@HIDDEN>
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
 <CAN+1Hbrpk7USpx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/qMHvSCeU/hw9PL6u6R2EScxtpKnWof
 z4oM
OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66;
 url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66";
 preference=signencrypt
Date: Sun, 25 May 2025 15:01:53 +0000
Message-ID: <87y0uklony.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -3.3 (---)
X-Debbugs-Envelope-To: 76568
Cc: 76568 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Stefan Kangas <stefankangas@HIDDEN>
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: -4.3 (----)

Ship Mints <shipmints@HIDDEN> writes:


[...]

>> Can you please summarise the relevant parts of this discussion?  I see
>> that a patch is being mentioned above, should I review it?
>>
>
> The latest version of this patch from this discussion is attached.  It
> amends both the menu-driven package upgrade and the package-upgrade comma=
nd
> to assist the user with avoiding (or permitting) installing a package more
> than once.
>

[...]

>
> -Stephane
> From 9deee448e27f94c21469e59677fde2cbce8f9bcd Mon Sep 17 00:00:00 2001
> From: shipmints <shipmints@HIDDEN>
> Date: Wed, 5 Mar 2025 11:33:07 -0500
> Subject: [PATCH] Correct 'package-install' to detect installed packages
>  (bug#76568)
>
> * lisp/emacs-lisp/package.el
> (package-install): Check for already installed package using its symbol
> rather than rely on differing archive directory structures.  Return t if
> installed, nil otherwise.
> (package-install-button-action): 'describe-package' only when
> 'package-install' actually installed the package.  Prompt the user to
> install or upgrade an already installed package.
> * test/lisp/emacs-lisp/package-tests.el (package-test-install-single):
> Add already-installed test using 'package-install' with a
> 'package-desc'.
> ---
>  lisp/emacs-lisp/package.el            | 54 +++++++++++++++++++++------
>  test/lisp/emacs-lisp/package-tests.el |  4 ++
>  2 files changed, 47 insertions(+), 11 deletions(-)
>
> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index 8d498c216dc..7c7e99168aa 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -2194,7 +2194,7 @@ package-install-upgrade-built-in
>    :version "29.1")
>=20=20
>  ;;;###autoload
> -(defun package-install (pkg &optional dont-select)
> +(defun package-install (pkg &optional dont-select allow-mult-or-reinstal=
l)
>    "Install the package PKG.
>=20=20
>  PKG can be a `package-desc', or a symbol naming one of the available
> @@ -2207,8 +2207,13 @@ package-install
>  non-nil, install the package but do not add it to
>  `package-selected-packages'.
>=20=20
> -If PKG is a `package-desc' and it is already installed, don't try
> -to install it but still mark it as selected.
> +When called from Lisp and optional argument ALLOW-MULT-OR-REINSTALL is
> +non-nil, install the package even if it is already installed from
> +another source, allowing more than one simultaneous version.
> +
> +If PKG is a `package-desc' and it is already installed, and
> +ALLOW-MULT-OR-REINSTALL is nil, don't try to install it but still mark
> +it as selected.

Why is this yet another optional argument, instead of a user option?

>=20=20
>  If the command is invoked with a prefix argument, it will allow
>  upgrading of built-in packages, as if `package-install-upgrade-built-in'
> @@ -2243,16 +2248,22 @@ package-install
>                 (package--active-built-in-p pkg))
>        (setq pkg (or (cadr (assq name package-archive-contents)) pkg)))
>      (if-let* ((transaction
> +               ;; Test for already installed using the pkg symbol, not
> +               ;; the archive-specific directory structure.
>                 (if (package-desc-p pkg)
> -                   (unless (package-installed-p pkg)
> +                   (unless (and (not allow-mult-or-reinstall)
> +                                (package-installed-p (package-desc-name =
pkg)))
>                       (package-compute-transaction (list pkg)
>                                                    (package-desc-reqs pkg=
)))
> -                 (package-compute-transaction () (list (list pkg))))))
> +                 (unless (and (not allow-mult-or-reinstall)
> +                              (package-installed-p pkg))
> +                   (package-compute-transaction () (list (list pkg)))))))
>          (progn
>            (package-download-transaction transaction)
>            (package--quickstart-maybe-refresh)
>            (message  "Package `%s' installed." name))
> -      (message "`%s' is already installed" name))))
> +      (message "`%s' is already installed" name)
> +      nil)))
>=20=20
>  (declare-function package-vc-upgrade "package-vc" (pkg))
>=20=20
> @@ -2587,7 +2598,7 @@ package-reinstall
>    (package-delete
>     (if (package-desc-p pkg) pkg (cadr (assq pkg package-alist)))
>     'force 'nosave)
> -  (package-install pkg 'dont-select))
> +  (package-install pkg 'dont-select 'allow-mult-or-reinstall))
>=20=20
>  ;;;###autoload
>  (defun package-recompile (pkg)
> @@ -3051,10 +3062,31 @@ package-install-button-action
>  Used for the `action' property of buttons in the buffer created by
>  `describe-package'."
>    (let ((pkg-desc (button-get button 'package-desc)))
> -    (when (y-or-n-p (format-message "Install package `%s'? "
> -                                    (package-desc-full-name pkg-desc)))
> -      (package-install pkg-desc nil)
> -      (describe-package (package-desc-name pkg-desc)))))
> +    (if (package-installed-p (package-desc-name pkg-desc))
> +        (let ((installed-pkg-desc (cadr (assq
> +                                         (package-desc-name pkg-desc)
> +                                         package-alist))))
> +          (pcase (let ((read-answer-short t))
> +                   (read-answer
> +                    (format-message
> +                     "Replace `%s' with `%s', or Install both (advanced =
users) "
> +                     (package-desc-full-name installed-pkg-desc)
> +                     (package-desc-full-name pkg-desc))
> +                    '(("replace" ?r "Replace existing")
> +                      ("install" ?i "Install both")
> +                      ("help" ?h "Help")
> +                      ("quit" ?q "Quit to abort"))))
> +            ("replace"
> +             (package-delete installed-pkg-desc 'force 'dont-unselect)
> +             (when (package-install pkg-desc nil)
> +               (describe-package (package-desc-name pkg-desc))))
> +            ("install"
> +             (when (package-install pkg-desc nil 'allow-mult-or-reinstal=
l)
> +               (describe-package (package-desc-name pkg-desc))))))
> +      (when (y-or-n-p (format-message "Install package `%s'? "
> +                                      (package-desc-full-name pkg-desc)))
> +        (when (package-install pkg-desc nil)
> +          (describe-package (package-desc-name pkg-desc)))))))
>=20=20
>  (defun package-delete-button-action (button)
>    "Run `package-delete' on the package BUTTON points to.
> diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp=
/package-tests.el
> index d8e260319bd..36617ed6f6e 100644
> --- a/test/lisp/emacs-lisp/package-tests.el
> +++ b/test/lisp/emacs-lisp/package-tests.el
> @@ -248,6 +248,10 @@ package-test-install-single
>        (should (string-match "^[`=E2=80=98']simple-single[=E2=80=99'] is =
already installed\n?\\'"
>                              (buffer-string))))
>      (should (package-installed-p 'simple-single))
> +    ;; Test for `package-install' already installed using a
> +    ;; package-desc.  `package-install' returns nil if already
> +    ;; installed.
> +    (should-not (package-install simple-single-desc))
>      (let* ((simple-pkg-dir (file-name-as-directory
>                              (expand-file-name
>                               "simple-single-1.3"

For some reason I find this patch very difficult to follow...  Perhaps I
don't understand the issue you are trying to fix, or how it is related
to your patch.




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; 24 May 2025 09:13:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 24 05:13:29 2025
Received: from localhost ([127.0.0.1]:57023 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uIkwb-00085L-3v
	for submit <at> debbugs.gnu.org; Sat, 24 May 2025 05:13:29 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:33980)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uIkwY-00084q-L4
 for 76568 <at> debbugs.gnu.org; Sat, 24 May 2025 05:13:27 -0400
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 1uIkwT-0001a4-41; Sat, 24 May 2025 05:13:21 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=vXixUiZM7OcRBhfBL2HEz/UxGJRTgQFDkXhdEFkRX20=; b=WHLZJVXuqY+URyGjJ8mu
 17RaRPwRYi3vunQDiprw54jV+b1GW1h0SfVcibrnglNCuJfb6yTWFEwW3w590H4SF/VylEN/UkglK
 o43Hpe2qyf+2hMsLNtsOc2aouGRI92QiBFIytIozjduxGEspa380ZSkk4jj1z9CIOE+HVsS2q/DY9
 /vm5WaqgitlPLBR1sAK52fgKLMqytwC2dO81lDrogRfanyyB1Yhv1Fz5L8jqd2nzcuPWO09ixOGs+
 yShtyzO3MLVCoW8F5pMnIDHtuQSVvIsyIITAD2Q2JcAy3fsNwgzDv/OJ7BvFAefZIUQNbCEmqbFub
 9hnaYX8zEi8idw==;
Date: Sat, 24 May 2025 12:13:19 +0300
Message-Id: <86r00e1ids.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: philipk@HIDDEN, Ship Mints <shipmints@HIDDEN>
In-Reply-To: <CAN+1Hboh1pJpFzk41dMEfXjYXnUjX7fC8MsNLmNf=Mf5c-5S9A@HIDDEN>
 (message from Ship Mints on Fri, 16 May 2025 11:42:26 -0400)
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
 <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
 <CAN+1HbqUdBGz5WmTA8aa0Yf=rKEj8Zf=-604C+HmNVUSyJhyTw@HIDDEN>
 <CAN+1Hbo8+aF87-ogd8qJ5C+YXO6Hiww5OytmJDrrUyfp1H+JpA@HIDDEN>
 <CAN+1Hbo8XiRcgNZQB2bLadFrPJEujXDZJdv5Fuj9jEs6goTMzw@HIDDEN>
 <CAN+1HbpYF8+GKJTESnvsi2k-v1fHQykEFoRJx7kzUP3oVL4BVQ@HIDDEN>
 <CAN+1Hbox9VFa=__SZS3Mb8GMuoUVQNtw993yAHVnFRTLre1MOA@HIDDEN>
 <87h61kd0tv.fsf@HIDDEN>
 <CAN+1Hboh1pJpFzk41dMEfXjYXnUjX7fC8MsNLmNf=Mf5c-5S9A@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76568
Cc: 76568 <at> debbugs.gnu.org, stefankangas@HIDDEN
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 (---)

Ping!  Can we make some further progress in this matter?

> From: Ship Mints <shipmints@HIDDEN>
> Date: Fri, 16 May 2025 11:42:26 -0400
> Cc: Stefan Kangas <stefankangas@HIDDEN>, 76568 <at> debbugs.gnu.org, 
> 	Eli Zaretskii <eliz@HIDDEN>
> 
> On Fri, May 16, 2025 at 11:36 AM Philip Kaludercic <philipk@HIDDEN> wrote:
> 
>  Ship Mints <shipmints@HIDDEN> writes:
> 
>  > On Thu, Mar 20, 2025 at 10:41 AM Ship Mints <shipmints@HIDDEN> wrote:
>  >
>  >> On Fri, Mar 7, 2025 at 6:33 AM Ship Mints <shipmints@HIDDEN> wrote:
>  >>
>  >>> On Wed, Mar 5, 2025 at 4:05 PM Ship Mints <shipmints@HIDDEN> wrote:
>  >>>
>  >>>> On Wed, Mar 5, 2025 at 4:02 PM Ship Mints <shipmints@HIDDEN> wrote:
>  >>>>
>  >>>>> On Wed, Mar 5, 2025 at 2:55 PM Ship Mints <shipmints@HIDDEN> wrote:
>  >>>>>
>  >>>>>> On Wed, Mar 5, 2025 at 12:00 PM Ship Mints <shipmints@HIDDEN>
>  >>>>>> wrote:
>  >>>>>>
>  >>>>>>> On Mon, Mar 3, 2025 at 9:34 PM Stefan Kangas <stefankangas@HIDDEN>
>  >>>>>>> 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.
>  >>>>>>>
>  >>>>>>
>  >>>>>> Thinking about it a bit more, this patch needs a little more work.  The
>  >>>>>> menu-driven package "upgrade" in describe-package-1 workflow will be interrupted by
>  >>>>>> this patch.  It does not differentiate install vs. upgrade and calls
>  >>>>>> package-install which will now complain the package already exists.  This
>  >>>>>> should be changed to run package-upgrade.  I'll take a look.
>  >>>>>>
>  >>>>>> Any feedback on the minimal patch is still welcome in the meantime.
>  >>>>>>
>  >>>>>
>  >>>>> This patch now accommodates both scenarios.
>  >>>>>
>  >>>>
>  >>>> Now with an amended commit log.
>  >>>>
>  >>>
>  >>> Attached patch with improved package replacement prompt.
>  >>>
>  >>
>  >> Here's a refined version of the patch which allows users to optionally
>  >> replace already-installed packages, or install/keep both.
>  >>
>  >> Testing this revealed some interesting other issues which may already be
>  >> known.  I'll see if I can find bug reports and if not I'll submit new
>  >> ones.  One example is that packages from different archives have
>  >> incompatible version numbering schemes which causes false positives with
>  >> the obsolete package detection mechanism.  Another is that
>  >> package-reinstall does not respect the originating archive, instead
>  >> preferring package-archive-priorities which may install a different version
>  >> than is expected by a user.  Now might be a good time to consider that
>  >> packages should be installed in archive-specific subdirectories rather than
>  >> commingling them?
>  >>
>  >> I'd appreciate it if some others would look at this and test it.  It might
>  >> be adequate as a stop-gap for its intended purpose to avoid casual
>  >> duplicate installs and some feedback would help.
>  >>
>  >
>  > This bug/patch seems to have languished.  It would be good to get it done.
>  > Duplicate installed packages are annoying to say the least.
> 
>  Can you please summarise the relevant parts of this discussion?  I see
>  that a patch is being mentioned above, should I review it?
> 
> The latest version of this patch from this discussion is attached.  It amends both the menu-driven package
> upgrade and the package-upgrade command to assist the user with avoiding (or permitting) installing a
> package more than once.
> 
> I introduced "tangents" in the discussion along the way as I learned more about the package infrastructure:
> 
> "Testing this revealed some interesting other issues which may already be known.  I'll see if I can find bug
> reports and if not I'll submit new ones.  One example is that packages from different archives have
> incompatible version numbering schemes which causes false positives with the obsolete package detection
> mechanism.  Another is that package-reinstall does not respect the originating archive, instead preferring
> package-archive-priorities which may install a different version than is expected by a user.  Now might be a
> good time to consider that packages should be installed in archive-specific subdirectories rather than
> commingling them?"
> 
> -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; 16 May 2025 15:42:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 16 11:42:51 2025
Received: from localhost ([127.0.0.1]:40217 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uFxCy-0005Rq-5p
	for submit <at> debbugs.gnu.org; Fri, 16 May 2025 11:42:51 -0400
Received: from mail-vs1-xe2f.google.com ([2607:f8b0:4864:20::e2f]:57613)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1uFxCu-0005Qb-48
 for 76568 <at> debbugs.gnu.org; Fri, 16 May 2025 11:42:45 -0400
Received: by mail-vs1-xe2f.google.com with SMTP id
 ada2fe7eead31-4df85b07189so1457104137.3
 for <76568 <at> debbugs.gnu.org>; Fri, 16 May 2025 08:42:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1747410158; x=1748014958; 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=ssTeKoF0YEKMBTl0oGlxoHnmpmdIKWL79GdEYFFgS9E=;
 b=N1zbSCrdZrj9CYMg3XfpsxJvzG2lpUwXJyZ3ZcBBKoN23eq4VYJjiAWFDfRcNzTa+a
 7odHrjMYjRIPPfPkir3EKps4db1nylnInQenIty/tfGKr2bTyoQznjsvGNF1NSOqIcgD
 ZxBwx8uQYTA9ZYTD3cbNWkyYWAw2ajD5sUnaXiZZOerbXBfl9rGI9mIQ8urcHnT16kSm
 0ImVscR8NQBswHxIaJY5LP3CKZ1fRH+bt5gupT/TzwLK0IpSX97YEWwh0bsXpo8cfKIK
 17QrUtURcSbMUiiky90/E47f2BUqPUxRpafDVJFPNsl7hbqRPgRIZckIg2GaptBYJ45L
 aKBg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1747410158; x=1748014958;
 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=ssTeKoF0YEKMBTl0oGlxoHnmpmdIKWL79GdEYFFgS9E=;
 b=M8PpGxt7awJ8IGjA8FVeY6Yrm1Ooyrtqwm6deLDBN3gnmAM7jvSE9yUwK2A1t33Okp
 i7P2M1vEd/i4o0QPPE7Ck+pOc7AFnhBN11JbGfIPlke/smjbO3QqVPaQiZxMz0kZpU9p
 vItcSTuCoVp98czwNGmDKuvLCXAYj0K5caY54cwX4YDrR80/14u8A62Z57tmZtSRZLNU
 fvqrdgoMU6iH3FbrSnVXZCqrX7fwo4JHFcqXOSscnMApbb/aK1B+jFH8R8IZUV1R1zQD
 VTtcLVeno2c4CKfTzS/W1GryWbxA4w5Ynryw7vAfdld4xFA18cKzQy6aYi4JYmHqGMML
 sabA==
X-Forwarded-Encrypted: i=1;
 AJvYcCWpJjCMxVSxwkGUYIFZnuQtRJt1wuOd1mS9ZgQJ6YrVYgiwqdg46MiBNpeuIURzkvMfKZM3vg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxMkME8wUjPUVMfbD/fS8BxOE0BufqxM70C1WIzfI2fMQuadVaZ
 inOvHiPbJQT82o2UuX0B9ABcPmMarVDhf/NSyqBcBfDqYTitYJZ9kmjkdX2+lPcF/RxjWbIQX5b
 Lr6hGo0pmtiHgnDPrgwEuxepyvTrLwQA=
X-Gm-Gg: ASbGnct0LE8QxzTKHZEm7ieL9gDW+3UBhWUb41sUiCdcgc4p4wKIFC+ZDsqtorceSHQ
 AyTUn9Jbifqxo1MA48Nrx+h7eZsx8CjyvWJpjYktn7oj4TXqxYh1neDyFg9YaIUSwHeHxZLbUbk
 Yulox20rLWSzZcnFEY40GpbuL64ApL1l5qM8/dzvuMNhq0FA==
X-Google-Smtp-Source: AGHT+IEyUCDkZeh8w54k+EC7J1sTh5TYv7EZ2gqk676WVlJbywUo5dBIGhPcLBGf7Wz4+5XbcM4Mo/5s9Vbyu8XMEn0=
X-Received: by 2002:a05:6102:14a1:b0:4df:a58d:9db2 with SMTP id
 ada2fe7eead31-4dfa6b586f8mr5737410137.9.1747410158320; Fri, 16 May 2025
 08:42:38 -0700 (PDT)
MIME-Version: 1.0
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
 <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
 <CAN+1HbqUdBGz5WmTA8aa0Yf=rKEj8Zf=-604C+HmNVUSyJhyTw@HIDDEN>
 <CAN+1Hbo8+aF87-ogd8qJ5C+YXO6Hiww5OytmJDrrUyfp1H+JpA@HIDDEN>
 <CAN+1Hbo8XiRcgNZQB2bLadFrPJEujXDZJdv5Fuj9jEs6goTMzw@HIDDEN>
 <CAN+1HbpYF8+GKJTESnvsi2k-v1fHQykEFoRJx7kzUP3oVL4BVQ@HIDDEN>
 <CAN+1Hbox9VFa=__SZS3Mb8GMuoUVQNtw993yAHVnFRTLre1MOA@HIDDEN>
 <87h61kd0tv.fsf@HIDDEN>
In-Reply-To: <87h61kd0tv.fsf@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Fri, 16 May 2025 11:42:26 -0400
X-Gm-Features: AX0GCFsW5hm_UA_Cl4jmBrfRkdUWkmwufApAVVYynJ6OOU8WrfDvp20yfA1AlJE
Message-ID: <CAN+1Hboh1pJpFzk41dMEfXjYXnUjX7fC8MsNLmNf=Mf5c-5S9A@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
To: Philip Kaludercic <philipk@HIDDEN>
Content-Type: multipart/mixed; boundary="000000000000c39f40063542a160"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76568
Cc: 76568 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Stefan Kangas <stefankangas@HIDDEN>
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 (-)

--000000000000c39f40063542a160
Content-Type: multipart/alternative; boundary="000000000000c39f3f063542a15e"

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

On Fri, May 16, 2025 at 11:36=E2=80=AFAM Philip Kaludercic <philipk@posteo.=
net>
wrote:

> Ship Mints <shipmints@HIDDEN> writes:
>
> > On Thu, Mar 20, 2025 at 10:41=E2=80=AFAM Ship Mints <shipmints@HIDDEN=
m> wrote:
> >
> >> On Fri, Mar 7, 2025 at 6:33=E2=80=AFAM Ship Mints <shipmints@HIDDEN=
> wrote:
> >>
> >>> On Wed, Mar 5, 2025 at 4:05=E2=80=AFPM Ship Mints <shipmints@HIDDEN=
m> wrote:
> >>>
> >>>> On Wed, Mar 5, 2025 at 4:02=E2=80=AFPM Ship Mints <shipmints@HIDDEN=
om>
> wrote:
> >>>>
> >>>>> On Wed, Mar 5, 2025 at 2:55=E2=80=AFPM Ship Mints <shipmints@gmail.=
com>
> wrote:
> >>>>>
> >>>>>> On Wed, Mar 5, 2025 at 12:00=E2=80=AFPM Ship Mints <shipmints@gmai=
l.com>
> >>>>>> wrote:
> >>>>>>
> >>>>>>> On Mon, Mar 3, 2025 at 9:34=E2=80=AFPM Stefan Kangas <
> stefankangas@HIDDEN>
> >>>>>>> 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 an=
d
> >>>>>>>> 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 spe=
c,
> >>>>>>>> and incorrectly checks to
> >>>>>>>> > see if the package is already installed.  Interactive invocati=
on
> >>>>>>>> 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 th=
e
> >>>>>>> already installed message.  It could suggest to the user to remov=
e
> and then
> >>>>>>> install or we could offer to use package upgrade to the chosen
> >>>>>>> package-desc.  At the very least, the patch prevents duplicates.
> >>>>>>>
> >>>>>>
> >>>>>> Thinking about it a bit more, this patch needs a little more work.
> The
> >>>>>> menu-driven package "upgrade" in describe-package-1 workflow will
> be interrupted by
> >>>>>> this patch.  It does not differentiate install vs. upgrade and cal=
ls
> >>>>>> package-install which will now complain the package already
> exists.  This
> >>>>>> should be changed to run package-upgrade.  I'll take a look.
> >>>>>>
> >>>>>> Any feedback on the minimal patch is still welcome in the meantime=
.
> >>>>>>
> >>>>>
> >>>>> This patch now accommodates both scenarios.
> >>>>>
> >>>>
> >>>> Now with an amended commit log.
> >>>>
> >>>
> >>> Attached patch with improved package replacement prompt.
> >>>
> >>
> >> Here's a refined version of the patch which allows users to optionally
> >> replace already-installed packages, or install/keep both.
> >>
> >> Testing this revealed some interesting other issues which may already =
be
> >> known.  I'll see if I can find bug reports and if not I'll submit new
> >> ones.  One example is that packages from different archives have
> >> incompatible version numbering schemes which causes false positives wi=
th
> >> the obsolete package detection mechanism.  Another is that
> >> package-reinstall does not respect the originating archive, instead
> >> preferring package-archive-priorities which may install a different
> version
> >> than is expected by a user.  Now might be a good time to consider that
> >> packages should be installed in archive-specific subdirectories rather
> than
> >> commingling them?
> >>
> >> I'd appreciate it if some others would look at this and test it.  It
> might
> >> be adequate as a stop-gap for its intended purpose to avoid casual
> >> duplicate installs and some feedback would help.
> >>
> >
> > This bug/patch seems to have languished.  It would be good to get it
> done.
> > Duplicate installed packages are annoying to say the least.
>
> Can you please summarise the relevant parts of this discussion?  I see
> that a patch is being mentioned above, should I review it?
>

The latest version of this patch from this discussion is attached.  It
amends both the menu-driven package upgrade and the package-upgrade command
to assist the user with avoiding (or permitting) installing a package more
than once.

I introduced "tangents" in the discussion along the way as I learned more
about the package infrastructure:

"Testing this revealed some interesting other issues which may already be
known.  I'll see if I can find bug reports and if not I'll submit new
ones.  One example is that packages from different archives have
incompatible version numbering schemes which causes false positives with
the obsolete package detection mechanism.  Another is that
package-reinstall does not respect the originating archive, instead
preferring package-archive-priorities which may install a different version
than is expected by a user.  Now might be a good time to consider that
packages should be installed in archive-specific subdirectories rather than
commingling them?"

-Stephane

--000000000000c39f3f063542a15e
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 Fri, May 16, 2025 at 11:36=E2=80=AFAM Philip Kaludercic &lt;<a href=3D"m=
ailto:philipk@HIDDEN">philipk@HIDDEN</a>&gt; wrote:</span></div></d=
iv><div class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gm=
ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,=
204,204);padding-left:1ex">Ship Mints &lt;<a href=3D"mailto:shipmints@gmail=
.com" target=3D"_blank">shipmints@HIDDEN</a>&gt; writes:<br>
<br>
&gt; On Thu, Mar 20, 2025 at 10:41=E2=80=AFAM Ship Mints &lt;<a href=3D"mai=
lto:shipmints@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>&gt; wrot=
e:<br>
&gt;<br>
&gt;&gt; On Fri, Mar 7, 2025 at 6:33=E2=80=AFAM Ship Mints &lt;<a href=3D"m=
ailto:shipmints@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>&gt; wr=
ote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; On Wed, Mar 5, 2025 at 4:05=E2=80=AFPM Ship Mints &lt;<a href=
=3D"mailto:shipmints@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>&g=
t; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Wed, Mar 5, 2025 at 4:02=E2=80=AFPM Ship Mints &lt;<a h=
ref=3D"mailto:shipmints@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a=
>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; On Wed, Mar 5, 2025 at 2:55=E2=80=AFPM Ship Mints &lt;=
<a href=3D"mailto:shipmints@HIDDEN" target=3D"_blank">shipmints@HIDDEN=
m</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; On Wed, Mar 5, 2025 at 12:00=E2=80=AFPM Ship Mints=
 &lt;<a href=3D"mailto:shipmints@HIDDEN" target=3D"_blank">shipmints@gma=
il.com</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; On Mon, Mar 3, 2025 at 9:34=E2=80=AFPM Stefan =
Kangas &lt;<a href=3D"mailto:stefankangas@HIDDEN" target=3D"_blank">stef=
ankangas@HIDDEN</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Ship Mints &lt;<a href=3D"mailto:shipmints=
@gmail.com" target=3D"_blank">shipmints@HIDDEN</a>&gt; writes:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &gt; As part of my production upgrade to 3=
0.1, and before I wrote a<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; program to install my local<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &gt; ELPA tree from scratch, I tried to fi=
rst curate my packages and<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; change from MELPA to<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &gt; generally equivalent GNU ELPA or non-=
GNU ELPA archives.=C2=A0 The<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; result was that I had two of<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &gt; each package installed.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &gt; I think there&#39;s a bug in &#39;pac=
kage-install&#39; which, when invoked from<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &gt; &#39;package-install-button-action&#3=
9;, processes the new package spec,<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; and incorrectly checks to<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &gt; see if the package is already install=
ed.=C2=A0 Interactive invocation<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; of &#39;package-install&#39; yields the<br=
>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &gt; package name from the prompt, not its=
 archive description.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &gt; If the below is correct, I can submit=
 a patch to make<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &#39;package-install&#39; behave like<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &gt; &#39;package-reinstall&#39; for the n=
on-interactive case.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Please submit a patch, but could we also h=
ave tests for this please?<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Thanks in advance.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Patch attached.=C2=A0 It prevents the menu-dri=
ven case from erasing the<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; already installed message.=C2=A0 It could sugg=
est to the user to remove and then<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; install or we could offer to use package upgra=
de to the chosen<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; package-desc.=C2=A0 At the very least, the pat=
ch prevents duplicates.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Thinking about it a bit more, this patch needs a l=
ittle more work.=C2=A0 The<br>
&gt;&gt;&gt;&gt;&gt;&gt; menu-driven package &quot;upgrade&quot; in describ=
e-package-1 workflow will be interrupted by<br>
&gt;&gt;&gt;&gt;&gt;&gt; this patch.=C2=A0 It does not differentiate instal=
l vs. upgrade and calls<br>
&gt;&gt;&gt;&gt;&gt;&gt; package-install which will now complain the packag=
e already exists.=C2=A0 This<br>
&gt;&gt;&gt;&gt;&gt;&gt; should be changed to run package-upgrade.=C2=A0 I&=
#39;ll take a look.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Any feedback on the minimal patch is still welcome=
 in the meantime.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; This patch now accommodates both scenarios.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Now with an amended commit log.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Attached patch with improved package replacement prompt.<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Here&#39;s a refined version of the patch which allows users to op=
tionally<br>
&gt;&gt; replace already-installed packages, or install/keep both.<br>
&gt;&gt;<br>
&gt;&gt; Testing this revealed some interesting other issues which may alre=
ady be<br>
&gt;&gt; known.=C2=A0 I&#39;ll see if I can find bug reports and if not I&#=
39;ll submit new<br>
&gt;&gt; ones.=C2=A0 One example is that packages from different archives h=
ave<br>
&gt;&gt; incompatible version numbering schemes which causes false positive=
s with<br>
&gt;&gt; the obsolete package detection mechanism.=C2=A0 Another is that<br=
>
&gt;&gt; package-reinstall does not respect the originating archive, instea=
d<br>
&gt;&gt; preferring package-archive-priorities which may install a differen=
t version<br>
&gt;&gt; than is expected by a user.=C2=A0 Now might be a good time to cons=
ider that<br>
&gt;&gt; packages should be installed in archive-specific subdirectories ra=
ther than<br>
&gt;&gt; commingling them?<br>
&gt;&gt;<br>
&gt;&gt; I&#39;d appreciate it if some others would look at this and test i=
t.=C2=A0 It might<br>
&gt;&gt; be adequate as a stop-gap for its intended purpose to avoid casual=
<br>
&gt;&gt; duplicate installs and some feedback would help.<br>
&gt;&gt;<br>
&gt;<br>
&gt; This bug/patch seems to have languished.=C2=A0 It would be good to get=
 it done.<br>
&gt; Duplicate installed packages are annoying to say the least.<br>
<br>
Can you please summarise the relevant parts of this discussion?=C2=A0 I see=
<br>
that a patch is being mentioned above, should I review it?<br></blockquote>=
<div><br></div><div class=3D"gmail_default" style=3D"font-family:monospace"=
>The latest version of this patch from this discussion is attached.=C2=A0 I=
t amends both the menu-driven package upgrade and the package-upgrade comma=
nd to assist the user with avoiding (or permitting) installing a package mo=
re than once.</div><div class=3D"gmail_default" style=3D"font-family:monosp=
ace"><br></div><div class=3D"gmail_default" style=3D"font-family:monospace"=
>I introduced &quot;tangents&quot; in the discussion along the way as I lea=
rned more about the package infrastructure:</div><div class=3D"gmail_defaul=
t" style=3D"font-family:monospace"><br></div><div class=3D"gmail_default" s=
tyle=3D"font-family:monospace">&quot;Testing this revealed some interesting=
 other issues which may already be known.=C2=A0 I&#39;ll see if I can find =
bug reports and if not I&#39;ll submit new ones.=C2=A0 One example is that =
packages from different archives have incompatible version numbering scheme=
s which causes false positives with the obsolete package detection mechanis=
m.=C2=A0 Another is that package-reinstall does not respect the originating=
 archive, instead preferring=C2=A0package-archive-priorities which may inst=
all a different version than is expected by a user.=C2=A0 Now might be a go=
od time to consider that packages should be installed in archive-specific s=
ubdirectories rather than commingling them?&quot;</div><div class=3D"gmail_=
default" style=3D"font-family:monospace"><br></div><div class=3D"gmail_defa=
ult" style=3D"font-family:monospace">-Stephane</div></div></div>

--000000000000c39f3f063542a15e--

--000000000000c39f40063542a160
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_maqyrmoo0>
X-Attachment-Id: f_maqyrmoo0

RnJvbSA5ZGVlZTQ0OGUyN2Y5NGMyMTQ2OWU1OTY3N2ZkZTJjYmNlOGY5YmNkIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBzaGlwbWludHMgPHNoaXBtaW50c0BnbWFpbC5jb20+CkRhdGU6
IFdlZC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AgICAgICAgICAgICAgIChpZiAocGFja2Fn
ZS1kZXNjLXAgcGtnKQotICAgICAgICAgICAgICAgICAgICh1bmxlc3MgKHBhY2thZ2UtaW5zdGFs
bGVkLXAgcGtnKQorICAgICAgICAgICAgICAgICAgICh1bmxlc3MgKGFuZCAobm90IGFsbG93LW11
bHQtb3ItcmVpbnN0YWxsKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocGFja2Fn
ZS1pbnN0YWxsZWQtcCAocGFja2FnZS1kZXNjLW5hbWUgcGtnKSkpCiAgICAgICAgICAgICAgICAg
ICAgICAocGFja2FnZS1jb21wdXRlLXRyYW5zYWN0aW9uIChsaXN0IHBrZykKICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBhY2thZ2UtZGVzYy1yZXFz
IHBrZykpKQotICAgICAgICAgICAgICAgICAocGFja2FnZS1jb21wdXRlLXRyYW5zYWN0aW9uICgp
IChsaXN0IChsaXN0IHBrZykpKSkpKQorICAgICAgICAgICAgICAgICAodW5sZXNzIChhbmQgKG5v
dCBhbGxvdy1tdWx0LW9yLXJlaW5zdGFsbCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IChwYWNrYWdlLWluc3RhbGxlZC1wIHBrZykpCisgICAgICAgICAgICAgICAgICAgKHBhY2thZ2Ut
Y29tcHV0ZS10cmFuc2FjdGlvbiAoKSAobGlzdCAobGlzdCBwa2cpKSkpKSkpCiAgICAgICAgIChw
cm9nbgogICAgICAgICAgIChwYWNrYWdlLWRvd25sb2FkLXRyYW5zYWN0aW9uIHRyYW5zYWN0aW9u
KQogICAgICAgICAgIChwYWNrYWdlLS1xdWlja3N0YXJ0LW1heWJlLXJlZnJlc2gpCiAgICAgICAg
ICAgKG1lc3NhZ2UgICJQYWNrYWdlIGAlcycgaW5zdGFsbGVkLiIgbmFtZSkpCi0gICAgICAobWVz
c2FnZSAiYCVzJyBpcyBhbHJlYWR5IGluc3RhbGxlZCI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AgICAoZGVzY3JpYmUt
cGFja2FnZSAocGFja2FnZS1kZXNjLW5hbWUgcGtnLWRlc2MpKSkpKQorICAgIChpZiAocGFja2Fn
ZS1pbnN0YWxsZWQtcCAocGFja2FnZS1kZXNjLW5hbWUgcGtnLWRlc2MpKQorICAgICAgICAobGV0
ICgoaW5zdGFsbGVkLXBrZy1kZXNjIChjYWRyIChhc3NxCisgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgIChwYWNrYWdlLWRlc2MtbmFtZSBwa2ctZGVzYykKKyAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFja2FnZS1hbGlzdCkpKSkKKyAgICAg
ICAgICAocGNhc2UgKGxldCAoKHJlYWQtYW5zd2VyLXNob3J0IHQpKQorICAgICAgICAgICAgICAg
ICAgIChyZWFkLWFuc3dlcgorICAgICAgICAgICAgICAgICAgICAoZm9ybWF0LW1lc3NhZ2UKKyAg
ICAgICAgICAgICAgICAgICAgICJSZXBsYWNlIGAlcycgd2l0aCBgJXMnLCBvciBJbnN0YWxsIGJv
dGggKGFkdmFuY2VkIHVzZXJzKSAiCisgICAgICAgICAgICAgICAgICAgICAocGFja2FnZS1kZXNj
LWZ1bGwtbmFtZSBpbnN0YWxsZWQtcGtnLWRlc2MpCisgICAgICAgICAgICAgICAgICAgICAocGFj
a2FnZS1kZXNjLWZ1bGwtbmFtZSBwa2ctZGVzYykpCisgICAgICAgICAgICAgICAgICAgICcoKCJy
ZXBsYWNlIiA/ciAiUmVwbGFjZSBleGlzdGluZyIpCisgICAgICAgICAgICAgICAgICAgICAgKCJp
bnN0YWxsIiA/aSAiSW5zdGFsbCBib3RoIikKKyAgICAgICAgICAgICAgICAgICAgICAoImhlbHAi
ID9oICJIZWxwIikKKyAgICAgICAgICAgICAgICAgICAgICAoInF1aXQiID9xICJRdWl0IHRvIGFi
b3J0IikpKSkKKyAgICAgICAgICAgICgicmVwbGFjZSIKKyAgICAgICAgICAgICAocGF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NmUgMTAwNjQ0Ci0tLSBhL3Rlc3QvbGlzcC9lbWFjcy1saXNwL3BhY2thZ2UtdGVz
dHMuZWwKKysrIGIvdGVzdC9saXNwL2VtYWNzLWxpc3AvcGFja2FnZS10ZXN0cy5lbApAQCAtMjQ4
LDYgKzI0OCwxMCBAQCBwYWNrYWdlLXRlc3QtaW5zdGFsbC1zaW5nbGUKICAgICAgIChzaG91bGQg
KHN0cmluZy1tYXRjaCAiXltg4oCYJ11zaW1wbGUtc2luZ2xlW+KAmSddIGlzIGFscmVhZHkgaW5z
dGFsbGVkXG4/XFwnIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIChidWZmZXItc3RyaW5n
KSkpKQogICAgIChzaG91bGQgKHBhY2thZ2UtaW5zdGFsbGVkLXAgJ3NpbXBsZS1zaW5nbGUpKQor
ICAgIDs7IFRlc3QgZm9yIGBwYWNrYWdlLWluc3RhbGwnIGFscmVhZHkgaW5zdGFsbGVkIHVzaW5n
IGEKKyAgICA7OyBwYWNrYWdlLWRlc2MuICBgcGFja2FnZS1pbnN0YWxsJyByZXR1cm5zIG5pbCBp
ZiBhbHJlYWR5CisgICAgOzsgaW5zdGFsbGVkLgorICAgIChzaG91bGQtbm90IChwYWNrYWdlLWlu
c3RhbGwgc2ltcGxlLXNpbmdsZS1kZXNjKSkKICAgICAobGV0KiAoKHNpbXBsZS1wa2ctZGlyIChm
aWxlLW5hbWUtYXMtZGlyZWN0b3J5CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGV4cGFu
ZC1maWxlLW5hbWUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInNpbXBsZS1zaW5nbGUt
MS4zIgotLSAKMi40Ny4xCgo=
--000000000000c39f40063542a160--




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; 16 May 2025 15:36:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 16 11:36:56 2025
Received: from localhost ([127.0.0.1]:40153 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uFx7H-0004gF-B9
	for submit <at> debbugs.gnu.org; Fri, 16 May 2025 11:36:55 -0400
Received: from mout02.posteo.de ([185.67.36.66]:34845)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <philipk@HIDDEN>)
 id 1uFx7E-0004f8-Ir
 for 76568 <at> debbugs.gnu.org; Fri, 16 May 2025 11:36:53 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 7E7EF240103
 for <76568 <at> debbugs.gnu.org>; Fri, 16 May 2025 17:36:46 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1747409806; bh=3cXEAZ9UsPb0cjOyfhv6sq5b85CUAozVUqWHWgTkoq0=;
 h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version:
 Content-Type:Content-Transfer-Encoding:From;
 b=Z3DxLZeXe/mPJhnxrrQJ2YZ7RvQVpPTHzHfz4UGX5VhF87h57mkm8YN2lqbQtFm6n
 UEz5tyJyP8qPaXM1kTseN2uswsXrcPdZPFbddCMLjwTPOKiQjVo0NoKemtBx3r82IK
 3yXrcZjw9Frrc40xOBG2Ro+3HjDiJE4z+V9Ob0I6yQM2hMIkX+MxMKw8pUnH8xl83m
 BVXqB7vMkUYXWN55EqfPzVg6f/YKlHr9ZAkXSagQOQIrwSVKeqhcj33oV3aBI3jEl3
 6Awis4KtfNNXe3IMW7aEqYJ2ja7pJQRoqlN7yOewNOLUDJXsaPM45fWy7ThkNovo8p
 ZqCwD6vbEZ14g==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4ZzWQj2fX9z9rxS;
 Fri, 16 May 2025 17:36:45 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Ship Mints <shipmints@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
In-Reply-To: <CAN+1Hbox9VFa=__SZS3Mb8GMuoUVQNtw993yAHVnFRTLre1MOA@HIDDEN>
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
 <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
 <CAN+1HbqUdBGz5WmTA8aa0Yf=rKEj8Zf=-604C+HmNVUSyJhyTw@HIDDEN>
 <CAN+1Hbo8+aF87-ogd8qJ5C+YXO6Hiww5OytmJDrrUyfp1H+JpA@HIDDEN>
 <CAN+1Hbo8XiRcgNZQB2bLadFrPJEujXDZJdv5Fuj9jEs6goTMzw@HIDDEN>
 <CAN+1HbpYF8+GKJTESnvsi2k-v1fHQykEFoRJx7kzUP3oVL4BVQ@HIDDEN>
 <CAN+1Hbox9VFa=__SZS3Mb8GMuoUVQNtw993yAHVnFRTLre1MOA@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; keydata=
 mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI
 BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0
 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB
 BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE
 Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK
 NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof
 z4oM
OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66;
 url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66";
 preference=signencrypt
Date: Fri, 16 May 2025 15:36:44 +0000
Message-ID: <87h61kd0tv.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76568
Cc: 76568 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Stefan Kangas <stefankangas@HIDDEN>
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 (---)

Ship Mints <shipmints@HIDDEN> writes:

> On Thu, Mar 20, 2025 at 10:41=E2=80=AFAM Ship Mints <shipmints@HIDDEN>=
 wrote:
>
>> On Fri, Mar 7, 2025 at 6:33=E2=80=AFAM Ship Mints <shipmints@HIDDEN> =
wrote:
>>
>>> On Wed, Mar 5, 2025 at 4:05=E2=80=AFPM Ship Mints <shipmints@HIDDEN>=
 wrote:
>>>
>>>> On Wed, Mar 5, 2025 at 4:02=E2=80=AFPM Ship Mints <shipmints@HIDDEN=
> wrote:
>>>>
>>>>> On Wed, Mar 5, 2025 at 2:55=E2=80=AFPM Ship Mints <shipmints@HIDDEN=
m> wrote:
>>>>>
>>>>>> On Wed, Mar 5, 2025 at 12:00=E2=80=AFPM Ship Mints <shipmints@gmail.=
com>
>>>>>> wrote:
>>>>>>
>>>>>>> On Mon, Mar 3, 2025 at 9:34=E2=80=AFPM Stefan Kangas <stefankangas@=
gmail.com>
>>>>>>> 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 f=
rom
>>>>>>>> > '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 pleas=
e?
>>>>>>>>
>>>>>>>> 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.
>>>>>>>
>>>>>>
>>>>>> Thinking about it a bit more, this patch needs a little more work.  =
The
>>>>>> menu-driven package "upgrade" in describe-package-1 workflow will be=
 interrupted by
>>>>>> this patch.  It does not differentiate install vs. upgrade and calls
>>>>>> package-install which will now complain the package already exists. =
 This
>>>>>> should be changed to run package-upgrade.  I'll take a look.
>>>>>>
>>>>>> Any feedback on the minimal patch is still welcome in the meantime.
>>>>>>
>>>>>
>>>>> This patch now accommodates both scenarios.
>>>>>
>>>>
>>>> Now with an amended commit log.
>>>>
>>>
>>> Attached patch with improved package replacement prompt.
>>>
>>
>> Here's a refined version of the patch which allows users to optionally
>> replace already-installed packages, or install/keep both.
>>
>> Testing this revealed some interesting other issues which may already be
>> known.  I'll see if I can find bug reports and if not I'll submit new
>> ones.  One example is that packages from different archives have
>> incompatible version numbering schemes which causes false positives with
>> the obsolete package detection mechanism.  Another is that
>> package-reinstall does not respect the originating archive, instead
>> preferring package-archive-priorities which may install a different vers=
ion
>> than is expected by a user.  Now might be a good time to consider that
>> packages should be installed in archive-specific subdirectories rather t=
han
>> commingling them?
>>
>> I'd appreciate it if some others would look at this and test it.  It mig=
ht
>> be adequate as a stop-gap for its intended purpose to avoid casual
>> duplicate installs and some feedback would help.
>>
>
> This bug/patch seems to have languished.  It would be good to get it done.
> Duplicate installed packages are annoying to say the least.

Can you please summarise the relevant parts of this discussion?  I see
that a patch is being mentioned above, should I review it?




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; 10 May 2025 11:35:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 10 07:35:47 2025
Received: from localhost ([127.0.0.1]:44638 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uDiUc-0001sv-Md
	for submit <at> debbugs.gnu.org; Sat, 10 May 2025 07:35:47 -0400
Received: from mail-ua1-x931.google.com ([2607:f8b0:4864:20::931]:51313)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1uDiUa-0001sN-7D
 for 76568 <at> debbugs.gnu.org; Sat, 10 May 2025 07:35:45 -0400
Received: by mail-ua1-x931.google.com with SMTP id
 a1e0cc1a2514c-87836f883e2so612878241.2
 for <76568 <at> debbugs.gnu.org>; Sat, 10 May 2025 04:35:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1746876938; x=1747481738; 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=wfYA1x3b4N58z0KxoMaaXTnWNHna4av+OMZJD1AP6Ww=;
 b=LLeqjHabwGEKtd3J6u3z4yiWeqPEOSvKpolgeWxQ36e35dn3us0ywtpNAIJbeaCHOI
 DTSreH5Mu/Uz42DLtiuLM8HTu22Ybeb9i55Vnu/a+zMKT/SQ5RX8/z/gxxRg0xuMHWpM
 Pani1eHWxaRvM8QiKyemtGT04XxIm3ZC9x3BSI0qmTGKnz51JfVgNl0/LSPfSgvX/LO8
 hoq04wJqbrega5xYkkRP8f9EOju2BukyAUE5yAKOsNw/AP+CLF5N7YEbnG6mogiB1tnu
 TACZLGQCbh45JlmZC2sbGZzgpuiBQrPnFuhoL8/2hVS85xP+u8nkcTBSmeJ8/11IHnvw
 gSig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1746876938; x=1747481738;
 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=wfYA1x3b4N58z0KxoMaaXTnWNHna4av+OMZJD1AP6Ww=;
 b=lij5QAe+nUQxHlLaZuraHx4tpdkllsZCSRjWFxRrP09b/wNL5gud5obfazcoYw7U5V
 rYhVNCIWqs8pLJlSsRVUOVBaPHIg8TV1pc35GBnfWqcRAABB7KZaEmMYNOOitVrgq5N4
 aXWowkOUEfFjkBw3ckZWi0miobiQRR1WWBwY3n31ypz51fOPprGPVf3p7qKdwV/G0dcj
 ArWfhmS7TceU3Q+Uu4tymwjYmCoGyeRfoYUQo1PX8cEGBNifxLRWL1lTlbC0+ZTknztU
 s1IUye71EtkDviozs1Pj/fy6YSRjsXBmUY/io+V1cct4TAHRCJYyYmP0/CjbFEZ0H1ka
 Ldmg==
X-Gm-Message-State: AOJu0YxIGkPhQELgp2YZBc3KpEK80qD2+NO8r0fIHkGqQu1JuspnwpC3
 40YK5yJEK43OY2jh8/U4mMt7QL2TbQ/HFNgB6kVuvhK2clIJ2Ke+IzU2ecw2NPeOwcMV0wBBWkB
 YD7Qh/eooDVkQKOManRaxsDqcJ88=
X-Gm-Gg: ASbGncvf/gOX0flvaTWCH90Et23O0FeyrkgPwLy1+QCL8y8/Mvwmi4II1ktUefqiFFh
 WwMM5YP4wV2VQxUiHYfRK05vL2+e5iriNDe3qjcLsJ2wfbIDSroJPsKT4sKrk+D78foeB/Tb552
 NUyfo3WXe+povjlexydMwlX3b67KOS9ZdK
X-Google-Smtp-Source: AGHT+IFYVrnc0gcXt/JEizgUWDDX65OW60qsvfTt90WZEaezVVa69Ls6qSUAbTnxsjaND0f2+XPjQCI/T8kPyt1j+cQ=
X-Received: by 2002:a05:6102:2c02:b0:4c1:8e07:40b8 with SMTP id
 ada2fe7eead31-4deed351f3dmr5872164137.6.1746876938134; Sat, 10 May 2025
 04:35:38 -0700 (PDT)
MIME-Version: 1.0
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
 <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
 <CAN+1HbqUdBGz5WmTA8aa0Yf=rKEj8Zf=-604C+HmNVUSyJhyTw@HIDDEN>
 <CAN+1Hbo8+aF87-ogd8qJ5C+YXO6Hiww5OytmJDrrUyfp1H+JpA@HIDDEN>
 <CAN+1Hbo8XiRcgNZQB2bLadFrPJEujXDZJdv5Fuj9jEs6goTMzw@HIDDEN>
 <CAN+1HbpYF8+GKJTESnvsi2k-v1fHQykEFoRJx7kzUP3oVL4BVQ@HIDDEN>
In-Reply-To: <CAN+1HbpYF8+GKJTESnvsi2k-v1fHQykEFoRJx7kzUP3oVL4BVQ@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Sat, 10 May 2025 07:35:27 -0400
X-Gm-Features: AX0GCFuxrKAj8xnySLSENGhGrG0aIr-J01AkZkxOjWi6FxCyBYnrmMF5KUumx6o
Message-ID: <CAN+1Hbox9VFa=__SZS3Mb8GMuoUVQNtw993yAHVnFRTLre1MOA@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
To: Stefan Kangas <stefankangas@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000005d2c470634c67b0c"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76568
Cc: 76568 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Philip Kaludercic <philipk@HIDDEN>
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 (-)

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

On Thu, Mar 20, 2025 at 10:41=E2=80=AFAM Ship Mints <shipmints@HIDDEN> w=
rote:

> On Fri, Mar 7, 2025 at 6:33=E2=80=AFAM Ship Mints <shipmints@HIDDEN> w=
rote:
>
>> On Wed, Mar 5, 2025 at 4:05=E2=80=AFPM Ship Mints <shipmints@HIDDEN> =
wrote:
>>
>>> On Wed, Mar 5, 2025 at 4:02=E2=80=AFPM Ship Mints <shipmints@HIDDEN>=
 wrote:
>>>
>>>> On Wed, Mar 5, 2025 at 2:55=E2=80=AFPM Ship Mints <shipmints@HIDDEN=
> wrote:
>>>>
>>>>> On Wed, Mar 5, 2025 at 12:00=E2=80=AFPM Ship Mints <shipmints@HIDDEN=
om>
>>>>> wrote:
>>>>>
>>>>>> On Mon, Mar 3, 2025 at 9:34=E2=80=AFPM Stefan Kangas <stefankangas@g=
mail.com>
>>>>>> 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 fr=
om
>>>>>>> > '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 a=
nd then
>>>>>> install or we could offer to use package upgrade to the chosen
>>>>>> package-desc.  At the very least, the patch prevents duplicates.
>>>>>>
>>>>>
>>>>> Thinking about it a bit more, this patch needs a little more work.  T=
he
>>>>> menu-driven package "upgrade" in describe-package-1 workflow will be =
interrupted by
>>>>> this patch.  It does not differentiate install vs. upgrade and calls
>>>>> package-install which will now complain the package already exists.  =
This
>>>>> should be changed to run package-upgrade.  I'll take a look.
>>>>>
>>>>> Any feedback on the minimal patch is still welcome in the meantime.
>>>>>
>>>>
>>>> This patch now accommodates both scenarios.
>>>>
>>>
>>> Now with an amended commit log.
>>>
>>
>> Attached patch with improved package replacement prompt.
>>
>
> Here's a refined version of the patch which allows users to optionally
> replace already-installed packages, or install/keep both.
>
> Testing this revealed some interesting other issues which may already be
> known.  I'll see if I can find bug reports and if not I'll submit new
> ones.  One example is that packages from different archives have
> incompatible version numbering schemes which causes false positives with
> the obsolete package detection mechanism.  Another is that
> package-reinstall does not respect the originating archive, instead
> preferring package-archive-priorities which may install a different versi=
on
> than is expected by a user.  Now might be a good time to consider that
> packages should be installed in archive-specific subdirectories rather th=
an
> commingling them?
>
> I'd appreciate it if some others would look at this and test it.  It migh=
t
> be adequate as a stop-gap for its intended purpose to avoid casual
> duplicate installs and some feedback would help.
>

This bug/patch seems to have languished.  It would be good to get it done.
Duplicate installed packages are annoying to say the least.

--0000000000005d2c470634c67b0c
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 Thu, Mar 20, 2025 at 10:41=E2=80=AFAM Ship Mints &lt;<a href=3D"mailto:s=
hipmints@HIDDEN">shipmints@HIDDEN</a>&gt; wrote:</span></div></div><d=
iv class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmail_q=
uote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,2=
04);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-=
family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">On=
 Fri, Mar 7, 2025 at 6:33=E2=80=AFAM Ship Mints &lt;<a href=3D"mailto:shipm=
ints@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>&gt; wrote:</span>=
</div></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-family:m=
onospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">On Wed, Ma=
r 5, 2025 at 4:05=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shipmints@gma=
il.com" target=3D"_blank">shipmints@HIDDEN</a>&gt; wrote:</span></div></=
div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"m=
argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left=
:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-family:monospace=
"><span style=3D"font-family:Arial,Helvetica,sans-serif">On Wed, Mar 5, 202=
5 at 4:02=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN" =
target=3D"_blank">shipmints@HIDDEN</a>&gt; wrote:</span></div></div><div=
 class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0p=
x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><d=
iv dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-family:monospace"><span =
style=3D"font-family:Arial,Helvetica,sans-serif">On Wed, Mar 5, 2025 at 2:5=
5=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN" target=
=3D"_blank">shipmints@HIDDEN</a>&gt; wrote:</span></div></div><div class=
=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=
=3D"ltr"><div dir=3D"ltr"><div style=3D"font-family:monospace"><span style=
=3D"font-family:Arial,Helvetica,sans-serif">On Wed, Mar 5, 2025 at 12:00=E2=
=80=AFPM Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN" target=3D"_b=
lank">shipmints@HIDDEN</a>&gt; wrote:</span></div></div><div class=3D"gm=
ail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.=
8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"lt=
r"><div dir=3D"ltr"><div style=3D"font-family:monospace"><span style=3D"fon=
t-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" target=3D"_bla=
nk">stefankangas@HIDDEN</a>&gt; wrote:</span></div></div><div class=3D"g=
mail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Ship Mints &l=
t;<a href=3D"mailto:shipmints@HIDDEN" target=3D"_blank">shipmints@gmail.=
com</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 style=3D"font-family=
:monospace">Patch attached.=C2=A0 It prevents the menu-driven case from era=
sing the already installed message.=C2=A0 It could suggest to the user to r=
emove and then install or we could offer to use package upgrade to the chos=
en package-desc.=C2=A0 At the very least, the patch prevents duplicates.</d=
iv></div></div></blockquote><div><br></div><div><span style=3D"font-family:=
monospace"><span class=3D"gmail_default" style=3D"font-family:monospace">Th=
inking about it a bit more, this patch needs a little more work.=C2=A0=C2=
=A0</span>The menu-driven package<span class=3D"gmail_default" style=3D"fon=
t-family:monospace"> &quot;</span>upgrade<span class=3D"gmail_default" styl=
e=3D"font-family:monospace">&quot;</span><span class=3D"gmail_default" styl=
e=3D"font-family:monospace"> in describe-package-1</span> workflow will be =
<span class=3D"gmail_default" style=3D"font-family:monospace"></span>i<span=
 class=3D"gmail_default" style=3D"font-family:monospace">nterrupted=C2=A0by=
 this patch.=C2=A0 It does not differentiate install vs. upgrade and calls =
package-install which will now complain the package already exists.=C2=A0 T=
his should be changed to run package-upgrade.=C2=A0 I&#39;ll take a look.</=
span></span></div><div><span style=3D"font-family:monospace"><span class=3D=
"gmail_default" style=3D"font-family:monospace"><br></span></span></div><di=
v><span style=3D"font-family:monospace"><span class=3D"gmail_default" style=
=3D"font-family:monospace">Any feedback on the minimal patch is still welco=
me in the meantime.</span></span></div></div></div></blockquote><div><br></=
div><div style=3D"font-family:monospace">This patch now accommodates both s=
cenarios.</div></div></div></blockquote><div><br></div><div style=3D"font-f=
amily:monospace">Now with an amended commit log.</div></div></div></blockqu=
ote><div><br></div><div style=3D"font-family:monospace">Attached patch with=
 improved package replacement prompt.</div></div></div></blockquote><div><b=
r></div><div style=3D"font-family:monospace">Here&#39;s a refined version o=
f the patch which allows users to optionally replace already-installed pack=
ages, or install/keep both.</div><div style=3D"font-family:monospace"><br><=
/div><div style=3D"font-family:monospace">Testing this revealed some intere=
sting other issues which may already be known.=C2=A0 I&#39;ll see if I can =
find bug reports and if not I&#39;ll submit new ones.=C2=A0 One example is =
that packages from different archives have incompatible version numbering s=
chemes which causes false positives with the obsolete package detection mec=
hanism.=C2=A0 Another is that package-reinstall does not respect the origin=
ating archive, instead preferring=C2=A0package-archive-priorities which may=
 install a different version than is expected by a user.=C2=A0 Now might be=
 a good time to consider that packages should be installed in archive-speci=
fic subdirectories rather than commingling them?</div><div style=3D"font-fa=
mily:monospace"><br></div><div style=3D"font-family:monospace">I&#39;d appr=
eciate it if some others would look at this and test it.=C2=A0 It might be =
adequate as a stop-gap for its intended purpose to avoid casual duplicate i=
nstalls and some feedback would help.<br></div></div></div></blockquote><di=
v><br></div><div class=3D"gmail_default" style=3D"font-family:monospace">Th=
is bug/patch seems to have languished.=C2=A0 It would be good to get it don=
e.=C2=A0 Duplicate installed packages are annoying to say the least.</div><=
/div></div>

--0000000000005d2c470634c67b0c--




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; 20 Mar 2025 14:41:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 20 10:41:44 2025
Received: from localhost ([127.0.0.1]:58433 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tvH5b-00024m-Gt
	for submit <at> debbugs.gnu.org; Thu, 20 Mar 2025 10:41:44 -0400
Received: from mail-vk1-xa2b.google.com ([2607:f8b0:4864:20::a2b]:49604)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1tvH5X-00024V-MC
 for 76568 <at> debbugs.gnu.org; Thu, 20 Mar 2025 10:41:40 -0400
Received: by mail-vk1-xa2b.google.com with SMTP id
 71dfb90a1353d-523efb24fb9so409513e0c.3
 for <76568 <at> debbugs.gnu.org>; Thu, 20 Mar 2025 07:41:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1742481694; x=1743086494; 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=uecFzm0yglSdXLL/EHY7u6PvM7mW1NK1PVAkZj6k9nw=;
 b=ULy43EuVyK6v4OqL9DpVO2k9NxRr31KJdK0QswqNKeRXWQjQrSnrKjMwEHXhYnrQx7
 oufDVkRhYFRTCz2/EIhK2aFbK/5EVNmSrQ+yemU0T7fd+zineiRGtp09OxaG0L7EQnAY
 qHGtFTRyvLI8L8uYDXBo0sic18j6hGSKM0p/7JUi+HoOTl9vCOLE8G5mXrEf43dnwOJj
 8YYlvzn1qHx05xkha742wSJu6b+QOVfhvJDdeLnmoklWWJgpqyJy0NKPkrqUI0fx/l4/
 aFwBVF9uCncx5tEBoYBRzk8B87XrMMcPGDvY9FXKW48itqOv2fMrPorh0I+S3ohf14Li
 45eA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1742481694; x=1743086494;
 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=uecFzm0yglSdXLL/EHY7u6PvM7mW1NK1PVAkZj6k9nw=;
 b=VS+qL5At3g/nhOzi+q8byAZ4fnnJtMrQ8kJb27ldLtayqG7RMh5A3U23sdaEA4OiZ+
 GbFp9sU96o2+AKG/0Q5D61MiP8r1AMt+z0KbYsX4dywZR97tSyKC9FV0bruyx73MIqLy
 4Ciw8fYVALFu2RSpxoUMj3IixpKILLC9m9ayFPd/BS1AlTXqUXW/mLU9yez2MEBhG3E2
 /8vbxMH/H3o1CJHpW5WYFi23m1TCct63dEKIITH+JGZp1svGfZsXdDtUn84wrm92fh2a
 sh0i7D7qClWAsQaTt+2O8e46A65gXuBelK2Je2LAHb8H90aJpWCO6fPtm6LGT3mKNltq
 fdOA==
X-Gm-Message-State: AOJu0Yw2A39gCbfq3/zElXm+tn+TJs2DgnZ9hPB/UrTefcDHfuul2YKM
 KjAiseQK8Ob5aHoaW2R2yKnBfp3cN9i/Rl1K2RMnYGhyA/rlDyuwwgDHKUc/jhqXJJuFuyV22Cr
 +PK/QRYnThSyTppzkBTK4FgvROOk=
X-Gm-Gg: ASbGncv2mrcCRfmiCgzF6ox0zbABTF0m6/lGLMvFr/LLDr8sdzWdOpnViJl6Kfdld67
 rVZoi37cbAB310WCIxi32fFrkDd88kE5V0+7JoCRNgjP9qM55zTAf0OEL6vx2+5tv4mNt/btUYK
 DXzIl110xFpgl4PcXfLCyS9ZmCQg==
X-Google-Smtp-Source: AGHT+IERlL4fSikmC250PbkY7nBOCD5FmXyjwZRE/M/VPhban52v/ccPd5MTt73PRze4Q7V/rDXhAYS/O1b2dKyET68=
X-Received: by 2002:a05:6122:2487:b0:51f:fc9d:875d with SMTP id
 71dfb90a1353d-52589218085mr5130867e0c.8.1742481693961; Thu, 20 Mar 2025
 07:41:33 -0700 (PDT)
MIME-Version: 1.0
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
 <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
 <CAN+1HbqUdBGz5WmTA8aa0Yf=rKEj8Zf=-604C+HmNVUSyJhyTw@HIDDEN>
 <CAN+1Hbo8+aF87-ogd8qJ5C+YXO6Hiww5OytmJDrrUyfp1H+JpA@HIDDEN>
 <CAN+1Hbo8XiRcgNZQB2bLadFrPJEujXDZJdv5Fuj9jEs6goTMzw@HIDDEN>
In-Reply-To: <CAN+1Hbo8XiRcgNZQB2bLadFrPJEujXDZJdv5Fuj9jEs6goTMzw@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Thu, 20 Mar 2025 10:41:22 -0400
X-Gm-Features: AQ5f1JqudTQoTBs_DcTOii5wmtFIiuFm057390wQF-_N8gMmfK313I7T_U4spQo
Message-ID: <CAN+1HbpYF8+GKJTESnvsi2k-v1fHQykEFoRJx7kzUP3oVL4BVQ@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
To: Stefan Kangas <stefankangas@HIDDEN>
Content-Type: multipart/mixed; boundary="000000000000659b370630c722e7"
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 (-)

--000000000000659b370630c722e7
Content-Type: multipart/alternative; boundary="000000000000659b350630c722e5"

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

On Fri, Mar 7, 2025 at 6:33=E2=80=AFAM Ship Mints <shipmints@HIDDEN> wro=
te:

> On Wed, Mar 5, 2025 at 4:05=E2=80=AFPM Ship Mints <shipmints@HIDDEN> w=
rote:
>
>> On Wed, Mar 5, 2025 at 4:02=E2=80=AFPM Ship Mints <shipmints@HIDDEN> =
wrote:
>>
>>> On Wed, Mar 5, 2025 at 2:55=E2=80=AFPM Ship Mints <shipmints@HIDDEN>=
 wrote:
>>>
>>>> On Wed, Mar 5, 2025 at 12:00=E2=80=AFPM Ship Mints <shipmints@HIDDEN=
m> wrote:
>>>>
>>>>> On Mon, Mar 3, 2025 at 9:34=E2=80=AFPM Stefan Kangas <stefankangas@gm=
ail.com>
>>>>> 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 resul=
t
>>>>>> was that I had two of
>>>>>> > each package installed.
>>>>>> >
>>>>>> > I think there's a bug in 'package-install' which, when invoked fro=
m
>>>>>> > 'package-install-button-action', processes the new package spec,
>>>>>> and incorrectly checks to
>>>>>> > see if the package is already installed.  Interactive invocation o=
f
>>>>>> '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 an=
d then
>>>>> install or we could offer to use package upgrade to the chosen
>>>>> package-desc.  At the very least, the patch prevents duplicates.
>>>>>
>>>>
>>>> Thinking about it a bit more, this patch needs a little more work.  Th=
e
>>>> menu-driven package "upgrade" in describe-package-1 workflow will be i=
nterrupted by
>>>> this patch.  It does not differentiate install vs. upgrade and calls
>>>> package-install which will now complain the package already exists.  T=
his
>>>> should be changed to run package-upgrade.  I'll take a look.
>>>>
>>>> Any feedback on the minimal patch is still welcome in the meantime.
>>>>
>>>
>>> This patch now accommodates both scenarios.
>>>
>>
>> Now with an amended commit log.
>>
>
> Attached patch with improved package replacement prompt.
>

Here's a refined version of the patch which allows users to optionally
replace already-installed packages, or install/keep both.

Testing this revealed some interesting other issues which may already be
known.  I'll see if I can find bug reports and if not I'll submit new
ones.  One example is that packages from different archives have
incompatible version numbering schemes which causes false positives with
the obsolete package detection mechanism.  Another is that
package-reinstall does not respect the originating archive, instead
preferring package-archive-priorities which may install a different version
than is expected by a user.  Now might be a good time to consider that
packages should be installed in archive-specific subdirectories rather than
commingling them?

I'd appreciate it if some others would look at this and test it.  It might
be adequate as a stop-gap for its intended purpose to avoid casual
duplicate installs and some feedback would help.

-Stephane

--000000000000659b350630c722e5
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 Fri, Mar 7, 2025 at 6:33=E2=80=AFAM Ship Mints &lt;<a href=3D"mailto:shi=
pmints@HIDDEN">shipmints@HIDDEN</a>&gt; wrote:</span></div></div><div=
 class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmail_quo=
te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204=
);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-fa=
mily:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">On W=
ed, Mar 5, 2025 at 4:05=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shipmin=
ts@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>&gt; wrote:</span></=
div></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddin=
g-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-family:mon=
ospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">On Wed, Mar =
5, 2025 at 4:02=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shipmints@gmail=
.com" target=3D"_blank">shipmints@HIDDEN</a>&gt; wrote:</span></div></di=
v><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-family:monospace">=
<span style=3D"font-family:Arial,Helvetica,sans-serif">On Wed, Mar 5, 2025 =
at 2:55=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN" ta=
rget=3D"_blank">shipmints@HIDDEN</a>&gt; wrote:</span></div></div><div c=
lass=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px =
0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div=
 dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-family:monospace"><span st=
yle=3D"font-family:Arial,Helvetica,sans-serif">On Wed, Mar 5, 2025 at 12:00=
=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN" target=3D=
"_blank">shipmints@HIDDEN</a>&gt; wrote:</span></div></div><div class=3D=
"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px=
 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D=
"ltr"><div dir=3D"ltr"><div style=3D"font-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" target=3D=
"_blank">stefankangas@HIDDEN</a>&gt; wrote:</span></div></div><div class=
=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Ship Min=
ts &lt;<a href=3D"mailto:shipmints@HIDDEN" target=3D"_blank">shipmints@g=
mail.com</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 style=3D"font-family=
:monospace">Patch attached.=C2=A0 It prevents the menu-driven case from era=
sing the already installed message.=C2=A0 It could suggest to the user to r=
emove and then install or we could offer to use package upgrade to the chos=
en package-desc.=C2=A0 At the very least, the patch prevents duplicates.</d=
iv></div></div></blockquote><div><br></div><div><span style=3D"font-family:=
monospace"><span class=3D"gmail_default" style=3D"font-family:monospace">Th=
inking about it a bit more, this patch needs a little more work.=C2=A0=C2=
=A0</span>The menu-driven package<span class=3D"gmail_default" style=3D"fon=
t-family:monospace"> &quot;</span>upgrade<span class=3D"gmail_default" styl=
e=3D"font-family:monospace">&quot;</span><span class=3D"gmail_default" styl=
e=3D"font-family:monospace"> in describe-package-1</span> workflow will be =
<span class=3D"gmail_default" style=3D"font-family:monospace"></span>i<span=
 class=3D"gmail_default" style=3D"font-family:monospace">nterrupted=C2=A0by=
 this patch.=C2=A0 It does not differentiate install vs. upgrade and calls =
package-install which will now complain the package already exists.=C2=A0 T=
his should be changed to run package-upgrade.=C2=A0 I&#39;ll take a look.</=
span></span></div><div><span style=3D"font-family:monospace"><span class=3D=
"gmail_default" style=3D"font-family:monospace"><br></span></span></div><di=
v><span style=3D"font-family:monospace"><span class=3D"gmail_default" style=
=3D"font-family:monospace">Any feedback on the minimal patch is still welco=
me in the meantime.</span></span></div></div></div></blockquote><div><br></=
div><div style=3D"font-family:monospace">This patch now accommodates both s=
cenarios.</div></div></div></blockquote><div><br></div><div style=3D"font-f=
amily:monospace">Now with an amended commit log.</div></div></div></blockqu=
ote><div><br></div><div style=3D"font-family:monospace">Attached patch with=
 improved package replacement prompt.</div></div></div></blockquote><div><b=
r></div><div class=3D"gmail_default" style=3D"font-family:monospace">Here&#=
39;s a refined version of the patch which allows users to optionally replac=
e already-installed packages, or install/keep both.</div><div class=3D"gmai=
l_default" style=3D"font-family:monospace"><br></div><div class=3D"gmail_de=
fault" style=3D"font-family:monospace">Testing this revealed some interesti=
ng other issues which may already be known.=C2=A0 I&#39;ll see if I can fin=
d bug reports and if not I&#39;ll submit new ones.=C2=A0 One example is tha=
t packages from different archives have incompatible version numbering sche=
mes which causes false positives with the obsolete package detection mechan=
ism.=C2=A0 Another is that package-reinstall does not respect the originati=
ng archive, instead preferring=C2=A0package-archive-priorities which may in=
stall a different version than is expected by a user.=C2=A0 Now might be a =
good time to consider that packages should be installed in archive-specific=
 subdirectories rather than commingling them?</div><div class=3D"gmail_defa=
ult" style=3D"font-family:monospace"><br></div><div class=3D"gmail_default"=
 style=3D"font-family:monospace">I&#39;d appreciate it if some others would=
 look at this and test it.=C2=A0 It might be adequate as a stop-gap for its=
 intended purpose to avoid casual duplicate installs and some feedback woul=
d help.</div><div class=3D"gmail_default" style=3D"font-family:monospace"><=
br></div><div><span style=3D"font-family:monospace">-Stephane</span>=C2=A0<=
/div></div></div>

--000000000000659b350630c722e5--

--000000000000659b370630c722e7
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_m8hglarg0>
X-Attachment-Id: f_m8hglarg0

RnJvbSA5ZGVlZTQ0OGUyN2Y5NGMyMTQ2OWU1OTY3N2ZkZTJjYmNlOGY5YmNkIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBzaGlwbWludHMgPHNoaXBtaW50c0BnbWFpbC5jb20+CkRhdGU6
IFdlZCwgNSBNYXIgMjAyNSAxMTozMzowNyAtMDUwMApTdWJqZWN0OiBbUEFUQ0hdIENvcnJlY3Qg
J3BhY2thZ2UtaW5zdGFsbCcgdG8gZGV0ZWN0IGluc3RhbGxlZCBwYWNrYWdlcwogKGJ1ZyM3NjU2
OCkKCiogbGlzcC9lbWFjcy1saXNwL3BhY2thZ2UuZWwKKHBhY2thZ2UtaW5zdGFsbCk6IENoZWNr
IGZvciBhbHJlYWR5IGluc3RhbGxlZCBwYWNrYWdlIHVzaW5nIG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UgcGtnKSkpCiAgICAgICAgICAgICAgICAg
ICAgICAocGFja2FnZS1jb21wdXRlLXRyYW5zYWN0aW9uIChsaXN0IHBrZykKICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBhY2thZ2UtZGVzYy1yZXFz
IHBrZykpKQotICAgICAgICAgICAgICAgICAocGFja2FnZS1jb21wdXRlLXRyYW5zYWN0aW9uICgp
IChsaXN0IChsaXN0IHBrZykpKSkpKQorICAgICAgICAgICAgICAgICAodW5sZXNzIChhbmQgKG5v
dCBhbGxvdy1tdWx0LW9yLXJlaW5zdGFsbCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IChwYWNrYWdlLWluc3RhbGxlZC1wIHBrZykpCisgICAgICAgICAgICAgICAgICAgKHBhY2thZ2Ut
Y29tcHV0ZS10cmFuc2FjdGlvbiAoKSAobGlzdCAobGlzdCBwa2cpKSkpKSkpCiAgICAgICAgIChw
cm9nbgogICAgICAgICAgIChwYWNrYWdlLWRvd25sb2FkLXRyYW5zYWN0aW9uIHRyYW5zYWN0aW9u
KQogICAgICAgICAgIChwYWNrYWdlLS1xdWlja3N0YXJ0LW1heWJlLXJlZnJlc2gpCiAgICAgICAg
ICAgKG1lc3NhZ2UgICJQYWNrYWdlIGAlcycgaW5zdGFsbGVkLiIgbmFtZSkpCi0gICAgICAobWVz
c2FnZSAiYCVzJyBpcyBhbHJlYWR5IGluc3RhbGxlZCIgbmFtZSkpKSkKKyAgICAgIChtZXNzYWdl
ICJgJXMnIGlzIGFscmVhZHkgaW5zdGFsbGVkIiBuYW1lKQorICAgICAgbmlsKSkpCiAKIChkZWNs
YXJlLWZ1bmN0aW9uIHBhY2thZ2UtdmMtdXBncmFkZSAicGFja2FnZS12YyIgKHBrZykpCiAKQEAg
LTI1ODcsNyArMjU5OCw3IEBAIHBhY2thZ2UtcmVpbnN0YWxsCiAgIChwYWNrYWdlLWRlbGV0ZQog
ICAgKGlmIChwYWNrYW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SBwa2ctZGVzYykKKyAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFja2FnZS1hbGlzdCkpKSkKKyAgICAg
ICAgICAocGNhc2UgKGxldCAoKHJlYWQtYW5zd2VyLXNob3J0IHQpKQorICAgICAgICAgICAgICAg
ICAgIChyZWFkLWFuc3dlcgorICAgICAgICAgICAgICAgICAgICAoZm9ybWF0LW1lc3NhZ2UKKyAg
ICAgICAgICAgICAgICAgICAgICJSZXBsYWNlIGAlcycgd2l0aCBgJXMnLCBvciBJbnN0YWxsIGJv
dGggKGFkdmFuY2VkIHVzZXJzKSAiCisgICAgICAgICAgICAgICAgICAgICAocGFja2FnZS1kZXNj
LWZ1bGwtbmFtZSBpbnN0YWxsZWQtcGtnLWRlc2MpCisgICAgICAgICAgICAgICAgICAgICAocGFj
a2FnZS1kZXNjLWZ1bGwtbmFtZSBwa2ctZGVzYykpCisgICAgICAgICAgICAgICAgICAgICcoKCJy
ZXBsYWNlIiA/ciAiUmVwbGFjZSBleGlzdGluZyIpCisgICAgICAgICAgICAgICAgICAgICAgKCJp
bnN0YWxsIiA/aSAiSW5zdGFsbCBib3RoIikKKyAgICAgICAgICAgICAgICAgICAgICAoImhlbHAi
ID9oICJIZWxwIikKKyAgICAgICAgICAgICAgICAgICAgICAoInF1aXQiID9xICJRdWl0IHRvIGFi
b3J0IikpKSkKKyAgICAgICAgICAgICgicmVwbGFjZSIKKyAgICAgICAgICAgICAocGFja2FnZS1k
ZWxldGUgaW5zdGFsbGVkLXBrZy1kZXNjICdmb3JjZSAnZG9udC11bnNlbGVjdCkKKyAgICAgICAg
ICAgICAod2hlbiAocGFja2FnZS1pbnN0YWxsIHBrZy1kZXNjIG5pbCkKKyAgICAgICAgICAgICAg
IChkZXNjcmliZS1wYWNrYWdlIChwYWNrYWdlLWRlc2MtbmFtZSBwa2ctZGVzYykpKSkKKyAgICAg
ICAgICAgICgiaW5zdGFsbCIKKyAgICAgICAgICAgICAod2hlbiAocGF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lzIGFscmVhZHkgaW5z
dGFsbGVkXG4/XFwnIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIChidWZmZXItc3RyaW5n
KSkpKQogICAgIChzaG91bGQgKHBhY2thZ2UtaW5zdGFsbGVkLXAgJ3NpbXBsZS1zaW5nbGUpKQor
ICAgIDs7IFRlc3QgZm9yIGBwYWNrYWdlLWluc3RhbGwnIGFscmVhZHkgaW5zdGFsbGVkIHVzaW5n
IGEKKyAgICA7OyBwYWNrYWdlLWRlc2MuICBgcGFja2FnZS1pbnN0YWxsJyByZXR1cm5zIG5pbCBp
ZiBhbHJlYWR5CisgICAgOzsgaW5zdGFsbGVkLgorICAgIChzaG91bGQtbm90IChwYWNrYWdlLWlu
c3RhbGwgc2ltcGxlLXNpbmdsZS1kZXNjKSkKICAgICAobGV0KiAoKHNpbXBsZS1wa2ctZGlyIChm
aWxlLW5hbWUtYXMtZGlyZWN0b3J5CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGV4cGFu
ZC1maWxlLW5hbWUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInNpbXBsZS1zaW5nbGUt
MS4zIgotLSAKMi40Ny4xCgo=
--000000000000659b370630c722e7--




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; 16 Mar 2025 18:52:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 16 14:52:53 2025
Received: from localhost ([127.0.0.1]:50716 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ttt6T-0008Gh-9R
	for submit <at> debbugs.gnu.org; Sun, 16 Mar 2025 14:52:53 -0400
Received: from mail-ua1-x92a.google.com ([2607:f8b0:4864:20::92a]:48190)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1ttt6Q-0008FH-DX
 for 76568 <at> debbugs.gnu.org; Sun, 16 Mar 2025 14:52:52 -0400
Received: by mail-ua1-x92a.google.com with SMTP id
 a1e0cc1a2514c-86d42f08135so1481789241.0
 for <76568 <at> debbugs.gnu.org>; Sun, 16 Mar 2025 11:52:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1742151164; x=1742755964; 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=N5czE8b+5biur+yA2Le8/eQDz2Vk/46EDFlBFfTxe0I=;
 b=ltCzxN9h9R89YPRSATNQyfn8aOvHuHibp8kxfQvcUboJ8CClsaiaZAmd0KxBI0R175
 AfJ3/L0pmISwIzpxGrPFR93VdQbX1XGBTcxKGkIKVwDTy3yUMJoJbMjzHwHLX2aFCWIP
 I3MUMjpztos/Q+Mzt75HXj36VTB9A3jkujQJZu6twD+Zp8zcFpxOtRKmHr7Iu9NaAcDx
 fLYalUUSMyygFLA+xcabucd2MxairJCvfBM00sKyWlOg1LUtfTtpqvZ0OwFj2kJAFXME
 8npZJDMs5QpMtPgXUneNJEv2e8ENe+NNKqFoBJ2uilBu+tdpyhZoSuUDB2qk/z8aRkz3
 EsZw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1742151164; x=1742755964;
 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=N5czE8b+5biur+yA2Le8/eQDz2Vk/46EDFlBFfTxe0I=;
 b=a9mTbCRj3Bq++sSDmzzC/L9Fw5Y5mGi/V5KjCP+fDC9P7300tPsG7B2xOxw6u1cpyw
 49BkEzsS7Mc4RNk9d322IGoDr/hKF7Wp3/Y/Lr/qYeN41McpeHu+GWNd+/6J+xtuvGpm
 SQ1gdXZYrcNEiGJxe73tl/rQ2jqyhPul5U4BH+Q1MUzLpF9fZ2eoXRfP7OEACIOh8IEA
 urYTU3M2Q9MSrJjPqlzNc7HPXsCDZKALPrEewkA4zbFOvm+ZXlwKTK4dFD6Tp5AM299X
 mw2rV5a7bk4XXp+ZYJWL7LewFxEy9w63e94U/EVMClI5keVetDYmy3ob8KHmWTmvX8xb
 bsUA==
X-Gm-Message-State: AOJu0YzjM78uBT1tWuycz/DwuC7TYx3NWV0eH+grVbEAkF3zTIj9OsIq
 c4YEVU+Wb0Rw1afSMOA8H824H4GiIHZ+8fWJ7gUTYEtF0hZbPDCO5gv8SR1lJnpk8aabT41V2Ux
 6yYG00qkDCbrWKOrUIW24GGfU/kw=
X-Gm-Gg: ASbGncvGEwccZ3AYHtOEFu43bWw77sURipecNe0g8p4MVw7hlyCAIiXZEvOeZbCERO9
 /hlEaIqfizKgEdHVmFPChGGbqXSOTEN6dOda4Dfzhf9FCKUZp/HgohgtsTlmKCDZ5VPRNUncoRv
 Ag5sUrIRpQFCPHVElLYhx8cG7Ucg==
X-Google-Smtp-Source: AGHT+IGX+6Bfg/0pPUXqfpLo72/15yR6Ws+LgyYIZeCUxS+P77ZKzzA/PCtO2M2a1z+53xEGNurf1mXY68MvGvZrlzI=
X-Received: by 2002:a05:6102:3f50:b0:4bb:dba6:99cd with SMTP id
 ada2fe7eead31-4c38313ff97mr6580880137.8.1742151164601; Sun, 16 Mar 2025
 11:52:44 -0700 (PDT)
MIME-Version: 1.0
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
 <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
 <CAN+1HbqUdBGz5WmTA8aa0Yf=rKEj8Zf=-604C+HmNVUSyJhyTw@HIDDEN>
 <CAN+1Hbo8+aF87-ogd8qJ5C+YXO6Hiww5OytmJDrrUyfp1H+JpA@HIDDEN>
 <CAN+1Hbo8XiRcgNZQB2bLadFrPJEujXDZJdv5Fuj9jEs6goTMzw@HIDDEN>
In-Reply-To: <CAN+1Hbo8XiRcgNZQB2bLadFrPJEujXDZJdv5Fuj9jEs6goTMzw@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Sun, 16 Mar 2025 14:52:33 -0400
X-Gm-Features: AQ5f1JqWGsEnp46M0C3Styt8GfW8VZJkK7FllpP5t4mN8yF76Xd3c9k6ZYOLfVU
Message-ID: <CAN+1HbrQwKfpZGCZ0dwey-Q8-Rs1haOTXxCyY-SNYYvx8rVWzw@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
To: Stefan Kangas <stefankangas@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000004fae5606307a2dc2"
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 (-)

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

Stefan, I see Philip and David working on package.el.  It would be fruitful
for them to do that on top of this patch.

On Fri, Mar 7, 2025 at 6:33=E2=80=AFAM Ship Mints <shipmints@HIDDEN> wro=
te:

> On Wed, Mar 5, 2025 at 4:05=E2=80=AFPM Ship Mints <shipmints@HIDDEN> w=
rote:
>
>> On Wed, Mar 5, 2025 at 4:02=E2=80=AFPM Ship Mints <shipmints@HIDDEN> =
wrote:
>>
>>> On Wed, Mar 5, 2025 at 2:55=E2=80=AFPM Ship Mints <shipmints@HIDDEN>=
 wrote:
>>>
>>>> On Wed, Mar 5, 2025 at 12:00=E2=80=AFPM Ship Mints <shipmints@HIDDEN=
m> wrote:
>>>>
>>>>> On Mon, Mar 3, 2025 at 9:34=E2=80=AFPM Stefan Kangas <stefankangas@gm=
ail.com>
>>>>> 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 resul=
t
>>>>>> was that I had two of
>>>>>> > each package installed.
>>>>>> >
>>>>>> > I think there's a bug in 'package-install' which, when invoked fro=
m
>>>>>> > 'package-install-button-action', processes the new package spec,
>>>>>> and incorrectly checks to
>>>>>> > see if the package is already installed.  Interactive invocation o=
f
>>>>>> '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 an=
d then
>>>>> install or we could offer to use package upgrade to the chosen
>>>>> package-desc.  At the very least, the patch prevents duplicates.
>>>>>
>>>>
>>>> Thinking about it a bit more, this patch needs a little more work.  Th=
e
>>>> menu-driven package "upgrade" in describe-package-1 workflow will be i=
nterrupted by
>>>> this patch.  It does not differentiate install vs. upgrade and calls
>>>> package-install which will now complain the package already exists.  T=
his
>>>> should be changed to run package-upgrade.  I'll take a look.
>>>>
>>>> Any feedback on the minimal patch is still welcome in the meantime.
>>>>
>>>
>>> This patch now accommodates both scenarios.
>>>
>>
>> Now with an amended commit log.
>>
>
> Attached patch with improved package replacement prompt.
>

--0000000000004fae5606307a2dc2
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">Stefan, I see Philip and David working on package.el.=
=C2=A0 It would be fruitful for them to do that on top of this patch.</div>=
</div><br><div class=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr"=
 class=3D"gmail_attr">On Fri, Mar 7, 2025 at 6:33=E2=80=AFAM Ship Mints &lt=
;<a href=3D"mailto:shipmints@HIDDEN">shipmints@HIDDEN</a>&gt; wrote:<=
br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"=
><div dir=3D"ltr"><div style=3D"font-family:monospace"><span style=3D"font-=
family:Arial,Helvetica,sans-serif">On Wed, Mar 5, 2025 at 4:05=E2=80=AFPM S=
hip Mints &lt;<a href=3D"mailto:shipmints@HIDDEN" target=3D"_blank">ship=
mints@HIDDEN</a>&gt; wrote:</span></div></div><div class=3D"gmail_quote"=
><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border=
-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div di=
r=3D"ltr"><div style=3D"font-family:monospace"><span style=3D"font-family:A=
rial,Helvetica,sans-serif">On Wed, Mar 5, 2025 at 4:02=E2=80=AFPM Ship Mint=
s &lt;<a href=3D"mailto:shipmints@HIDDEN" target=3D"_blank">shipmints@gm=
ail.com</a>&gt; wrote:</span></div></div><div class=3D"gmail_quote"><blockq=
uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p=
x solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr=
"><div style=3D"font-family:monospace"><span style=3D"font-family:Arial,Hel=
vetica,sans-serif">On Wed, Mar 5, 2025 at 2:55=E2=80=AFPM Ship Mints &lt;<a=
 href=3D"mailto:shipmints@HIDDEN" target=3D"_blank">shipmints@HIDDEN<=
/a>&gt; wrote:</span></div></div><div class=3D"gmail_quote"><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid =
rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div s=
tyle=3D"font-family:monospace"><span style=3D"font-family:Arial,Helvetica,s=
ans-serif">On Wed, Mar 5, 2025 at 12:00=E2=80=AFPM Ship Mints &lt;<a href=
=3D"mailto:shipmints@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>&g=
t; wrote:</span></div></div><div class=3D"gmail_quote"><blockquote class=3D=
"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(2=
04,204,204);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=
=3D"font-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" target=3D"_blank">stefankangas@HIDDEN</a>=
&gt; wrote:</span></div></div><div class=3D"gmail_quote"><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex">Ship Mints &lt;<a href=3D"mailto:shipmints=
@gmail.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 style=3D"font-family=
:monospace">Patch attached.=C2=A0 It prevents the menu-driven case from era=
sing the already installed message.=C2=A0 It could suggest to the user to r=
emove and then install or we could offer to use package upgrade to the chos=
en package-desc.=C2=A0 At the very least, the patch prevents duplicates.</d=
iv></div></div></blockquote><div><br></div><div><span style=3D"font-family:=
monospace"><span class=3D"gmail_default" style=3D"font-family:monospace">Th=
inking about it a bit more, this patch needs a little more work.=C2=A0=C2=
=A0</span>The menu-driven package<span class=3D"gmail_default" style=3D"fon=
t-family:monospace"> &quot;</span>upgrade<span class=3D"gmail_default" styl=
e=3D"font-family:monospace">&quot;</span><span class=3D"gmail_default" styl=
e=3D"font-family:monospace"> in describe-package-1</span> workflow will be =
<span class=3D"gmail_default" style=3D"font-family:monospace"></span>i<span=
 class=3D"gmail_default" style=3D"font-family:monospace">nterrupted=C2=A0by=
 this patch.=C2=A0 It does not differentiate install vs. upgrade and calls =
package-install which will now complain the package already exists.=C2=A0 T=
his should be changed to run package-upgrade.=C2=A0 I&#39;ll take a look.</=
span></span></div><div><span style=3D"font-family:monospace"><span class=3D=
"gmail_default" style=3D"font-family:monospace"><br></span></span></div><di=
v><span style=3D"font-family:monospace"><span class=3D"gmail_default" style=
=3D"font-family:monospace">Any feedback on the minimal patch is still welco=
me in the meantime.</span></span></div></div></div></blockquote><div><br></=
div><div style=3D"font-family:monospace">This patch now accommodates both s=
cenarios.</div></div></div></blockquote><div><br></div><div style=3D"font-f=
amily:monospace">Now with an amended commit log.</div></div></div></blockqu=
ote><div><br></div><div style=3D"font-family:monospace">Attached patch with=
 improved package replacement prompt.</div></div></div>
</blockquote></div></div>

--0000000000004fae5606307a2dc2--




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; 7 Mar 2025 11:33:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 07 06:33:41 2025
Received: from localhost ([127.0.0.1]:47242 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tqVxV-0002GM-6v
	for submit <at> debbugs.gnu.org; Fri, 07 Mar 2025 06:33:41 -0500
Received: from mail-vk1-xa35.google.com ([2607:f8b0:4864:20::a35]:55600)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1tqVxS-0002G6-QW
 for 76568 <at> debbugs.gnu.org; Fri, 07 Mar 2025 06:33:39 -0500
Received: by mail-vk1-xa35.google.com with SMTP id
 71dfb90a1353d-51eb1823a8eso867706e0c.3
 for <76568 <at> debbugs.gnu.org>; Fri, 07 Mar 2025 03:33:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741347213; x=1741952013; 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=nS06Jh7qXRxQ19STbJwFY0QSUhjMtTggA2iVdqGhKtc=;
 b=gCkJyYupgca48OUaY0CHmgZYIphzRD+Csuo1sj6KXYDVauwAteVkegLfdJHL2PSROX
 nd3Rl+VCmRrl5SJz7VDz36RZKZhrZ2wXOFB73YAvx2qSTCGMKCsomPjs94/O2a01Dqvw
 Ud3+Yig/nTMk3+E1i8ZoqsXWZZ0L3JexvvYS77M4nCu8hNbhsDF8UQvDMxzQTyj63xVL
 /FR9WzEnkw5fmEOIbhXvqsx1pHVoMPiofX55E6NzIfBn+PodOt1nyHuNpM4Qk0dwyLb8
 nOLgN3ovEihX5sFVxo2XymIMI9gUc5txb8+3e0wALq+wbW3J6chrlaEu/sO0881IQtee
 qfvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741347213; x=1741952013;
 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=nS06Jh7qXRxQ19STbJwFY0QSUhjMtTggA2iVdqGhKtc=;
 b=JlN45pBQbLkYrXhaF33bj4EAFZHNVRdJ/zGW9VMtqXVVpdSq3pkV7vZK9Ph+wGin29
 c3QNTk993u6i77/giio1PXUUz/ttoGUOpDPk4twZSR3RO8RjTFPst64GWVIfYdobcRYJ
 lD6E2WHYMNDwwdb2vvBbsqw5T/Wr6byfuAvHwClnIAdEGordbCXg+MuFZlrmQbmbC4Ur
 nc8Ib7teVdYmnPoso6XlenSEEWD2VjkUr2EDVf8LMrPqQxelvC9AntwjLnBSBh80tX33
 fmkM7G/pdQgpZ54azxPH3xvbXweuqWkomUG+JTQ4qYPQhnQnF4nwXv+Qtk6+BLLR0LlF
 qnCw==
X-Gm-Message-State: AOJu0YyeAdNW4sQIIQW0u7JpGcll+oygvYsCaoQVIn69dupoBK11Zhc6
 gFedyB1OEFX+5esGdgFAe8h+ZJLe43nmV2072/bYl5jwAe4paZQ6i5gTPSw0h6OBkuIWfjPDMyS
 4ercybN0mGW969vgQFlax+1hXPRQ=
X-Gm-Gg: ASbGnctvewf13rc6PttxHY2iGCUghF8GZR+TF3gjo0mhsjo3bjM2szawEoutGG/NfAU
 IclpZschXapcPlOOSZ1F2bg6oEPPMXNweUZT3VINyNxCIh5z/ia8GTWoIQdJAFyz07GVgEr2skl
 zij1KYUquEIj8kFD5uT9QZJaPDag==
X-Google-Smtp-Source: AGHT+IHI93FDnnCVXRYZslufa6NXrsJMbE4R2Ujv4rkBDes/gBYZSIZ4YxXIQ44G3UibfSXlw/7qToEMnjvDyEvlrX4=
X-Received: by 2002:a05:6122:2a12:b0:520:61ee:c7fc with SMTP id
 71dfb90a1353d-523e4057872mr1707570e0c.4.1741347212882; Fri, 07 Mar 2025
 03:33:32 -0800 (PST)
MIME-Version: 1.0
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
 <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
 <CAN+1HbqUdBGz5WmTA8aa0Yf=rKEj8Zf=-604C+HmNVUSyJhyTw@HIDDEN>
 <CAN+1Hbo8+aF87-ogd8qJ5C+YXO6Hiww5OytmJDrrUyfp1H+JpA@HIDDEN>
In-Reply-To: <CAN+1Hbo8+aF87-ogd8qJ5C+YXO6Hiww5OytmJDrrUyfp1H+JpA@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Fri, 7 Mar 2025 06:33:21 -0500
X-Gm-Features: AQ5f1JplzU-3wjn19DgkZ1Vq0jsQnMUEftzkAUE0OVUopEbb0N2YNJSOvVkSUn8
Message-ID: <CAN+1Hbo8XiRcgNZQB2bLadFrPJEujXDZJdv5Fuj9jEs6goTMzw@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
To: Stefan Kangas <stefankangas@HIDDEN>
Content-Type: multipart/mixed; boundary="0000000000000e17c3062fbefe8d"
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 (-)

--0000000000000e17c3062fbefe8d
Content-Type: multipart/alternative; boundary="0000000000000e17c1062fbefe8b"

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

On Wed, Mar 5, 2025 at 4:05=E2=80=AFPM Ship Mints <shipmints@HIDDEN> wro=
te:

> On Wed, Mar 5, 2025 at 4:02=E2=80=AFPM Ship Mints <shipmints@HIDDEN> w=
rote:
>
>> On Wed, Mar 5, 2025 at 2:55=E2=80=AFPM Ship Mints <shipmints@HIDDEN> =
wrote:
>>
>>> On Wed, Mar 5, 2025 at 12:00=E2=80=AFPM Ship Mints <shipmints@HIDDEN=
> wrote:
>>>
>>>> On Mon, Mar 3, 2025 at 9:34=E2=80=AFPM Stefan Kangas <stefankangas@gma=
il.com>
>>>> 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, an=
d
>>>>> 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.
>>>>
>>>
>>> Thinking about it a bit more, this patch needs a little more work.  The
>>> menu-driven package "upgrade" in describe-package-1 workflow will be in=
terrupted by
>>> this patch.  It does not differentiate install vs. upgrade and calls
>>> package-install which will now complain the package already exists.  Th=
is
>>> should be changed to run package-upgrade.  I'll take a look.
>>>
>>> Any feedback on the minimal patch is still welcome in the meantime.
>>>
>>
>> This patch now accommodates both scenarios.
>>
>
> Now with an amended commit log.
>

Attached patch with improved package replacement prompt.

--0000000000000e17c1062fbefe8b
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 Wed, Mar 5, 2025 at 4:05=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shi=
pmints@HIDDEN">shipmints@HIDDEN</a>&gt; wrote:</span></div></div><div=
 class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmail_quo=
te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204=
);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-fa=
mily:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">On W=
ed, Mar 5, 2025 at 4:02=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shipmin=
ts@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>&gt; wrote:</span></=
div></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddin=
g-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-family:mon=
ospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">On Wed, Mar =
5, 2025 at 2:55=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shipmints@gmail=
.com" target=3D"_blank">shipmints@HIDDEN</a>&gt; wrote:</span></div></di=
v><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-family:monospace">=
<span style=3D"font-family:Arial,Helvetica,sans-serif">On Wed, Mar 5, 2025 =
at 12:00=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN" t=
arget=3D"_blank">shipmints@HIDDEN</a>&gt; wrote:</span></div></div><div =
class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px=
 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><di=
v dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-family:monospace"><span s=
tyle=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" tar=
get=3D"_blank">stefankangas@HIDDEN</a>&gt; wrote:</span></div></div><div=
 class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0p=
x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Sh=
ip Mints &lt;<a href=3D"mailto:shipmints@HIDDEN" target=3D"_blank">shipm=
ints@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 style=3D"font-family=
:monospace">Patch attached.=C2=A0 It prevents the menu-driven case from era=
sing the already installed message.=C2=A0 It could suggest to the user to r=
emove and then install or we could offer to use package upgrade to the chos=
en package-desc.=C2=A0 At the very least, the patch prevents duplicates.</d=
iv></div></div></blockquote><div><br></div><div><span style=3D"font-family:=
monospace"><span class=3D"gmail_default" style=3D"font-family:monospace">Th=
inking about it a bit more, this patch needs a little more work.=C2=A0=C2=
=A0</span>The menu-driven package<span class=3D"gmail_default" style=3D"fon=
t-family:monospace"> &quot;</span>upgrade<span class=3D"gmail_default" styl=
e=3D"font-family:monospace">&quot;</span><span class=3D"gmail_default" styl=
e=3D"font-family:monospace"> in describe-package-1</span> workflow will be =
<span class=3D"gmail_default" style=3D"font-family:monospace"></span>i<span=
 class=3D"gmail_default" style=3D"font-family:monospace">nterrupted=C2=A0by=
 this patch.=C2=A0 It does not differentiate install vs. upgrade and calls =
package-install which will now complain the package already exists.=C2=A0 T=
his should be changed to run package-upgrade.=C2=A0 I&#39;ll take a look.</=
span></span></div><div><span style=3D"font-family:monospace"><span class=3D=
"gmail_default" style=3D"font-family:monospace"><br></span></span></div><di=
v><span style=3D"font-family:monospace"><span class=3D"gmail_default" style=
=3D"font-family:monospace">Any feedback on the minimal patch is still welco=
me in the meantime.</span></span></div></div></div></blockquote><div><br></=
div><div style=3D"font-family:monospace">This patch now accommodates both s=
cenarios.</div></div></div></blockquote><div><br></div><div style=3D"font-f=
amily:monospace">Now with an amended commit log.</div></div></div></blockqu=
ote><div><br></div><div class=3D"gmail_default" style=3D"font-family:monosp=
ace">Attached patch with improved package replacement prompt.</div></div></=
div>

--0000000000000e17c1062fbefe8b--

--0000000000000e17c3062fbefe8d
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_m7yp5tum0>
X-Attachment-Id: f_m7yp5tum0

RnJvbSBmY2QxOWM0OTkwNTcyZDQ3YmU5NDNiMWY4ZDQwN2Q0MzJhYTFhZGNhIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBzaGlwbWludHMgPHNoaXBtaW50c0BnbWFpbC5jb20+CkRhdGU6
IFdlZCwgNSBNYXIgMjAyNSAxMTozMzowNyAtMDUwMApTdWJqZWN0OiBbUEFUQ0hdIENvcnJlY3Qg
J3BhY2thZ2UtaW5zdGFsbCcgdG8gZGV0ZWN0IGluc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MuICBgcGFja2FnZS1p
bnN0YWxsJyByZXR1cm5zIG5pbCBpZiBhbHJlYWR5CisgICAgOzsgaW5zdGFsbGVkLgorICAgIChz
aG91bGQtbm90IChwYWNrYWdlLWluc3RhbGwgc2ltcGxlLXNpbmdsZS1kZXNjKSkKICAgICAobGV0
KiAoKHNpbXBsZS1wa2ctZGlyIChmaWxlLW5hbWUtYXMtZGlyZWN0b3J5CiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgKGV4cGFuZC1maWxlLW5hbWUKICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgInNpbXBsZS1zaW5nbGUtMS4zIgotLSAKMi40Ny4xCgo=
--0000000000000e17c3062fbefe8d--




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; 5 Mar 2025 21:05:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 05 16:05:45 2025
Received: from localhost ([127.0.0.1]:40084 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tpvw0-0003RR-VN
	for submit <at> debbugs.gnu.org; Wed, 05 Mar 2025 16:05:45 -0500
Received: from mail-vk1-xa2c.google.com ([2607:f8b0:4864:20::a2c]:58674)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1tpvvz-0003RE-0r
 for 76568 <at> debbugs.gnu.org; Wed, 05 Mar 2025 16:05:43 -0500
Received: by mail-vk1-xa2c.google.com with SMTP id
 71dfb90a1353d-51eb1a6ca1bso3031362e0c.1
 for <76568 <at> debbugs.gnu.org>; Wed, 05 Mar 2025 13:05:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741208737; x=1741813537; 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=SQnYazM5sB3i2txqH6HPQekpcKmc8iwLjtXsIAhcUQM=;
 b=lqaeYto+mP8hmhw5RksOoDfC/UbMNYVjUfruRgutUtvrV0/Zm7KR5+qcmLxxbbftOQ
 /hUTMsSPFEZOVNMTPkPCvPRjONw30OHH2odEesP/4RoM3anChewKquOYw6G46vGd5Dxd
 +ZIUrWoOlKPjgMz2UJeA8SiSCnWECIGojnfzk9IrMcqrrF68UkK816UI1i1/PsGA7bOV
 gnilGR+3mC1Qa/WrdeebP2KgXoqQMxmgk3qMQlFozPGcJK4CNESVVPXThV9QvBgN6ncw
 16jc1MhcVMQhlOjKk7jsYtoR8Y6U9yXhdJV9zvAZzWWpon5jPMX/3THzWDZu4yc2nxgB
 0fjw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741208737; x=1741813537;
 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=SQnYazM5sB3i2txqH6HPQekpcKmc8iwLjtXsIAhcUQM=;
 b=wFPGtb3KcQPUcl/2I1Ci/d7g9VrtCT7VgV7rr4zDUb3ux8B5s8kvcUwsZK2bzctV3p
 J/k4XZp3+L/TET+/6KtP3kyQpSkghNXaLfl8At9ymnZ5fYXcsYxujof8G8/KNlzw57/Z
 735fJOJHyR9zHSln755/V8AU4cGEdSWRUPShw7YbGX8PiSxB/x1Q4MDhfrbePc6TlEz1
 /t6J8jK0L2be9y/3PqcJf+7yFc46KRI/+5wTXAektVtMnWcW1dJ5FEO9ZuKtVERXtyh3
 QHt2KW2bLKQ5SVTyoWok7MHcnmG6aELEatf3CiTLRVYb6lALtDXCabf7X3dK0awKwEsC
 99Sg==
X-Gm-Message-State: AOJu0Yy0wMYztmi0Zh5OwywdCV2irim2FbHG+aFjMrtoW/zShaIoyY/V
 oCQnvVERTdetOSFQ28fNR/Ev10K2CxoD9BWMzSeslBh5khb1HSJKFpJh9IDKFx0SH995Gl52+VR
 coeRMyZ+sdZLmVonsIltieTF7C8oZWg==
X-Gm-Gg: ASbGnctQLUtVIWhq0O+DoMWwN/jjwd36vPOlnyVE5U5RZ7p/a/HKgIocCKsJDmQMBM9
 1vttCH1yNntvVsU6ARdz+3kZo58BYF2doP0uKGk1F6mmUbXmuT4hiX/LIKH0aIvgLIwcsjDKoNf
 TSxCHG9czJoseotAlKZeFoMFhrLQ==
X-Google-Smtp-Source: AGHT+IE22JpPr3CNSUFAGFXBHv63urZSVpp7ez2o66Tbiebk8xhYIrYf70ZLbpEiNOy68DNyKWXlVWcVwWkNym7tt64=
X-Received: by 2002:a05:6122:1ad0:b0:520:3536:feb5 with SMTP id
 71dfb90a1353d-523c62f37c2mr2637769e0c.11.1741208737004; Wed, 05 Mar 2025
 13:05:37 -0800 (PST)
MIME-Version: 1.0
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
 <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
 <CAN+1HbqUdBGz5WmTA8aa0Yf=rKEj8Zf=-604C+HmNVUSyJhyTw@HIDDEN>
In-Reply-To: <CAN+1HbqUdBGz5WmTA8aa0Yf=rKEj8Zf=-604C+HmNVUSyJhyTw@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Wed, 5 Mar 2025 16:05:25 -0500
X-Gm-Features: AQ5f1JrciSQIzphROUB-Jn267_IcKui3v9IDO_1E_dg0No8FOzo0MsryI8dLM10
Message-ID: <CAN+1Hbo8+aF87-ogd8qJ5C+YXO6Hiww5OytmJDrrUyfp1H+JpA@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
To: Stefan Kangas <stefankangas@HIDDEN>
Content-Type: multipart/mixed; boundary="0000000000004030d4062f9ec08c"
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 (-)

--0000000000004030d4062f9ec08c
Content-Type: multipart/alternative; boundary="0000000000004030d0062f9ec08a"

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

On Wed, Mar 5, 2025 at 4:02=E2=80=AFPM Ship Mints <shipmints@HIDDEN> wro=
te:

> On Wed, Mar 5, 2025 at 2:55=E2=80=AFPM Ship Mints <shipmints@HIDDEN> w=
rote:
>
>> On Wed, Mar 5, 2025 at 12:00=E2=80=AFPM Ship Mints <shipmints@HIDDEN>=
 wrote:
>>
>>> On Mon, Mar 3, 2025 at 9:34=E2=80=AFPM Stefan Kangas <stefankangas@gmai=
l.com>
>>> 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.
>>>
>>
>> Thinking about it a bit more, this patch needs a little more work.  The
>> menu-driven package "upgrade" in describe-package-1 workflow will be int=
errupted by
>> this patch.  It does not differentiate install vs. upgrade and calls
>> package-install which will now complain the package already exists.  Thi=
s
>> should be changed to run package-upgrade.  I'll take a look.
>>
>> Any feedback on the minimal patch is still welcome in the meantime.
>>
>
> This patch now accommodates both scenarios.
>

Now with an amended commit log.

--0000000000004030d0062f9ec08a
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 Wed, Mar 5, 2025 at 4:02=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shi=
pmints@HIDDEN">shipmints@HIDDEN</a>&gt; wrote:</span></div></div><div=
 class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmail_quo=
te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204=
);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-fa=
mily:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">On W=
ed, Mar 5, 2025 at 2:55=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shipmin=
ts@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>&gt; wrote:</span></=
div></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddin=
g-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-family:mon=
ospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">On Wed, Mar =
5, 2025 at 12:00=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shipmints@gmai=
l.com" target=3D"_blank">shipmints@HIDDEN</a>&gt; wrote:</span></div></d=
iv><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:=
1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-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@gmail.=
com" target=3D"_blank">stefankangas@HIDDEN</a>&gt; wrote:</span></div></=
div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"m=
argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left=
:1ex">Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN" target=3D"_blan=
k">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 style=3D"font-family=
:monospace">Patch attached.=C2=A0 It prevents the menu-driven case from era=
sing the already installed message.=C2=A0 It could suggest to the user to r=
emove and then install or we could offer to use package upgrade to the chos=
en package-desc.=C2=A0 At the very least, the patch prevents duplicates.</d=
iv></div></div></blockquote><div><br></div><div><span style=3D"font-family:=
monospace"><span class=3D"gmail_default" style=3D"font-family:monospace">Th=
inking about it a bit more, this patch needs a little more work.=C2=A0=C2=
=A0</span>The menu-driven package<span class=3D"gmail_default" style=3D"fon=
t-family:monospace"> &quot;</span>upgrade<span class=3D"gmail_default" styl=
e=3D"font-family:monospace">&quot;</span><span class=3D"gmail_default" styl=
e=3D"font-family:monospace"> in describe-package-1</span> workflow will be =
<span class=3D"gmail_default" style=3D"font-family:monospace"></span>i<span=
 class=3D"gmail_default" style=3D"font-family:monospace">nterrupted=C2=A0by=
 this patch.=C2=A0 It does not differentiate install vs. upgrade and calls =
package-install which will now complain the package already exists.=C2=A0 T=
his should be changed to run package-upgrade.=C2=A0 I&#39;ll take a look.</=
span></span></div><div><span style=3D"font-family:monospace"><span class=3D=
"gmail_default" style=3D"font-family:monospace"><br></span></span></div><di=
v><span style=3D"font-family:monospace"><span class=3D"gmail_default" style=
=3D"font-family:monospace">Any feedback on the minimal patch is still welco=
me in the meantime.</span></span></div></div></div></blockquote><div><br></=
div><div style=3D"font-family:monospace">This patch now accommodates both s=
cenarios.</div></div></div></blockquote><div><br></div><div class=3D"gmail_=
default" style=3D"font-family:monospace">Now with an amended commit log.</d=
iv></div></div>

--0000000000004030d0062f9ec08a--

--0000000000004030d4062f9ec08c
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_m7wepu4o0>
X-Attachment-Id: f_m7wepu4o0

RnJvbSA5M2Y0Yzc4ODU2ODI5ZWUzOGM5OWZhYmQzNTYyOTBhYmM2NmE2OGRkIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBzaGlwbWludHMgPHNoaXBtaW50c0BnbWFpbC5jb20+CkRhdGU6
IFdlZCwgNSBNYXIgMjAyNSAxMTozMzowNyAtMDUwMApTdWJqZWN0OiBbUEFUQ0hdIENvcnJlY3Qg
J3BhY2thZ2UtaW5zdGFsbCcgdG8gZGV0ZWN0IGluc3RhbGxlZCBwYWNrYWdlcwogKGJ1ZyM3NjU2
OCkKCiogbGlzcC9lbWFjcy1saXNwL3BhY2thZ2UuZWwKKHBhY2thZ2UtaW5zdGFsbCk6IENoZWNr
IGZvciBhbHJlYWR5IGluc3RhbGxlZCBwYWNrYWdlIHVzaW5nIGl0cyBzeW1ib2wKcmF0aGVyIHRo
YW4gcmVseSBvbiBkaWZmZXJpbmcgYXJjaGl2ZSBkaXJlY3Rvcnkgc3RydWN0dXJlcy4gIFJldHVy
biB0IGlmCmluc3RhbGxlZCwgbmlsIG90aGVyd2lzZS4KKHBhY2thZ2UtaW5zdGFsbC1idXR0b24t
YWN0aW9uKTogJ2Rlc2NyaWJlLXBhY2thZ2UnIG9ubHkgd2hlbgoncGFja2FnZS1pbnN0YWxsJyBh
Y3R1YWxseSBpbnN0YWxsZWQgdGhlIHBhY2thZ2UuICBQcm9tcHQgdGhlIHVzZXIgdG8KaW5zdGFs
bCBvciB1cGd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orICAgICAgICAgICAgICAgOzsgdGhlIGFyY2hpdmUtc3BlY2lmaWMgZGlyZWN0b3J5IHN0cnVj
dHVyZS4KICAgICAgICAgICAgICAgIChpZiAocGFja2FnZS1kZXNjLXAgcGtnKQotICAgICAgICAg
ICAgICAgICAgICh1bmxlc3MgKHBhY2thZ2UtaW5zdGFsbGVkLXAgcGtnKQorICAgICAgICAgICAg
ICAgICAgICh1bmxlc3MgKHBhY2thZ2UtaW5zdGFsbGVkLXAgKHBhY2thZ2UtZGVzYy1uYW1lIHBr
ZykpCiAgICAgICAgICAgICAgICAgICAgICAocGFja2FnZS1jb21wdXRlLXRyYW5zYWN0aW9uIChs
aXN0IHBrZykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgKHBhY2thZ2UtZGVzYy1yZXFzIHBrZykpKQotICAgICAgICAgICAgICAgICAocGFja2FnZS1j
b21wdXRlLXRyYW5zYWN0aW9uICgpIChsaXN0IChsaXN0IHBrZykpKSkpKQorICAgICAgICAgICAg
ICAgICAodW5sZXNzIChwYWNrYWdlLWluc3RhbGxlZC1wIHBrZykKKyAgICAgICAgICAgICAgICAg
ICAocGFja2FnZS1jb21wdXRlLXRyYW5zYWN0aW9uICgpIChsaXN0IChsaXN0IHBrZykpKSkpKSkK
ICAgICAgICAgKHByb2duCiAgICAgICAgICAgKHBhY2thZ2UtZG93bmxvYWQtdHJhbnNhY3Rpb24g
dHJhbnNhY3Rpb24pCiAgICAgICAgICAgKHBhY2thZ2UtLXF1aWNrc3RhcnQtbWF5YmUtcmVmcmVz
aCkKICAgICAgICAgICAobWVzc2FnZSAgIlBhY2thZ2UgYCVzJyBpbnN0YWxsZWQuIiBuYW1lKSkK
LSAgICAgIChtZXNzYWdlICJgJXMnIGlzIGFscmVhZHkgaW5zdGFsbGVkIiBuYW1lKSkpKQorICAg
ICAgKG1lc3NhZ2UgImAlcycgaXMgYWxyZWFkeSBpbnN0YWxsZWQiIG5hbWUpCisgIC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lc3QvbGlzcC9lbWFjcy1saXNwL3BhY2thZ2UtdGVzdHMuZWwK
KysrIGIvdGVzdC9saXNwL2VtYWNzLWxpc3AvcGFja2FnZS10ZXN0cy5lbApAQCAtMjQ4LDYgKzI0
OCwxMCBAQCBwYWNrYWdlLXRlc3QtaW5zdGFsbC1zaW5nbGUKICAgICAgIChzaG91bGQgKHN0cmlu
Zy1tYXRjaCAiXltg4oCYJ11zaW1wbGUtc2luZ2xlW+KAmSddIGlzIGFscmVhZHkgaW5zdGFsbGVk
XG4/XFwnIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIChidWZmZXItc3RyaW5nKSkpKQog
ICAgIChzaG91bGQgKHBhY2thZ2UtaW5zdGFsbGVkLXAgJ3NpbXBsZS1zaW5nbGUpKQorICAgIDs7
IFRlc3QgZm9yIGBwYWNrYWdlLWluc3RhbGwnIGFscmVhZHkgaW5zdGFsbGVkIHVzaW5nIGEKKyAg
ICA7OyBwYWNrYWdlLWRlc2MuICBgcGFja2FnZS1pbnN0YWxsJyByZXR1cm5zIG5pbCBpZiBhbHJl
YWR5CisgICAgOzsgaW5zdGFsbGVkLgorICAgIChzaG91bGQtbm90IChwYWNrYWdlLWluc3RhbGwg
c2ltcGxlLXNpbmdsZS1kZXNjKSkKICAgICAobGV0KiAoKHNpbXBsZS1wa2ctZGlyIChmaWxlLW5h
bWUtYXMtZGlyZWN0b3J5CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGV4cGFuZC1maWxl
LW5hbWUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInNpbXBsZS1zaW5nbGUtMS4zIgot
LSAKMi40Ny4xCgo=
--0000000000004030d4062f9ec08c--




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; 5 Mar 2025 21:03:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 05 16:03:17 2025
Received: from localhost ([127.0.0.1]:40077 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tpvtc-0003Hp-Vg
	for submit <at> debbugs.gnu.org; Wed, 05 Mar 2025 16:03:17 -0500
Received: from mail-vk1-xa2b.google.com ([2607:f8b0:4864:20::a2b]:52398)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1tpvta-0003HX-19
 for 76568 <at> debbugs.gnu.org; Wed, 05 Mar 2025 16:03:14 -0500
Received: by mail-vk1-xa2b.google.com with SMTP id
 71dfb90a1353d-51eb181331bso3578264e0c.0
 for <76568 <at> debbugs.gnu.org>; Wed, 05 Mar 2025 13:03:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741208588; x=1741813388; 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=smNGoBE5RvtNy0bfRWJqJFTLfsHy0VnM4cm/uLsA0C0=;
 b=ixLd0ThLcWcs6ZeWswuz2Fm0a7SVF0AYbIRIGG9uRDee8+qaihBKz813y5XjOCaS7/
 SQmjsgWVf44oJusCMuEghz5GLqyoHORThyAKlzOcHlrlwFIbWoTS6FSfDR/fIyN8AjN+
 2BOGKpv98YE8Z3ZgsH5S4sybyb9Vz2wPqyCuB5nzGR7u8KHX6o/a4w5X3RP3sdbpVYOz
 NY1ZqLrHuCC+5GZMYuEFzaPvJ053lMfgVbts7yAfyhg0vplvJfn3gflV/Tl4ReVVSs3z
 Vyp1YGleGijCMb5ERaeSTncbXVFU0v7IWbH2FEymudZVS2MuFV3VQMK//xvz01pL1eeD
 +miQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741208588; x=1741813388;
 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=smNGoBE5RvtNy0bfRWJqJFTLfsHy0VnM4cm/uLsA0C0=;
 b=vvf7uUovTnXPOKAC1/DAvrSJLs3vk5welzl4c99mhbrBfVBrqIAaUnhnFkBqN+MdaL
 9mVLd/f2Wtdi6/K2y2O3sSDTOWNhVqvH6AwHhzG9LKtEcy4hhdoeed0erXzwxIKYI1DC
 duLiw6jx3E90RoxHTeDMTF+641SjkthQ4wdX8tMBUQKwqZOBNER3i6hpaNGngsXUxfRG
 WZ89SRMXOfNTIifCFG90eSHCilovNsfJKmspci+raR/tzzb9cP9wKpNiwnE9F5REKow8
 TeHkonyGK6cZZ0r77IL+KBImsgwSGFbDa90IyEz/TGh3CdwCgeeKS/cPTnFq5whWQQyY
 Ooug==
X-Gm-Message-State: AOJu0YzN+IVI4MH0XJ/WjBzbb7GLiAgJlihZkBrnaD3RJGNb/UtIfMNZ
 +ux6PYgFn1lGVz2Fzs+hG/K92t1Eo9UY+PfSJ885bZRgyVRrXHlHBJ4VJypJyotxQrlq0EZ/MnJ
 T9aJU6C+c9QqJGms+aHN0wdJicCs=
X-Gm-Gg: ASbGncu3g03PXeC0GKFhLMBlGiWQQYis+JS0C5OKBOFKaiMZO6NPHf0tLrXJk3aqVym
 Wd7hOvz3ggXqX3pyU+zAIWNZ39MDAXUW3EJgBgT3TmBBHZzvckXr2FXZKtEf7bauXzCGJ0KTqXm
 hHPVqAmLw1JCgTHeFXNMnJrblL7A==
X-Google-Smtp-Source: AGHT+IG+pgQwLHuUNAl9lDG/d5RSdsOnZpgDt2k8/0kWkBrp18yHGwnG8JcHkGbdU9Ag+R112lBT8RsZA777PbiFNms=
X-Received: by 2002:a05:6122:659f:b0:520:4d95:1319 with SMTP id
 71dfb90a1353d-523c6150ff9mr3063591e0c.4.1741208588201; Wed, 05 Mar 2025
 13:03:08 -0800 (PST)
MIME-Version: 1.0
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
 <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
In-Reply-To: <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Wed, 5 Mar 2025 16:02:57 -0500
X-Gm-Features: AQ5f1JoRv1mzf2kFdQhT4iWAln78AfEbBDYlgajo-SX4t-4OFnFXjpB-Ak8pAZ8
Message-ID: <CAN+1HbqUdBGz5WmTA8aa0Yf=rKEj8Zf=-604C+HmNVUSyJhyTw@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
To: Stefan Kangas <stefankangas@HIDDEN>
Content-Type: multipart/mixed; boundary="000000000000614e73062f9eb720"
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 (-)

--000000000000614e73062f9eb720
Content-Type: multipart/alternative; boundary="000000000000614e72062f9eb71e"

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

On Wed, Mar 5, 2025 at 2:55=E2=80=AFPM Ship Mints <shipmints@HIDDEN> wro=
te:

> On Wed, Mar 5, 2025 at 12:00=E2=80=AFPM Ship Mints <shipmints@HIDDEN> =
wrote:
>
>> On Mon, Mar 3, 2025 at 9:34=E2=80=AFPM Stefan Kangas <stefankangas@gmail=
.com>
>> wrote:
>>
>>> Ship Mints <shipmints@HIDDEN> writes:
>>>
>>> > As part of my production upgrade to 30.1, and before I wrote a progra=
m
>>> to install my local
>>> > ELPA tree from scratch, I tried to first curate my packages and chang=
e
>>> 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 t=
hen
>> install or we could offer to use package upgrade to the chosen
>> package-desc.  At the very least, the patch prevents duplicates.
>>
>
> Thinking about it a bit more, this patch needs a little more work.  The
> menu-driven package "upgrade" in describe-package-1 workflow will be inte=
rrupted by
> this patch.  It does not differentiate install vs. upgrade and calls
> package-install which will now complain the package already exists.  This
> should be changed to run package-upgrade.  I'll take a look.
>
> Any feedback on the minimal patch is still welcome in the meantime.
>

This patch now accommodates both scenarios.

--000000000000614e72062f9eb71e
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 Wed, Mar 5, 2025 at 2:55=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shi=
pmints@HIDDEN">shipmints@HIDDEN</a>&gt; wrote:</span></div></div><div=
 class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmail_quo=
te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204=
);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-fa=
mily:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">On W=
ed, Mar 5, 2025 at 12:00=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:shipmi=
nts@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>&gt; wrote:</span><=
/div></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddi=
ng-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-family:mo=
nospace"><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:stefankanga=
s@HIDDEN" target=3D"_blank">stefankangas@HIDDEN</a>&gt; wrote:</span>=
</div></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex">Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN" 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 style=3D"font-family=
:monospace">Patch attached.=C2=A0 It prevents the menu-driven case from era=
sing the already installed message.=C2=A0 It could suggest to the user to r=
emove and then install or we could offer to use package upgrade to the chos=
en package-desc.=C2=A0 At the very least, the patch prevents duplicates.</d=
iv></div></div></blockquote><div><br></div><div><span style=3D"font-family:=
monospace"><span class=3D"gmail_default" style=3D"font-family:monospace">Th=
inking about it a bit more, this patch needs a little more work.=C2=A0=C2=
=A0</span>The menu-driven package<span class=3D"gmail_default" style=3D"fon=
t-family:monospace"> &quot;</span>upgrade<span class=3D"gmail_default" styl=
e=3D"font-family:monospace">&quot;</span><span class=3D"gmail_default" styl=
e=3D"font-family:monospace"> in describe-package-1</span> workflow will be =
<span class=3D"gmail_default" style=3D"font-family:monospace"></span>i<span=
 class=3D"gmail_default" style=3D"font-family:monospace">nterrupted=C2=A0by=
 this patch.=C2=A0 It does not differentiate install vs. upgrade and calls =
package-install which will now complain the package already exists.=C2=A0 T=
his should be changed to run package-upgrade.=C2=A0 I&#39;ll take a look.</=
span></span></div><div><span style=3D"font-family:monospace"><span class=3D=
"gmail_default" style=3D"font-family:monospace"><br></span></span></div><di=
v><span style=3D"font-family:monospace"><span class=3D"gmail_default" style=
=3D"font-family:monospace">Any feedback on the minimal patch is still welco=
me in the meantime.</span></span></div></div></div></blockquote><div><br></=
div><div class=3D"gmail_default" style=3D"font-family:monospace">This patch=
 now accommodates both scenarios.</div></div></div>

--000000000000614e72062f9eb71e--

--000000000000614e73062f9eb720
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_m7wemn560>
X-Attachment-Id: f_m7wemn560

RnJvbSAwMGI4OTk2MTY5ODI5ZDA4YmZhNzgwMWE3OWUyMGM0Njk0Y2I2NTcwIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBzaGlwbWludHMgPHNoaXBtaW50c0BnbWFpbC5jb20+CkRhdGU6
IFdlZCwgNSBNYXIgMjAyNSAxMTozMzowNyAtMDUwMApTdWJqZWN0OiBbUEFUQ0hdIENvcnJlY3Qg
J3BhY2thZ2UtaW5zdGFsbCcgdG8gZGV0ZWN0IGluc3RhbGxlZCBwYWNrYWdlcwogKGJ1ZyM3NjU2
OCkKCiogbGlzcC9lbWFjcy1saXNwL3BhY2thZ2UuZWwKKHBhY2thZ2UtaW5zdGFsbCk6IENoZWNr
IGZvciBhbHJlYWR5IGluc3RhbGxlZCBwYWNrYWdlIHVzaW5nIGl0cyBzeW1ib2wKcmF0aGVyIHRo
YW4gcmVseSBvbiBkaWZmZXJpbmcgYXJjaGl2ZSBkaXJlY3Rvcnkgc3RydWN0dXJlcy4gIFJldHVy
biB0IGlmCmluc3RhbGxlZCwgbmlsIG90aGVyd2lzZS4KKHBhY2thZ2UtaW5zdGFsbC1idXR0b24t
YWN0aW9uKTogJ2Rlc2NyaWJlLXBhY2thZ2UnIG9ubHkgd2hlbgoncGFja2FnZS1pbnN0YWxsJyBh
Y3R1YWxseSBpbnN0YWxsZWQgdGhlIHBhY2thZ2UuCiogdGVzdC9saXNwL2VtYWN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nVjdHVyZS4KICAgICAg
ICAgICAgICAgIChpZiAocGFja2FnZS1kZXNjLXAgcGtnKQotICAgICAgICAgICAgICAgICAgICh1
bmxlc3MgKHBhY2thZ2UtaW5zdGFsbGVkLXAgcGtnKQorICAgICAgICAgICAgICAgICAgICh1bmxl
c3MgKHBhY2thZ2UtaW5zdGFsbGVkLXAgKHBhY2thZ2UtZGVzYy1uYW1lIHBrZykpCiAgICAgICAg
ICAgICAgICAgICAgICAocGFja2FnZS1jb21wdXRlLXRyYW5zYWN0aW9uIChsaXN0IHBrZykKICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBhY2thZ2Ut
ZGVzYy1yZXFzIHBrZykpKQotICAgICAgICAgICAgICAgICAocGFja2FnZS1jb21wdXRlLXRyYW5z
YWN0aW9uICgpIChsaXN0IChsaXN0IHBrZykpKSkpKQorICAgICAgICAgICAgICAgICAodW5sZXNz
IChwYWNrYWdlLWluc3RhbGxlZC1wIHBrZykKKyAgICAgICAgICAgICAgICAgICAocGFja2FnZS1j
b21wdXRlLXRyYW5zYWN0aW9uICgpIChsaXN0IChsaXN0IHBrZykpKSkpKSkKICAgICAgICAgKHBy
b2duCiAgICAgICAgICAgKHBhY2thZ2UtZG93bmxvYWQtdHJhbnNhY3Rpb24gdHJhbnNhY3Rpb24p
CiAgICAgICAgICAgKHBhY2thZ2UtLXF1aWNrc3RhcnQtbWF5YmUtcmVmcmVzaCkKICAgICAgICAg
ICAobWVzc2FnZSAgIlBhY2thZ2UgYCVzJyBpbnN0YWxsZWQuIiBuYW1lKSkKLSAgICAgIChtZXNz
YWdlICJgJXMnIGlzIGFscmVhZHkgaW5zdGFsbGVkIiBuYW1lKSkpKQorICAgICAgKG1lc3NhZ2Ug
ImAlcycgaXMgYWxyZWFkeSBpbnN0YWxsZWQiIG5hbWUpCisgICAgICBuaWwpKSkKIAogKGRlY2xh
cmUtZnVuY3Rpb24gcGFja2FnZS12Yy11cGdyYWRlIC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
aXNwL2VtYWNzLWxpc3AvcGFja2FnZS10ZXN0cy5lbApAQCAtMjQ4LDYgKzI0OCwxMCBAQCBwYWNr
YWdlLXRlc3QtaW5zdGFsbC1zaW5nbGUKICAgICAgIChzaG91bGQgKHN0cmluZy1tYXRjaCAiXltg
4oCYJ11zaW1wbGUtc2luZ2xlW+KAmSddIGlzIGFscmVhZHkgaW5zdGFsbGVkXG4/XFwnIgogICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIChidWZmZXItc3RyaW5nKSkpKQogICAgIChzaG91bGQg
KHBhY2thZ2UtaW5zdGFsbGVkLXAgJ3NpbXBsZS1zaW5nbGUpKQorICAgIDs7IFRlc3QgZm9yIGBw
YWNrYWdlLWluc3RhbGwnIGFscmVhZHkgaW5zdGFsbGVkIHVzaW5nIGEKKyAgICA7OyBwYWNrYWdl
LWRlc2MuICBgcGFja2FnZS1pbnN0YWxsJyByZXR1cm5zIG5pbCBpZiBhbHJlYWR5CisgICAgOzsg
aW5zdGFsbGVkLgorICAgIChzaG91bGQtbm90IChwYWNrYWdlLWluc3RhbGwgc2ltcGxlLXNpbmds
ZS1kZXNjKSkKICAgICAobGV0KiAoKHNpbXBsZS1wa2ctZGlyIChmaWxlLW5hbWUtYXMtZGlyZWN0
b3J5CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGV4cGFuZC1maWxlLW5hbWUKICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgInNpbXBsZS1zaW5nbGUtMS4zIgotLSAKMi40Ny4xCgo=
--000000000000614e73062f9eb720--




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; 5 Mar 2025 19:55:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 05 14:55:58 2025
Received: from localhost ([127.0.0.1]:39995 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tpuqU-0005jE-91
	for submit <at> debbugs.gnu.org; Wed, 05 Mar 2025 14:55:58 -0500
Received: from mail-ua1-x932.google.com ([2607:f8b0:4864:20::932]:51366)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1tpuqR-0005j2-Q7
 for 76568 <at> debbugs.gnu.org; Wed, 05 Mar 2025 14:55:56 -0500
Received: by mail-ua1-x932.google.com with SMTP id
 a1e0cc1a2514c-86b9ea43955so411704241.2
 for <76568 <at> debbugs.gnu.org>; Wed, 05 Mar 2025 11:55:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741204550; x=1741809350; 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=keqaZyuboqdAMZBzbNibqPIp24WOIje27p/lQFCnAqg=;
 b=TEEjxTRgcHJ3MP23vxbXBBCAai2aC1emlK2I2S9ljtygPBQnt2iaxNR/BILasGGGOf
 vb0msxdn87WIsETy9xbLLpKr2hURksN4XI55BDPg+R6l1rLj0xxrdydMkvy6WR1hegWK
 a2B+eZLzveDtfEiyiOIbHOvCbvlp5vjKc4yOgwOeTmkyOL2Gk61pqlHrGcd9Pgan0nwv
 YwR9PzsAk7+LJrErRAj32TospsWp0zod130ihBQbnrWeL7jkAcHZ+mnQEzq8nHSz+D/M
 SmB33Wilw2MJIvEvkftrALxyrKwp4A64QzgHeb3koICe56yILtLFgDuVmcVmjJVD8FgP
 kUqw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741204550; x=1741809350;
 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=keqaZyuboqdAMZBzbNibqPIp24WOIje27p/lQFCnAqg=;
 b=vScdFEdCUkBJlmOdId36x+mSZ1synzfwXR6rBh2G1SWwfC38jcQ0Gr9LXU+p4iLHma
 xHWekGtb5uBBYlExb7z8sZ9RKBTZRwQTQf8pFc1jtSQFxGjUUJT5srKBdpSIWwfLa7AR
 YQyOUxDOsUE5Ngag8TNCMPnePLbcFANVdXdXKzBUeb2m3rCbjukzF4HfxW7nS8fK8aOK
 EuxNFEptayXU3HJeQV6/hIf3ONd7tRtIK4xA/eV7LuBHKbnwaRaUH+IwXEcTov9ieZr1
 KEGEk8uqt7cIkpyWlaQsMaMny7SXdPO4FuwW6Cbl53KOCSSGRu6dKB0cjgckAYEvRrY7
 LJtw==
X-Gm-Message-State: AOJu0YwPQUFcZtd9NrE03uwZEX5gg4WSti0tjt797/8OjBGxBQx0W4s3
 tob3yBryWqxUT562rRT6+W5R/dnOTzrS3+13Ous2FWX/M1qlPWd40nwrN+WPzdK2rRax/WVF7zF
 xuyi3PYTZ/sgV608dL/waGI2eeRg=
X-Gm-Gg: ASbGncv6UOB8Wi715RNlGUEm+sSsRtXyS7KZCZ+ro06ZAroWxjRQ33oOBgSRSzAAEeX
 Gm1eifu5WNROZn1+9Rs7GE6n4LDJlOLGHDXkOtu5Rg8s8IFoheF8b87jsEeR2fnWoRwhv4wE8x3
 H3q0aV9s0Ig71w8ia0Bn9SLm098w==
X-Google-Smtp-Source: AGHT+IH/ada+GWZ2KXMBx4W5SU5nLC9qBYbTnjBepjXg82sV/4sSFzUuN5opMOcg8cOxCPMm9k4uSASOrAmkS7afB3Y=
X-Received: by 2002:a05:6102:f98:b0:4bb:e8c5:b172 with SMTP id
 ada2fe7eead31-4c2e276dd7cmr3600002137.8.1741204549962; Wed, 05 Mar 2025
 11:55:49 -0800 (PST)
MIME-Version: 1.0
References: <CAN+1Hbpu9dE-JgZ9SY5cq=FV6QXLK+BcTre94V5JDGt-x_sMSA@HIDDEN>
 <CADwFkmkgdjt=Z=593ZnhOvNuYZ1WhCSpH3h3eC1O3eXzC74aUw@HIDDEN>
 <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
In-Reply-To: <CAN+1HbqFzN9_KoDr2J71WHoe75E6HcZfdB-=SUAa1aaJ6Oc=_A@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Wed, 5 Mar 2025 14:55:38 -0500
X-Gm-Features: AQ5f1JqNM0x-RS06zmI_5S2jQZJG6kXcjLx6ObOnt9m01H8ak-SXqABZzAfIfxs
Message-ID: <CAN+1Hbrpk7USpxBB7GNX9BQ1NU0=_V6BokeRiMw1xVBUwZgjDw@HIDDEN>
Subject: Re: bug#76568: 'package-install' should not install duplicate packages
To: Stefan Kangas <stefankangas@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000ae941f062f9dc607"
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 (-)

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

On Wed, Mar 5, 2025 at 12:00=E2=80=AFPM Ship Mints <shipmints@HIDDEN> wr=
ote:

> On Mon, Mar 3, 2025 at 9:34=E2=80=AFPM Stefan Kangas <stefankangas@gmail.=
com>
> 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 wa=
s
>> 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 alread=
y
> installed message.  It could suggest to the user to remove and then insta=
ll
> or we could offer to use package upgrade to the chosen package-desc.  At
> the very least, the patch prevents duplicates.
>

Thinking about it a bit more, this patch needs a little more work.  The
menu-driven package "upgrade" in describe-package-1 workflow will be
interrupted by
this patch.  It does not differentiate install vs. upgrade and calls
package-install which will now complain the package already exists.  This
should be changed to run package-upgrade.  I'll take a look.

Any feedback on the minimal patch is still welcome in the meantime.

>

--000000000000ae941f062f9dc607
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 Wed, Mar 5, 2025 at 12:00=E2=80=AFPM Ship Mints &lt;<a href=3D"mailto:sh=
ipmints@HIDDEN">shipmints@HIDDEN</a>&gt; wrote:</span></div></div><di=
v class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-f=
amily: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:ste=
fankangas@HIDDEN" target=3D"_blank">stefankangas@HIDDEN</a>&gt; wrote=
:</span></div></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_q=
uote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,2=
04);padding-left:1ex">Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN"=
 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 style=3D"font-family=
:monospace">Patch attached.=C2=A0 It prevents the menu-driven case from era=
sing the already installed message.=C2=A0 It could suggest to the user to r=
emove and then install or we could offer to use package upgrade to the chos=
en package-desc.=C2=A0 At the very least, the patch prevents duplicates.</d=
iv></div></div></blockquote><div><br></div><div><span style=3D"font-family:=
monospace"><span class=3D"gmail_default" style=3D"font-family:monospace">Th=
inking about it a bit more, this patch needs a little more work.=C2=A0=C2=
=A0</span>The menu-driven package<span class=3D"gmail_default" style=3D"fon=
t-family:monospace"> &quot;</span>upgrade<span class=3D"gmail_default" styl=
e=3D"font-family:monospace">&quot;</span><span class=3D"gmail_default" styl=
e=3D"font-family:monospace"> in describe-package-1</span> workflow will be =
<span class=3D"gmail_default" style=3D"font-family:monospace"></span>i<span=
 class=3D"gmail_default" style=3D"font-family:monospace">nterrupted=C2=A0by=
 this patch.=C2=A0 It does not differentiate install vs. upgrade and calls =
package-install which will now complain the package already exists.=C2=A0 T=
his should be changed to run package-upgrade.=C2=A0 I&#39;ll take a look.</=
span></span></div><div><span style=3D"font-family:monospace"><span class=3D=
"gmail_default" style=3D"font-family:monospace"><br></span></span></div><di=
v><span style=3D"font-family:monospace"><span class=3D"gmail_default" style=
=3D"font-family:monospace">Any feedback on the minimal patch is still welco=
me in the meantime.</span></span></div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex">
</blockquote></div></div>

--000000000000ae941f062f9dc607--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76568; Package emacs. Full text available.
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
Y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gKGNh
ZHIgKGFzc3EgbmFtZSBwYWNrYWdlLWFyY2hpdmUtY29udGVudHMpKSBwa2cpKSkKICAgICAoaWYt
bGV0KiAoKHRyYW5zYWN0aW9uCisgICAgICAgICAgICAgICA7OyBUZXN0IGZvciBhbHJlYWR5IGlu
c3RhbGxlZCB1c2luZyB0aGUgcGtnIHN5bWJvbCwgbm90CisgICAgICAgICAgICAgICA7OyB0aGUg
YXJjaGl2ZS1zcGVjaWZpYyBkaXJlY3Rvcnkgc3RydWN0dXJlLgogICAgICAgICAgICAgICAgKGlm
IChwYWNrYWdlLWRlc2MtcCBwa2cpCi0gICAgICAgICAgICAgICAgICAgKHVubGVzcyAocGFja2Fn
ZS1pbnN0YWxsZWQtcCBwa2cpCisgICAgICAgICAgICAgICAgICAgKHVubGVzcyAocGFja2FnZS1p
bnN0YWxsZWQtcCAocGFja2FnZS1kZXNjLW5hbWUgcGtnKSkKICAgICAgICAgICAgICAgICAgICAg
IChwYWNrYWdlLWNvbXB1dGUtdHJhbnNhY3Rpb24gKGxpc3QgcGtnKQogICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocGFja2FnZS1kZXNjLXJlcXMgcGtn
KSkpCi0gICAgICAgICAgICAgICAgIChwYWNrYWdlLWNvbXB1dGUtdHJhbnNhY3Rpb24gKCkgKGxp
c3QgKGxpc3QgcGtnKSkpKSkpCisgICAgICAgICAgICAgICAgICh1bmxlc3MgKHBhY2thZ2UtaW5z
dGFsbGVkLXAgcGtnKQorICAgICAgICAgICAgICAgICAgIChwYWNrYWdlLWNvbXB1dGUtdHJhbnNh
Y3Rpb24gKCkgKGxpc3QgKGxpc3QgcGtnKSkpKSkpKQogICAgICAgICAocHJvZ24KICAgICAgICAg
ICAocGFja2FnZS1kb3dubG9hZC10cmFuc2FjdGlvbiB0cmFuc2FjdGlvbikKICAgICAgICAgICAo
cGFja2FnZS0tcXVpY2tzdGFydC1tYXliZS1yZWZyZXNoKQogICAgIC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Y3MtbGlzcC9wYWNr
YWdlLXRlc3RzLmVsIGIvdGVzdC9saXNwL2VtYWNzLWxpc3AvcGFja2FnZS10ZXN0cy5lbAppbmRl
eCBkOGUyNjAzMTliZC4uMzY2MTdlZDZmNmUgMTAwNjQ0Ci0tLSBhL3Rlc3QvbGlzcC9lbWFjcy1s
aXNwL3BhY2thZ2UtdGVzdHMuZWwKKysrIGIvdGVzdC9saXNwL2VtYWNzLWxpc3AvcGFja2FnZS10
ZXN0cy5lbApAQCAtMjQ4LDYgKzI0OCwxMCBAQCBwYWNrYWdlLXRlc3QtaW5zdGFsbC1zaW5nbGUK
ICAgICAgIChzaG91bGQgKHN0cmluZy1tYXRjaCAiXltg4oCYJ11zaW1wbGUtc2luZ2xlW+KAmSdd
IGlzIGFscmVhZHkgaW5zdGFsbGVkXG4/XFwnIgogICAgICAgICAgICAgICAgICAgICAgICAgICAg
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: Sat, 14 Jun 2025 22:45:04 UTC

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