GNU bug report logs -
#63587
29.0.91; package-menu-mark-upgrades does not show available upgrades
Previous Next
Reported by: Andreas Kurth <emacs <at> akurth.de>
Date: Fri, 19 May 2023 15:22:01 UTC
Severity: normal
Found in version 29.0.91
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #17 received at 63587 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Date: Fri, 19 May 2023 08:30:46 +0200
>> From: Andreas Kurth <emacs <at> akurth.de>
>>
>> after setting package-install-upgrade-built-in to a non-nil value, the
>> command "M-x package-menu-mark-upgrades" won’t show upgradeable non
>> built-in packages (magit, embark, ...) any more. Same for pressing "U"
>> in the package menu. Also, the command "M-x list-packages" won’t
>> announce upgradeable packages in the echo area.
>>
>> Setting package-install-upgrade-built-in to nil will revert that
>> faulty behaviour.
>>
>> I bisected the error to commit
>> ba2c76fa2bc3aabfda7d1d09cc5148f3f9d8e08e in emacs-29 branch.
>
> Philip, could you please look into this issue?
I've taken a look at the issue, and think this small change should fix
the issue:
[Message part 2 (text/plain, inline)]
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 325c7b4e0a6..01826da273d 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -3751,8 +3751,8 @@ package-menu--find-upgrades
(and avail-pkg
(version-list-< (package-desc-priority-version pkg-desc)
(package-desc-priority-version avail-pkg))
- (xor (not package-install-upgrade-built-in)
- (package--active-built-in-p pkg-desc))
+ (or (not (package--active-built-in-p pkg-desc))
+ package-install-upgrade-built-in)
(push (cons name avail-pkg) upgrades))))
upgrades))
[Message part 3 (text/plain, inline)]
And before I just propose a different change, I'd like to try and prove
that it fixes the above issue. For a package with an update, let
p := is a built-in package
q := built-in packages should be upgradede
The previous implementation with xor (p ⊻ q) correctly decides to
upgrade or not-upgrade the package in three of the four possible cases
p q upgrade?
--------------
t f f
t t t
f t f <-- this was Andreas case
f f t
But since non-built-in packages should always be upgraded, we need to
change the condition to only be false when we have a built-in package
but `package-install-upgrade-built-in' is non-nil:
¬ (¬ q ∧ p)
= ¬¬ q ∨ ¬p
= q ∨ ¬p
as we see, this should solve the issue:
p q upgrade? (p ∨ ¬q)
--------------
t f f
t t t
f t t
f f t
Does this look OK?
This bug report was last modified 1 year and 254 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.