From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#72141: 29.4; package-upgrade vs package-load-list Date: Mon, 12 Aug 2024 17:36:21 +0000 Message-ID: <87jzgl3ap6.fsf@posteo.net> References: <87ikx5xulu.fsf@posteo.net> <865xsr2tn0.fsf@gnu.org> <871q3drb4v.fsf@posteo.net> <8634nt1z2k.fsf@gnu.org> <87plqxbsh4.fsf@posteo.net> <87o76c3fiq.fsf@posteo.net> <8734nmguiq.fsf@posteo.net> <8734nkz67g.fsf@posteo.net> <87ikwgjjl3.fsf@posteo.net> <877ccl8zqc.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21528"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Thierry Volpiatto , Eli Zaretskii , 72141@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 12 19:33:48 2024 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 1sdYvT-0005N9-NW for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Aug 2024 19:33:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdYvF-0007aW-Lj; Mon, 12 Aug 2024 13:33:33 -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 1sdYvC-0007Zh-De for bug-gnu-emacs@gnu.org; Mon, 12 Aug 2024 13:33:31 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sdYvC-0002zl-3k for bug-gnu-emacs@gnu.org; Mon, 12 Aug 2024 13:33:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=eDY5Yn7vyuqZV86+mXV4SrEJPj9NBwTDXfQaO1mjWvE=; b=H5xaaSYXqH2ovh1/RkfHGSemeEcHdf2Nvm5TqsePLhUT6dKyCFzw8fx3gnkQPCkUWOhi4M/ELhS34m30zh6O0biNRE8UnQFfg98lr+0zL7431FhmobJj6Cxuwn6CJz6XfNFIBZeCdaTLc7ekLfTeCD6ZXQM33KHa6Ag2bgTI3/rI1D7kxtWTFPuAo2pJNEqRp8x11lzqSb4Xeeg+sWRLXOG91AYe0jLxrQQ/Zad5kO/7RUB49XYPa5e1AdFzB+FVLcIelvFfH2avAVwipWUPny9ZGccI6Cf382ILci4lDRz5ep2A+aDEXS9u2kjA9La2Mh0dIK4aJFXxYQ3JgNos/Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sdYvi-00057R-CT for bug-gnu-emacs@gnu.org; Mon, 12 Aug 2024 13:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Aug 2024 17:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72141 X-GNU-PR-Package: emacs Original-Received: via spool by 72141-submit@debbugs.gnu.org id=B72141.172348400619617 (code B ref 72141); Mon, 12 Aug 2024 17:34:02 +0000 Original-Received: (at 72141) by debbugs.gnu.org; 12 Aug 2024 17:33:26 +0000 Original-Received: from localhost ([127.0.0.1]:43767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdYv7-00056J-Ng for submit@debbugs.gnu.org; Mon, 12 Aug 2024 13:33:26 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:45997) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdYv4-000562-Ob for 72141@debbugs.gnu.org; Mon, 12 Aug 2024 13:33:23 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 30484240101 for <72141@debbugs.gnu.org>; Mon, 12 Aug 2024 19:32:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1723483964; bh=NHyrtvC4Z/biX9dDMXMpviB8nz2njpujS7lnk/QRcAM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Autocrypt:OpenPGP:From; b=TvSooBOlz7bQHR/F7HnhYPKhjVUPu0zt0mQ3zcOAdKMv8UilTc86h/mOOu8KOZjQu ykbEwsFhNmruQw5sk74E+shWh3QC1AugLa6W/LDxxJvmWUTEVesIc/vxhlERwDeDeQ tBxzWNqIBKvv5SZcKjXXPxbjYGHXkkETNhHRJ/h0AHlJWiPVy/Mir9z+Qbnj9rMvKu 7QHzjZ4ZqY991HA7vitjE6kDBR7fmRoIChuYaAb7nzJanVQjw9vkxJaDQnjnBX8UA/ wRE7vwf3TZqmjKStEG2tzFArOwIWglThk5YI0cLF9U6CaesR49fD881USfSjsPUf6Z JNFuIUQF0jANg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WjM6K2BYhz9rxB; Mon, 12 Aug 2024 19:32:41 +0200 (CEST) In-Reply-To: <877ccl8zqc.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 12 Aug 2024 16:36:43 +0000") Autocrypt: addr=thievol@posteo.net; prefer-encrypt=mutual; keydata=xsDNBF8ylcIBDADG+hy+zR6L4/vbdDDZuSaMmSrU3A5QZJpeBCvxTr7MpzzruZbhLPW1K3R6N2MA edi8Y+C8o27FVRIjpdbaKMGu9je7JV/TbUQYo3SOwCK1vM4LUn4V6ZLzSYkuiEt4eyMoiDdyvN0p kcK6P9x9DCetcEVszXzQg+yzCVrQ2hXWDXWT4M18EC3wtO7RHPouMqGiwBFhBAYErCqFWFxQHkfb tG/4yGyJ58rglb65O3qijjMWvYwcWZun9/7qm8Z4/4mHopmo2zgU+OrptnLSZfkZGz3Y7Uf452xQ GVq0Fv75NPvQru7y+DYVhuVXXyAmGxt+vf4rIiixMBbhKEPjcxEPAa2LTzex2IsTZR+QVG9uDnqC WcgaOEQ58fzXNvNhtwwF/Rgio2XWAJVdmFWS59/k9W58CIUSNKBMZh2XeGdEmtHvDtCxW3z6FJha 36RzOM3fMNNiAGdFZJA84gcdloJR+sHCDTTPT3784fjr+V8An7sI581NGFzkRQqPvEQCZbUAEQEA Ac0SdGhpZXZvbEBwb3N0ZW8ubmV0wsEOBBMBCgA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheA FiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmL3HCoACgkQDsVtFB0W75OVEAv/f6XxmtIFz08fUb8h Bp/zJP6IC4/rhhh+0GMRIRzLN8DK0jV8JCzYdFHiRJOy2lNIOpmrrCmjRRxferc2G42+ePFIsslx hU46VSz1Z83NwIG3mpdYNV5WUTUdgzxExHTNTFCd7NKv0nlHKQaA OpenPGP: url=https://posteo.de/keys/thievol@posteo.net.asc; preference=encrypt 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:290056 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Philip Kaludercic writes: > Thierry Volpiatto writes: > >> Hello Philip, >> >> Philip Kaludercic writes: >> >>> Gladly, then I'd like to try it out it and perhaps write a ERT test. >> >> Patch attached, please review and test it before merging ;-) > > Sorry for the delay. > >> Thanks. >> >> --=20 >> Thierry >> >> From 292e251a383c1fb53cc377cd32f71705e6742f85 Mon Sep 17 00:00:00 2001 >> From: Thierry Volpiatto >> Date: Sat, 3 Aug 2024 06:07:28 +0200 >> Subject: [PATCH] Fix bug#72141, package-upgrade should not include disab= led >> packages >> >> * lisp/emacs-lisp/package.el (package--upgradeable-packages): >> Rewrite with a new optional arg to filter out disabled packages from >> output. >> (package-upgrade, package-upgrade-all): Use it and filter out built-in >> packages from completion according package-install-upgrade-built-in >> value. >> --- >> lisp/emacs-lisp/package.el | 60 ++++++++++++++++++++++---------------- >> 1 file changed, 35 insertions(+), 25 deletions(-) >> >> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el >> index 7cae8d68bc0..83996c9d6de 100644 >> --- a/lisp/emacs-lisp/package.el >> +++ b/lisp/emacs-lisp/package.el >> @@ -2259,11 +2259,15 @@ had been enabled." >> "Upgrade package NAME if a newer version exists." >> (interactive >> (list (completing-read >> - "Upgrade package: " (package--upgradeable-packages t) nil t))) >> + "Upgrade package: " (package--upgradeable-packages >> + package-install-upgrade-built-in >> + 'ignore-disabled) >> + nil t))) >> (let* ((package (if (symbolp name) >> name >> (intern name))) >> (pkg-desc (cadr (assq package package-alist))) >> + ;; Keep this binding for non-interactive use. >> (package-install-upgrade-built-in (not pkg-desc))) >> ;; `pkg-desc' will be nil when the package is an "active built-in". >> (if (and pkg-desc (package-vc-p pkg-desc)) >> @@ -2275,32 +2279,37 @@ had been enabled." >> ;; before. Mark it as installed explicitly. >> (and pkg-desc 'dont-select))))) >>=20=20 >> -(defun package--upgradeable-packages (&optional include-builtins) >> +(defun package--upgradeable-packages (&optional >> + include-builtins ignore-disable= d) >> ;; Initialize the package system to get the list of package >> ;; symbols for completion. >> (package--archives-initialize) >> - (mapcar >> - #'car >> - (seq-filter >> - (lambda (elt) >> - (or (let ((available >> - (assq (car elt) package-archive-contents))) >> - (and available >> - (or (and >> - include-builtins >> - (not (package-desc-version (cadr elt)))) >> - (version-list-< >> - (package-desc-version (cadr elt)) >> - (package-desc-version (cadr available)))))) >> - (package-vc-p (cadr elt)))) >> - (if include-builtins >> - (append package-alist >> - (mapcan >> - (lambda (elt) >> - (when (not (assq (car elt) package-alist)) >> - (list (list (car elt) (package--from-builtin elt))= ))) >> - package--builtins)) >> - package-alist)))) >> + (let ((pkgs (if include-builtins >> + (append package-alist >> + (append package-alist >> + (mapcan >> + (lambda (elt) >> + (when (not (assq (car elt) package= -alist)) >> + (list >> + (list >> + (car elt) >> + (package--from-builtin elt))))) >> + package--builtins))) >> + package-alist))) >> + (cl-loop for (sym desc) in pkgs >> + for available =3D >> + (if-let ((av (assq sym package-archive-contents))) >> + (if ignore-disabled >> + (and (not (package-disabled-p sym cversion)) av) a= v)) > ^ > This loop really confused me. Specifically here > If I am not mistaken, cversion might be set by the last iteration, no? > In that case, we are passing some version string unrelated to sym? Yes, indeed, this is an error, thanks to catch it. > I am leaning towards keeping the existing loop, i.e. not rewriting > anything while fixing a bug. It is probably easier for me to do that. No problem, it is probably better to not introduce a new bug for now. > Do you have any comments on tricks or traps that I should keep in > mind? Yes the other changes are about built-in packages that are shown in completion, and refused later by package-install. >> (defun package-upgrade-all (&optional query) >> @@ -2315,7 +2324,8 @@ from ELPA by either using `\\[package-upgrade]' or >> `\\\\[package-menu-mark-install]' after `\\[list= -packages]'." >> (interactive (list (not noninteractive))) >> (package-refresh-contents) >> - (let ((upgradeable (package--upgradeable-packages))) >> + (let ((upgradeable (package--upgradeable-packages >> + package-install-upgrade-built-in Here. >> I have a patch for this, let me know if interested, or perhaps I should >> open a new bug report ? > > I have some spare time now, and if I also find some spare energy, I plan > to clean up a number of things in package.el, mainly removing duplicate > logic and making the code more flexible. I'll start work on a separate > branch, and that's why I am not too enthusiastic about these kinds of > changes on master (for now). Great, no problem, as long as it is cleaned up that's good ;-) Thanks. =2D-=20 Thierry --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCgAxFiEEI9twfRN7r3nig/xwDsVtFB0W75MFAma6SBYTHHRoaWV2b2xA cG9zdGVvLm5ldAAKCRAOxW0UHRbvkwKIDACUJegcbx9bWL5eayhuP3VIB8rJxQoU XV+wer+GUBQDMYUPeZ1ivtfxoCay7Fnxq5jWPq29zmoNgK5WuylIe5f5I4/PNT4O 4ciiEEPGEnfX2LW8rthOB5OZKg16L/9Vp5chVHPKvP0XOW+odFLebDh5VKQ1JiGf qE6qqyfKlMIXiLRDVPGY88JU0CIlp0/4qeL/Q2pkpijeEcWlGXGhKvPqxsOozzs/ r6nLXtABlbNhVbNy59fyt7nR37YUdjurdc4Gf3HLhgB2g6mC/EQpGPlRKgQ9btvZ x9LPgMKvzJ0ujrZQ/YGDr1/ly4zjJX7Vto73OfajAmoy+7U9OKrogJNke/SqP5xv kTCcJrW5LfxsaI/qmqj4R1JQVfHQna2D/TP3PhGtaH9zQiMKgtMyHXpJjQwJkZ07 baQ0mbcpVajqvo5cgg8NOVVjxfmgT59ClObevH0U0uxn98hRDKtz1QcW75/QFSrE tTuBJw5/T/Bcden+r+fYPYBQoNKd/d9XyKA= =tKjr -----END PGP SIGNATURE----- --=-=-=--