From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#62720: 29.0.60; Not easy at all to upgrade :core packages like Eglot Date: Tue, 11 Apr 2023 12:02:48 +0100 Message-ID: <87ile2n0kn.fsf@gmail.com> References: <87a5zj2vfo.fsf@gmail.com> <87wn2modrm.fsf@posteo.net> <87ile6o2ov.fsf@posteo.net> <87y1mz38rl.fsf@posteo.net> 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="38578"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Lars Ingebrigtsen , 62720@debbugs.gnu.org, eliz@gnu.org, Stefan Monnier To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 11 13:01:53 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 1pmBl1-0009kB-RT for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 Apr 2023 13:01:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pmBkg-000870-Ta; Tue, 11 Apr 2023 07:01:32 -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 1pmBkP-00084x-Vb for bug-gnu-emacs@gnu.org; Tue, 11 Apr 2023 07:01:15 -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 1pmBkE-0005AB-P7 for bug-gnu-emacs@gnu.org; Tue, 11 Apr 2023 07:01:13 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pmBkE-0006uz-46 for bug-gnu-emacs@gnu.org; Tue, 11 Apr 2023 07:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Apr 2023 11:01:02 +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.168121085726576 (code B ref 62720); Tue, 11 Apr 2023 11:01:02 +0000 Original-Received: (at 62720) by debbugs.gnu.org; 11 Apr 2023 11:00:57 +0000 Original-Received: from localhost ([127.0.0.1]:36714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pmBk8-0006ua-OC for submit@debbugs.gnu.org; Tue, 11 Apr 2023 07:00:57 -0400 Original-Received: from mail-wm1-f46.google.com ([209.85.128.46]:35353) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pmBk4-0006uJ-Fr for 62720@debbugs.gnu.org; Tue, 11 Apr 2023 07:00:55 -0400 Original-Received: by mail-wm1-f46.google.com with SMTP id v14-20020a05600c470e00b003f06520825fso9331257wmo.0 for <62720@debbugs.gnu.org>; Tue, 11 Apr 2023 04:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681210846; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=eOlO9mj4EpoZyG/4ZA4MsC7PzVYmFOt0Vxzn/lnfFYw=; b=U1Q3RAfAit/n3JZ7pF/Ibl4sjA5t590COf5/n6Kjv1NWyjBZEd2TIRQu0lnUJFILfq 1zXaNs/Cp7Yvvd9AGZjoBL/XmoqaECh7eMbVcSLHA7McQNMTnY7xuBfWiIh/5xW/eEZo bHvxEUxPiP7AwZSfDxhZET/jquOtE+K29PlXM2VeqkoREfnqr6BoxUbI52nQ0HkVJOzh fcjX5NdVJWzXQNT4xrxh1nbDUTQjniu1i600rTsx+LG45wo6VsxRw6cluXpw4PrcRTkE Z/DzHpcMqtvuPumfBmywdsHrN2GgWK4/+FrFM086ooODSYsyvYfqy5NShzNeZyYBYLSv YqfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681210846; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=eOlO9mj4EpoZyG/4ZA4MsC7PzVYmFOt0Vxzn/lnfFYw=; b=JIFbp9k28g3i8OLcF8Ey15gfqPp9dcZG2X7CncgCLAXhmDzrVbeEOUB/RPSqA6Wdvs kULbL4X71JqI+w3MoMqm1f5QdYQePu9nQD9tHfdj2QaZ1XzwYOeRlFi5LH1/LJIzWC4q 1bjYFYyRWKiaBfK/n5T/Acd2TPgBpflqgFaRO1wQFYipDctAhK52Sred31rMA/T4gLRU 691aRZ2qR4zpkTwe46VUyoSzTqksB43HU6Bx1qlosqFhvKcI/+s/8alKJe9vtpJTCdY2 aN9PJWIaTFdE65Aag1OXi8SF5QFXaAqAqwwu1pkd4gmClOnCsKEmKytyo4N7XQRNfJBa zf6A== X-Gm-Message-State: AAQBX9fgZOqMwUQjVMWkEGhini/6YzYOb9oEp7m0caPh/4K1RDIEuxtD juTI3Mw8gztxQbLvG8msUG4= X-Google-Smtp-Source: AKy350Yd1pIAEFhrk+nV8CVqPEMuUR+sC6rnPGa4pBDdxGe3PGWmJoG/8XyFTDbbfvklfcRuQwLHiw== X-Received: by 2002:a1c:f705:0:b0:3f0:4e04:b8f8 with SMTP id v5-20020a1cf705000000b003f04e04b8f8mr9430344wmh.39.1681210846281; Tue, 11 Apr 2023 04:00:46 -0700 (PDT) Original-Received: from krug ([87.196.73.56]) by smtp.gmail.com with ESMTPSA id z3-20020a05600c0a0300b003ee6aa4e6a9sm21019785wmp.5.2023.04.11.04.00.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Apr 2023 04:00:43 -0700 (PDT) In-Reply-To: <87y1mz38rl.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 10 Apr 2023 18:13:50 +0000") 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:259629 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Philip Kaludercic writes: > Will this not affect `package-update-all'? I don't if we want that the > command installs all packages from ELPA that it can find. Thanks. I've just tested 'M-x package-update-all' with my patch. It updates the built-in and the manually installed packages that can be updated. It _doesn't_ install any packages that weren't installed yet, of course. In this case, in a bare emacs-29/src/emacs -Q, it updates the Eglot package, the Eldoc package and few others. I think this is exactly what M-x package-update-all is supposed to do (but see notes at the end of this email). So I think my change to the existing package-update and package--updateable-packages fixes the bug cleanly. >> Lots of consp, cdr-taking, vectorp and so on. Besides that, it's >> a question of taking the union of the two sets and operating on that. > That is necessary complexity, so I don't think there is any way around it. There is, but that's just an improvement, in this case to the type-starved 'package--bi-desc' structure and the 'package--builtins' built by finder.el. A common structure format should be used. Or, better yet, CLOS. Anyway, with the version of the patch I posted earlier, there are the 6 (six) packages updated currently from a "bare" emacs 29. (csharp-mode eglot eldoc jsonrpc transient verilog-mode) Of these, csharp-mode and transient are mistakes. But that's not my patch's fault :-)=20 - csharp-mode.el is merely missing version information, so package.el thinks that the ELPA version supersedes it (when in fact it doesn't: it's older). The patch adds version information to csharp-mode.el to fix that. - transient.el has version information but in a header that finder.el doesn't recognize. The patch has a minimal fix for that, too. So the final patch that I'm proposing for emacs 29 is attached. M-x package-update-all fixes those cases and correctly finds and updates 4 packages to their newest released versions, exactly as it should. (eglot eldoc jsonrpc verilog-mode) Eli, what do you think? Who is package.el's main maintainer? Everyone? Lars added M-x package-update (for Emacs 29) so I'm pinging him as well. Jo=C3=A3o --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-Add-ability-to-update-built-in-packages-bug-62720.patch Content-Transfer-Encoding: quoted-printable >From 65e811a0fcf9ffd1f12b8b2a2d9d8a0474543b36 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Jo=3DC3=3DA3o=3D20T=3DC3=3DA1vora?=3D Date: Tue, 11 Apr 2023 11:52:46 +0100 Subject: [PATCH] Add ability to update built-in packages (bug#62720) Previously package.el's M-x package-update command completely ignored built-in packages. With this patch in place, it updates them along with any other manually installed non-built-in packages, as long as the version available from ELPA is newer. To prevent misupdates of the 'transient.el' and 'csharp-mode.el' packages, which are built into emacs-29, version information is now correctly collected from these two. * lisp/finder.el (finder-compile-keywords): Be aware of "Package-Version" header. * lisp/emacs-lisp/package.el (package-update): Rework. (package--updateable-packages): Rework. * lisp/progmodes/csharp-mode.el: Add version information. --- lisp/emacs-lisp/package.el | 26 ++++++++++++++++++-------- lisp/finder.el | 2 +- lisp/progmodes/csharp-mode.el | 1 + 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index f92afe56b76..286583100c3 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2243,11 +2243,16 @@ package-update (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)))) + (nonbuiltin (assq package package-alist))) + (cond (nonbuiltin + (let ((desc (cadr nonbuiltin))) + (if (package-vc-p desc) + (package-vc-update desc) + (package-delete desc 'force) + (package-install package 'dont-select)))) + (t + (package-install + (cadr (assq package package-archive-contents))))))) =20 (defun package--updateable-packages () ;; Initialize the package system to get the list of package @@ -2261,10 +2266,15 @@ package--updateable-packages (assq (car elt) package-archive-contents))) (and available (version-list-< - (package-desc-version (cadr elt)) + (if (vectorp (cdr elt)) + (aref (cdr elt) 0) + (package-desc-version (cadr elt))) (package-desc-version (cadr available))))) - (package-vc-p (cadr (assq (car elt) package-alist))))) - package-alist))) + (and (consp (cdr elt)) + (package-desc-p (cadr elt)) + (package-vc-p (cadr elt))))) + (seq-union package-alist package--builtins + (lambda (a b) (eq (car a) (car b))))))) =20 ;;;###autoload (defun package-update-all (&optional query) diff --git a/lisp/finder.el b/lisp/finder.el index 5aec0149b89..ddc6d6f03da 100644 --- a/lisp/finder.el +++ b/lisp/finder.el @@ -231,7 +231,7 @@ finder-compile-keywords summary (or (cdr (assq package finder--builtins-descriptions)) (lm-synopsis)) - version (lm-header "version"))) + version (or (lm-header "package-version") (lm-header "version")))) (when summary (setq version (or (ignore-errors (version-to-list version)) (alist-get package package--builtin-versions= ))) diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index 47cd13e7fdb..cd045cd14d1 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -8,6 +8,7 @@ ;; Jostein Kj=C3=B8nigsen ;; Created : September 2022 ;; Keywords : c# languages oop +;; Version : 3.0.0 =20 ;; This file is part of GNU Emacs. =20 --=20 2.39.2 --=-=-=--