Subject: bug#63064: 29.0.90; installed packages have status available and obsolete

From: Stephen Berman <[email-masked]>
Date: Tue, 25 Apr 2023 10:02:08 +0200

I updated installed packages by typing `M-x list-packages', then in the
*Packages* buffer typing `/u', then typing `i' on the lines of the
packages I wanted to update, and then typing `x'.  After the
installation completed and the *Packages* buffer was refreshed, I again
typed `/u' and now *Packages* displayed the following (I omitted the
"Descriptions" column):

  Packages[upgradable]           Version        Status       Archive
  nov                            20230421.1548  new          melpa
  auctex                         13.2.0         available    gnu
  comint-mime                    0.3            available    gnu
  company                        20230416.2034  available    melpa
  dash                           20230415.2324  available    melpa
  markdown-mode                  20230412.126   available    melpa
  osm                            20230417.1827  available    melpa
  posframe                       20230423.927   available    melpa
  posframe                       1.4.2          available    gnu
  sly                            20230411.1523  available    melpa
  tablist                        20230321.705   available    melpa
  websocket                      20230305.410   available    melpa
  auctex                         13.1.10        installed
  comint-mime                    0.2            installed
  company                        0.9.13         installed
  dash                           2.19.1         installed
  markdown-mode                  20230331.913   installed
  nov                            20230327.1739  installed
  osm                            20230405.1939  installed
  posframe                       1.4.1          installed
  sly                            20230327.1434  installed
  tablist                        1.0            installed
  websocket                      1.14           installed
  auctex                         13.2.0         obsolete
  comint-mime                    0.3            obsolete
  markdown-mode                  20230412.126   obsolete
  nov                            20230411.1833  obsolete
  nov                            20230421.1548  obsolete
  osm                            20230417.1827  obsolete
  posframe                       1.4.2          obsolete
  sly                            20230411.1523  obsolete

Notice that the highest version of the packages with status "available"
(plus the one with status "new") also have status "obsolete" but not
"status" installed.  But in fact, those versions were just installed and
are present in my ~/.emacs.d/elpa directory, and the versions of these
packages with status "installed" are also still present in
~/.emacs.d/elpa, i.e. they were unexpectedly not removed after the newer
versions were (physically) installed.

I can reproduce the above display (also in master) when ~/.emacs.d/elpa
contains the packages listed above with status "installed" or "obsolete"
and ~/.emacs contains only the following lines:

(package-initialize)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-archives
   '(("gnu" . "http://elpa.gnu.org/packages/")
     ("nongnu" . "https://elpa.nongnu.org/nongnu/")
     ("melpa" . "https://melpa.org/packages/")))
 '(package-selected-packages
   '(dash posframe websocket company tablist osm sly comint-mime markdown-mode auctex nov)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

Then typing `M-x list-packages' followed by `/u' produces the above
display in the *Packages* buffer.

In GNU Emacs 29.0.90 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.37, cairo version 1.17.6) of 2023-04-21 built on strobelfssd
Repository revision: 9ac12592781934bcd934bc0cae71a637311119ec
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
System Description: Linux From Scratch r11.3-65-systemd

Configured using:
 'configure -C --with-xwidgets 'CFLAGS=-Og -g3'
 PKG_CONFIG_PATH=/opt/qt5/lib/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM
XINPUT2 XPM XWIDGETS GTK3 ZLIB