From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#62720: 29.0.60; Not easy at all to upgrade :core packages like Eglot Date: Fri, 14 Apr 2023 16:40:01 +0000 Message-ID: <87pm86pgda.fsf@posteo.net> References: <87a5zj2vfo.fsf@gmail.com> <83sfd5761f.fsf@gnu.org> <87zg7djrgr.fsf@gmail.com> <83o7nt73za.fsf@gnu.org> <83mt3d73c2.fsf@gnu.org> <87r0sptinq.fsf@posteo.net> <83jzyh706c.fsf@gnu.org> <875ya1tdwf.fsf@posteo.net> <83edop6sdy.fsf@gnu.org> <831qkp6o0i.fsf@gnu.org> <83wn2h5825.fsf@gnu.org> <87wn2gkhzr.fsf@posteo.net> <83cz485oxi.fsf@gnu.org> <87leiwdyff.fsf@posteo.net> <87a5zblspg.fsf@posteo.net> <83ildz4vu7.fsf@gnu.org> <87mt3bk31e.fsf@posteo.net> <83r0smg2a6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3793"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 62720@debbugs.gnu.org, joaotavora@gmail.com, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 14 18:40:13 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pnMT6-0000jT-Ob for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 Apr 2023 18:40:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pnMSz-0005ea-EW; Fri, 14 Apr 2023 12:40:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pnMSx-0005eN-7U for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 12:40:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pnMSw-0000zc-FA for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 12:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pnMSv-0003C2-U3 for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 12:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Apr 2023 16:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62720 X-GNU-PR-Package: emacs Original-Received: via spool by 62720-submit@debbugs.gnu.org id=B62720.168149038112241 (code B ref 62720); Fri, 14 Apr 2023 16:40:01 +0000 Original-Received: (at 62720) by debbugs.gnu.org; 14 Apr 2023 16:39:41 +0000 Original-Received: from localhost ([127.0.0.1]:47441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnMSa-0003BL-Fu for submit@debbugs.gnu.org; Fri, 14 Apr 2023 12:39:40 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:59581) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnMSY-0003B9-BW for 62720@debbugs.gnu.org; Fri, 14 Apr 2023 12:39:38 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 95C76240227 for <62720@debbugs.gnu.org>; Fri, 14 Apr 2023 18:39:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1681490372; bh=OBCl1PuL9mo4gA0aYyTnEtR8SMl9AlFZ2LWYyCaXCYs=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=k98aU3ldX2uZqi20TPK13ryMii9yN19QyIsn4I8mn94jr3FbnNDXtb/Laon/Vcf9s 3OKxK3PBi+KFXQiLi3yAgt7HiBJoh9eYtrVnDVpT4HrZcxrTUQpH+Vj7Ur1QTPgD5T wML8gBiFQRz5yDLIHo8u9hZfZB6x7UK0nEJ/JFzEqOsS8TSqoqVYGWXbadj3DSG+Sc SexeMY6E+MIxKm16xSu903ThuBiWYz5fBTvjJUtFyaN8QtqnbgaEWkUI2QY5+sF0Sh yN0WWe761nxDkcgWmTsh0A5VeVx9xQbBwSBJj09U3saUcFkeHc3+YqhXXzquoDYY4O SyEexnACF1TJQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PyhxH66Chz6tvp; Fri, 14 Apr 2023 18:39:31 +0200 (CEST) In-Reply-To: <83r0smg2a6.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 14 Apr 2023 13:56:49 +0300") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:259940 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: joaotavora@gmail.com, monnier@iro.umontreal.ca, 62720@debbugs.gnu.org, >> larsi@gnus.org >> Date: Thu, 13 Apr 2023 19:14:37 +0000 >> >> > Are we still sure we want to change package-install, not >> > package-upgrade? AFAIU, there were several voices that preferred the >> > latter, with the rationale that a built-in package is always >> > "installed", so "installing" it makes little or no sense. >> >> If you want that, here is one proposal. Should be the smallest so far: > > Hmm... looks identical to the previous patch you sent, which changes > package-install? Or what am I missing? > > As for the question I asked: I'm okay with changing package-install if > there are no objections from those who proposed to change > package-upgrade instead. Did I send the wrong patch. I double-checked now and this one should be using package-update: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Allow-package-update-to-upgrade-built-in-packages.patch >From 7b3ca355785b7539dd417317442054647e66c045 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 13 Apr 2023 21:12:31 +0200 Subject: [PATCH] Allow 'package-update' to upgrade built-in packages * lisp/emacs-lisp/package.el (package-update): Add support for upgrading a built-in package to a version available from ELPA. (Bug#62720) --- lisp/emacs-lisp/package.el | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index f92afe56b76..8e7bc115a73 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2236,18 +2236,32 @@ package-install ;;;###autoload (defun package-update (name) - "Update package NAME if a newer version exists." + "Update package NAME if a newer version exists. +When invoked with a prefix argument, the prompt will also include +built-in packages that can be upgraded via a package archive." (interactive (list (completing-read - "Update package: " (package--updateable-packages) nil t))) + "Update package: " + (append + (and current-prefix-arg + (mapcan + (lambda (elt) + (and (not (assq (car elt) (package--alist))) + (package-built-in-p (car elt)) + (list (symbol-name (car elt))))) + package-archive-contents)) + (package--updateable-packages)) + nil t))) (let* ((package (if (symbolp name) name (intern name))) - (pkg-desc (cadr (assq package package-alist)))) - (if (package-vc-p pkg-desc) - (package-vc-update pkg-desc) - (package-delete pkg-desc 'force) - (package-install package 'dont-select)))) + (old-desc (cadr (assq package package-alist))) + (new-desc (cadr (assq package package-archive-contents)))) + (if (and old-desc (package-vc-p old-desc)) + (package-vc-update old-desc) + (when old-desc + (package-delete old-desc 'force)) + (package-install new-desc 'dont-select)))) (defun package--updateable-packages () ;; Initialize the package system to get the list of package -- 2.39.2 --=-=-=--