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: Sun, 23 Apr 2023 13:02:06 +0000 Message-ID: <87354q92gh.fsf@posteo.net> References: <87a5zj2vfo.fsf@gmail.com> <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> <834jpk5hih.fsf@gnu.org> <871qkom3fj.fsf@posteo.net> <83mt3b4yfc.fsf@gnu.org> <87edonlsxi.fsf@posteo.net> <83jzyf4vzb.fsf@gnu.org> <871qknllkj.fsf@posteo.net> <83fs934pjf.fsf@gnu.org> <87wn2fk47y.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21900"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62720@debbugs.gnu.org, Eli Zaretskii , larsi@gnus.org, monnier@iro.umontreal.ca, joaotavora@gmail.com To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 23 15:02:23 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 1pqZME-0005Wr-U9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 23 Apr 2023 15:02:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pqZLy-00034W-Or; Sun, 23 Apr 2023 09:02:06 -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 1pqZLw-00033t-H3 for bug-gnu-emacs@gnu.org; Sun, 23 Apr 2023 09:02:04 -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 1pqZLv-0003pd-O0 for bug-gnu-emacs@gnu.org; Sun, 23 Apr 2023 09:02:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pqZLu-0007Qh-57 for bug-gnu-emacs@gnu.org; Sun, 23 Apr 2023 09:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Apr 2023 13:02: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.168225490328533 (code B ref 62720); Sun, 23 Apr 2023 13:02:02 +0000 Original-Received: (at 62720) by debbugs.gnu.org; 23 Apr 2023 13:01:43 +0000 Original-Received: from localhost ([127.0.0.1]:44823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqZLb-0007Q9-5Y for submit@debbugs.gnu.org; Sun, 23 Apr 2023 09:01:43 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:36815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqZLZ-0007Pu-BC for 62720@debbugs.gnu.org; Sun, 23 Apr 2023 09:01:42 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 87CF12400B1 for <62720@debbugs.gnu.org>; Sun, 23 Apr 2023 15:01:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1682254895; bh=oF2wLn4VHmkdT0N010431S4Z9bUUmYCAY4SLtIHhqcI=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=Dro6TU85D31nrnVbFTPWm4feO43Fplk7OTNsFoE/7gzNnQKG894lLMxO5W2WGBneW DsxR1RKCxyE+bNSwqJXTZkJAW7p7I26iNzdrB7xt6fH4PTqcLF2u8u84KKeZlO8CFr b7aJIc1y1F7gphy6+X/TdPuCD6Ergd33vqDGIMbIQSPihcNJ4quapQddGbryUajLiv PEJ/p3rYO3fRzo1aNq9djXM7HOYnqRDZ8UkHskVV6EVqYCpxFPseeHpDeDQEkUn0ls uVRO8RI55fqKSwhc5D7HIrlVtvG2OD+HSop1/yrhIZkw3VyZ+btn3ncwGdPUQx6q22 ny4d2c4ru9ihA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Q47gf34fwz6tn4; Sun, 23 Apr 2023 15:01:34 +0200 (CEST) In-Reply-To: (Dmitry Gutov's message of "Sun, 23 Apr 2023 02:37:50 +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:260509 Archived-At: Dmitry Gutov writes: > Philip, > > On 13/04/2023 21:49, Philip Kaludercic wrote: >> + (when (and (or current-prefix-arg package-install-upgrade-built-in) >> + (package--active-built-in-p pkg)) >> + (setq pkg (cadr (assq name package-archive-contents)))) > > How sure are you that the first element in (cdr (assq name > package-archive-contents)) will contain the latest version? This is not certain, but the same approach is used in other places in package.el, so I just stocked to it. > When reading the code I stumbled on these two items: > > - Comment in package-compute-transaction: > > ;; pkg-descs is sorted by priority, not version, so > ;; don't error just yet. > > - package-menu--find-upgrades iterates through installed packages and > checks for new versions with this condition: > > (version-list-< (package-desc-priority-version pkg-desc) > (package-desc-priority-version avail-pkg)) > > That's why I came with the more complex way to choose the appropriate > package-desc in my latest attempt: > > (car > (last (seq-sort-by #'package-desc-priority-version > #'version-list-< > (cdr (assq package package-archive-contents))))) If we insist on package.el installing the newest version, then this would make sense. AFAIK there is no guarantees on the order of packages in `package-archive-contents'. This shouldn't be an issue for Eglot, but might be one for use-package. I would actually pull it out into a separate utility function that we would re-use in other places. > Would be happy to hear it's an overkill and we can use the more simple > version.