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: Sun, 28 Jul 2024 12:39:51 +0000 Message-ID: <87plqxbsh4.fsf@posteo.net> References: <87ikx5xulu.fsf@posteo.net> <865xsr2tn0.fsf@gnu.org> <871q3drb4v.fsf@posteo.net> <8634nt1z2k.fsf@gnu.org> 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="8683"; mail-complaints-to="usenet@ciao.gmane.io" Cc: thievol@posteo.net, Philip Kaludercic , 72141@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 28 14:37:06 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 1sY397-00025x-Gq for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Jul 2024 14:37:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sY38v-0006NV-68; Sun, 28 Jul 2024 08:36:53 -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 1sY38s-0006ND-S8 for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2024 08:36:51 -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 1sY38s-0000zJ-Jx for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2024 08:36:50 -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=I/7OgfO042bHajmA6OKU4fpJf1za29r8gP158eU5Hrk=; b=pJE0Ypk4zqbluT9a+X0OQSRZbuXzDl0HHw3WS8CTO1hCEfQDgu2GbAY+RxjP+XdNh9nAVjPzL+PqI/VFy6gLUsqZEXxBrkFmrPjCF39gbApKW2JAR9hl5vGscvdM+PRiqy+sJx66V41jH/lmhu1syKLIrK1dzLO2F9C/+EQpiXSooJIxtO1Pdl40oPYqVKOPZrnrM+h5HIp2Y6IDJaBXiVx6W3Hsj1XBSLODtKs+M2lKHHC/FCig0jSUXL8MIaygmXCh81E7mJE9j7/+iCD9K511OGTSTLDCQ3cXAdJdjBpRiBf52gaQKvnfPY+m7Op2VZtolyL8BTabVAuIK2XWOA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sY393-0007Xf-Tp for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2024 08:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Jul 2024 12:37:01 +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.172217020728969 (code B ref 72141); Sun, 28 Jul 2024 12:37:01 +0000 Original-Received: (at 72141) by debbugs.gnu.org; 28 Jul 2024 12:36:47 +0000 Original-Received: from localhost ([127.0.0.1]:42820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sY38o-0007XA-Hi for submit@debbugs.gnu.org; Sun, 28 Jul 2024 08:36:46 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:35837) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sY38m-0007Ww-1K for 72141@debbugs.gnu.org; Sun, 28 Jul 2024 08:36:45 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 787D4240029 for <72141@debbugs.gnu.org>; Sun, 28 Jul 2024 14:36:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1722170186; bh=R9rlwal69rhYH0716WE8LTmOEd+D4PHIrI3LJZc5hk0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Autocrypt:OpenPGP:From; b=YkudMQnxQxfQ7vkS0hUQdRp0cRgoZrQu5hfosnZak0+gVYDVZvtaMseLn8Kepc3Zk vbUkb1LXOwKOl5b/XFurBa01TcaG6jL2WbgLC+4RoOxPr5vLDt5WmXNXLhHBlhKo34 nxD79s/4ti0n0TUmcXHVM65NalH/th1kNrhJQ72rKHmspyubJMd2QcVkswWYeUPX1Z 0VkTBffAcMmdf2ejUWdpIbLvSAmRU9G8ouPjCVMpgIxJOUnQKfYiLwA3GcX85aHR4n JRgRb9xPzIfESdAB8reSwsZEh663D9FmDbMqZSsKw8VaUUBhti46UJZMW5ZuBdEcw7 kZY+4TabUP8vw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WX1FN1Vmyz9rxK; Sun, 28 Jul 2024 14:36:24 +0200 (CEST) In-Reply-To: <8634nt1z2k.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 28 Jul 2024 15:27:31 +0300") 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:289469 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: Thierry Volpiatto , 72141@debbugs.gnu.org >> Date: Sun, 28 Jul 2024 11:47:44 +0000 >>=20 >> Eli Zaretskii writes: >>=20 >> >> From: Thierry Volpiatto >> >> Date: Tue, 16 Jul 2024 14:46:37 +0000 >> >>=20 >> >>=20 >> >> I think there is a bug here, but please verify with following recipe = as >> >> I don't use widely package installation, at least for myself. When r= eading >> >> the code I believe it is reproductible as well on emacs-30+. >> >>=20 >> >> 1) Install package foo and bar. >> >> 2) Disable them in package-load-list ((foo nil) (bar nil) all). >> >> 3) Wait some time until foo and/or bar have new versions available. >> >> 4) Call package-upgrade-all. It will call package-upgrade on foo >> >> and bar (and possibly others). When package-upgrade find foo >> >> package it will (1) delete it and (2) call package-install which >> >> will refuse to install (error) because foo is disabled. >> >>=20 >> >> As a result we have lost foo package, it is now uninstalled. >> >> Same problem with M-x package-upgrade, foo and bar are listed in >> >> completion and made available whereas they are going to fail to >> >> upgrade. >> > >> > Philip, any comments or suggestions? >>=20 >> The issue is that we don't install a package if it is disabled. So >> either we allow installing (but don't activate) disabled packages, or we >> ignore disabled packages during upgrades. > > The latter, I'd say. It makes little sense to upgrade disabled > packages. When I posted initially this bugreport I wrote this (fully not tested): (defun package--upgradeable-packages (&optional include-builtins filter= -load-list) ;; Initialize the package system to get the list of package ;; symbols for completion. (package--archives-initialize) (let ((pkgs (if include-builtins (append package-alist (mapcan (lambda (elt) (when (not (assq (car elt) package-alist)) (list (list (car elt) (package--from-bui= ltin elt))))) package--builtins)) package-alist)))=20 (cl-loop for (sym desc) in pkgs for available =3D (assq sym package-archive-contents) when (or (and available (or (and include-builtins (not (package-desc-version desc))) (version-list-< (package-desc-version desc) (package-desc-version (cadr available))) (and filter-load-list (pcase (assq p package-load-list) (`(,sym ,val) (or (not (eq val ni= l)) (not (stringp v= al)))))))) (package-vc-p desc)) collect sym))) Perhaps package-disabled-p can be used instead of the pcase (I didn't know its existence). =2D-=20 Thierry --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCgAxFiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmamPBcTHHRoaWV2b2xA cG9zdGVvLm5ldAAKCRAOxW0UHRbvk2hsDAC+We85ZbKp70UjCFMDVhqbj5NK+jNC /F7mEr8fTNog3lJuwfbY/kSLnhdfUa7tDr4pQJ9QExJ/1UJCuDBKqVSaMjC7sBZJ PSD6xNvYsL+D182Lzp8w+Rar9L9gW1lPuwa1yZKugMxxVKKMnHg3KzlypF//OyHt b+Gn9hgeM4ylTDBckPAj18QaSMJ2lwfq6yz3jkUIlUGQ5fkakO6gvX5hCF5hu9Z6 Vz4u/uHBdEnnEts1j6Oe5YhZvwWskdzG/BdmccPQIzw4PlKvSw8KmJ45LIpB1lKX jkbilGNhfdkNuyXqBRAL6FhP1IVPHZ0Z9pOn4vvtETgGYSpOO+BaCJ3lK7unJRWf 2eIWVWRb4lv1F288doDLC6oczFbX15Ckkn08LoO7XE4tLjGNNI+LKZqIuG9g+sfw qH51uhHwzxusfe1JH/vqyjLIeO89PkPA1Q4pyOjqcz+vDhhWN8Irs0xucJiPVU6+ //oXz7ose3gScwIMFWwpA+s4sMc4NbT2wms= =xAbF -----END PGP SIGNATURE----- --=-=-=--