Subject: bug#62720: 29.0.60; Not easy at all to upgrade :core packages like Eglot

From: Dmitry Gutov <[email-masked]>
Date: Wed, 12 Apr 2023 18:45:01 +0300

On 12/04/2023 14:00, João Távora wrote:
> Eli Zaretskii<[email-masked]>  writes:
> 
>> the restrictions.  What else can I say to express clearly that I would
>> like such a command to not be installed?
> Had another idea: what about this very tiny patch, then?  It makes `M-x
> package-install` work for installing a :core package.  This also rhymes
> exactly with Stefan's intution/feeling that :core packages need to be
> "installed" to promote them to installable.  The current M-x
> package-install recommendation could remain flawlessly and then you can
> do whatever you think is best for M-x package-update & friends.
> 
> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index f92afe56b76..134505a96af 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -2164,8 +2164,10 @@ package-installed-p
>          (and pkg-descs
>               (version-list-<= min-version
>                                (package-desc-version (car pkg-descs)))))
> -     ;; Also check built-in packages.
> -     (package-built-in-p package min-version)))))
> +     ;; Also check built-in packages.  But if min-version is nil, just
> +     ;; act as if a package-desc had been passed (bug#62720)
> +     (and min-version (package-built-in-p package min-version))))))
>   
>   (defun package-download-transaction (packages)
>     "Download and install all the packages in PACKAGES.

If the package becomes "mass-upgradable" afterwards, this seems like the 
best solution, behavior-wise (imminent 29 release aside, of course).

Does 'M-x package-update/upgrade' get fixed automatically with this, or 
does it need separate changes?