Subject: bug#69366: 30.0.50; package.el reports wrong number of packages that can be upgraded

From: Jim Porter <[email-masked]>
Date: Sat, 24 Feb 2024 21:47:07 -0800

To reproduce this issue, you first need to install a built-in package 
from ELPA (Org and Tramp are good examples), and then wait until a new 
version is available. When calling 'list-packages', Emacs will then 
report that there are (say) 2 packages ready to upgrade. If you press 
"U" to mark the upgrades and then "x" to execute, it only upgrades a 
single package.

This happens because a built-in package installed from ELPA is counted 
twice in 'package-menu--find-upgrades': first for the ELPA version, and 
second for the built-in version. This function uses the actual buffer 
contents to compute the result; maybe it would be easier to get right by 
looking at 'package-alist' and 'package--builtins' (though that seems to 
require a bit of finagling too).