feat(show): merge the installed record with the upstream candidate

N?? and `show PKG` now print the installed record in the package
manager's own key/value layout, after one line explaining the format:

    # lines starting with > come from the upstream candidate: a differing
    value, or a field the installed record lacks

After each field whose candidate value differs comes the candidate's
line prefixed with "> "; fields only the candidate has are appended the
same way; installed-only fields stay; identical fields print once.
Multi-line values (pacman Optional Deps, dnf Description, RFC-822
continuation lines) are compared as blocks and a differing candidate
block gets "> " on every line. A package that is not installed shows the
candidate alone ("# not installed: this is the upstream candidate").

Merged where the backend gives comparable records for both sides:
- pacman: -Qi vs -Si REPO/PKG, REPO = the first repository -Sl lists
- apt: dpkg-query -s (Status, Conffiles, the long description; richer
  than apt-cache show PKG=<installed>, which gives the archive record
  when that version is still listed) vs apt-cache show --no-all-versions;
  Description-xx pairs with Description and a one-line candidate
  Description equal to the installed first line counts as identical
  (the archives ship the long text in Translation files)
- dnf: info --installed vs info --upgrades (--available lists other
  architectures first and nothing for an up-to-date package); not
  installed: --available; dnf5's differently padded keys are re-padded
zypper keeps `zypper info --requires`: rpm -qi and zypper info share
almost no keys and zypper cannot print the installed record itself.
No candidate, or not exactly one record per side, keeps the old output.

Formats verified in containers and recorded in discovery/*.md. Unit
tests replay recorded pacman, apt, dnf4 and dnf5 records; the E2E suite
checks 2?? on su-dummy-b on all 12 distros.
This commit is contained in:
bryanpedini committed 2026-10-10 14:24:39 +02:00
1 parent 296c77e319
commit 875c8294bf
30 files changed
+857 -45

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
Package: perl-base
Source: perl
Version: 5.36.0-7+deb12u4
Installed-Size: 7643
Maintainer: Niko Tyni <ntyni@debian.org>
Architecture: amd64
Replaces: libfile-path-perl (<< 2.18), libfile-temp-perl (<< 0.2311), libio-socket-ip-perl (<< 0.41), libscalar-list-utils-perl (<< 1:1.62), libsocket-perl (<< 2.033), libxsloader-perl (<< 0.31), perl (<< 5.10.1-12), perl-modules (<< 5.20.1-3)
Provides: libfile-path-perl (= 2.18), libfile-temp-perl (= 0.2311), libio-socket-ip-perl (= 0.41), libscalar-list-utils-perl (= 1:1.62), libsocket-perl (= 2.033), libxsloader-perl (= 0.31), perlapi-5.36.0
Suggests: perl, sensible-utils
Conflicts: defoma (<< 0.11.12), doc-base (<< 0.10.3), mono-gac (<< 2.10.8.1-3), safe-rm (<< 0.8), update-inetd (<< 4.41)
Breaks: amanda-common (<< 1:3.3.9-2), backuppc (<< 4.4.0-7~), bucardo (<< 5.5.0-1.1), debconf (<< 1.5.61), dh-haskell (<< 0.3), duck (<< 0.14.1), intltool (<< 0.51.0-4), kio-perldoc (<< 20.04.1-1), latexml (<< 0.8.4-2), libdevel-mat-dumper-perl (<< 0.42-3), libencode-arabic-perl (<< 14.2-2), libexception-class-perl (<< 1.42), libfile-path-perl (<< 2.18), libfile-spec-perl (<< 3.8400), libfile-temp-perl (<< 0.2311), libio-socket-ip-perl (<< 0.41), libmp3-tag-perl (<< 1.13-1.2), libsbuild-perl (<< 0.67.0-1), libscalar-list-utils-perl (<< 1:1.62), libsocket-perl (<< 2.033), libxsloader-perl (<< 0.31), mailagent (<< 1:3.1-81-2), perl (<< 5.36.0~), perl-modules (<< 5.36.0~), pod2pdf (<< 0.42-5.1), slic3r (<< 1.2.9+dfsg-6.1), slic3r-prusa (<< 1.37.0+dfsg-1.1), texinfo (<< 6.1.0.dfsg.1-8)
Description: minimal Perl system
Description-md5: 6f98ca50727514fe6b19872d5ede03ec
Homepage: http://dev.perl.org/perl5/
Essential: yes
Pre-Depends: libc6 (>= 2.35), libcrypt1 (>= 1:4.1.0), dpkg (>= 1.17.17)
Section: perl
Priority: required
Filename: pool/updates/main/p/perl/perl-base_5.36.0-7+deb12u4_amd64.deb
Size: 1609596
SHA256: d7d1943aec9597629bf73075efcc5ef6dc9bda96d78e80d843156ecd448478b8
+21
View File
@@ -0,0 +1,21 @@
Package: zsh
Source: zsh (5.9-4)
Version: 5.9-4+b15
Installed-Size: 2461
Maintainer: Debian Zsh Maintainers <pkg-zsh-devel@lists.alioth.debian.org>
Architecture: amd64
Depends: zsh-common (= 5.9-4), libc6 (>= 2.34), libcap2 (>= 1:2.10), libtinfo6 (>= 6), debianutils (>= 5.3-1~)
Recommends: libc6 (>= 2.35), libgdbm6 (>= 1.16), libncursesw6 (>= 6), libpcre3
Suggests: zsh-doc
Description: shell with lots of features
Description-md5: a129d6b2d23d2d5d3a6b822d3f8f856d
Homepage: https://www.zsh.org/
Tag: devel::interpreter, implemented-in::c, interface::shell,
network::client, protocol::ftp, role::program, scope::utility
Section: shells
Priority: optional
Filename: pool/main/z/zsh/zsh_5.9-4+b15_amd64.deb
Size: 907512
MD5sum: 831903f59bf1ed613a5beeef9fc787ad
SHA256: 8362cc8bbb530d393950522dc8a9df5a860a61227d62ff669a7524056e6289a8
+24
View File
@@ -0,0 +1,24 @@
Package: perl-base
Essential: yes
Status: install ok installed
Priority: required
Section: perl
Installed-Size: 7639
Maintainer: Niko Tyni <ntyni@debian.org>
Architecture: amd64
Source: perl
Version: 5.36.0-7+deb12u3
Replaces: libfile-path-perl (<< 2.18), libfile-temp-perl (<< 0.2311), libio-socket-ip-perl (<< 0.41), libscalar-list-utils-perl (<< 1:1.62), libsocket-perl (<< 2.033), libxsloader-perl (<< 0.31), perl (<< 5.10.1-12), perl-modules (<< 5.20.1-3)
Provides: libfile-path-perl (= 2.18), libfile-temp-perl (= 0.2311), libio-socket-ip-perl (= 0.41), libscalar-list-utils-perl (= 1:1.62), libsocket-perl (= 2.033), libxsloader-perl (= 0.31), perlapi-5.36.0
Pre-Depends: libc6 (>= 2.35), libcrypt1 (>= 1:4.1.0), dpkg (>= 1.17.17)
Suggests: perl, sensible-utils
Breaks: amanda-common (<< 1:3.3.9-2), backuppc (<< 4.4.0-7~), bucardo (<< 5.5.0-1.1), debconf (<< 1.5.61), dh-haskell (<< 0.3), duck (<< 0.14.1), intltool (<< 0.51.0-4), kio-perldoc (<< 20.04.1-1), latexml (<< 0.8.4-2), libdevel-mat-dumper-perl (<< 0.42-3), libencode-arabic-perl (<< 14.2-2), libexception-class-perl (<< 1.42), libfile-path-perl (<< 2.18), libfile-spec-perl (<< 3.8400), libfile-temp-perl (<< 0.2311), libio-socket-ip-perl (<< 0.41), libmp3-tag-perl (<< 1.13-1.2), libsbuild-perl (<< 0.67.0-1), libscalar-list-utils-perl (<< 1:1.62), libsocket-perl (<< 2.033), libxsloader-perl (<< 0.31), mailagent (<< 1:3.1-81-2), perl (<< 5.36.0~), perl-modules (<< 5.36.0~), pod2pdf (<< 0.42-5.1), slic3r (<< 1.2.9+dfsg-6.1), slic3r-prusa (<< 1.37.0+dfsg-1.1), texinfo (<< 6.1.0.dfsg.1-8)
Conflicts: defoma (<< 0.11.12), doc-base (<< 0.10.3), mono-gac (<< 2.10.8.1-3), safe-rm (<< 0.8), update-inetd (<< 4.41)
Description: minimal Perl system
Perl is a scripting language used in many system scripts and utilities.
.
This package provides a Perl interpreter and the small subset of the
standard run-time library required to perform basic tasks. For a full
Perl installation, install "perl" (and its dependencies, "perl-modules-5.36"
and "perl-doc").
Homepage: http://dev.perl.org/perl5/
+14
View File
@@ -0,0 +1,14 @@
Package: su-dummy-a
Status: install ok installed
Priority: optional
Section: misc
Maintainer: Skeptical Updater Fixture <su-fixture@example.invalid>
Architecture: all
Version: 1.0
Depends: su-dummy-b
Conffiles:
/etc/su-dummy/su-dummy-a.conf 607e2d3a119dfe832d937ce579ef1079
Description: dummy package su-dummy-a for skeptical-updater tests
This package only exists to exercise the package manager.
.
It ships one data file and one conffile (version 1.0).
+13
View File
@@ -0,0 +1,13 @@
Package: su-dummy-b
Status: install ok installed
Priority: optional
Section: misc
Maintainer: Skeptical Updater Fixture <su-fixture@example.invalid>
Architecture: all
Version: 1.0
Conffiles:
/etc/su-dummy/su-dummy-b.conf 607e2d3a119dfe832d937ce579ef1079
Description: dummy package su-dummy-b for skeptical-updater tests
This package only exists to exercise the package manager.
.
It ships one data file and one conffile (version 1.0).
+13
View File
@@ -0,0 +1,13 @@
Package: su-dummy-c
Status: install ok installed
Priority: optional
Section: misc
Maintainer: Skeptical Updater Fixture <su-fixture@example.invalid>
Architecture: all
Version: 1.0
Conffiles:
/etc/su-dummy/su-dummy-c.conf 607e2d3a119dfe832d937ce579ef1079
Description: dummy package su-dummy-c for skeptical-updater tests
This package only exists to exercise the package manager.
.
It ships one data file and one conffile (version 1.0).
@@ -0,0 +1,17 @@
Available Packages
Name : zsh
Version : 5.8
Release : 9.el9
Architecture : x86_64
Size : 2.9 M
Source : zsh-5.8-9.el9.src.rpm
Repository : baseos
Summary : Powerful interactive shell
URL : http://zsh.sourceforge.net/
License : MIT
Description : The zsh shell is a command interpreter usable as an interactive login
: shell and as a shell script command processor. Zsh resembles the ksh
: shell (the Korn shell), but includes many enhancements. Zsh supports
: command line editing, built-in spelling correction, programmable
: command completion, shell functions (with autoloading), a history
: mechanism, and more.
@@ -0,0 +1,19 @@
Installed Packages
Name : glibc
Version : 2.34
Release : 275.el9_8
Architecture : x86_64
Size : 6.2 M
Source : glibc-2.34-275.el9_8.src.rpm
Repository : @System
From repo : baseos
Summary : The GNU libc libraries
URL : http://www.gnu.org/software/glibc/
License : LGPL-2.1-or-later AND SunPro AND LGPL-2.1-or-later WITH GCC-exception-2.0 AND BSD-3-Clause AND GPL-2.0-or-later AND LGPL-2.1-or-later WITH GNU-compiler-exception AND GPL-2.0-only AND ISC AND LicenseRef-Fedora-Public-Domain AND HPND AND CMU-Mach AND LGPL-2.0-or-later AND Unicode-3.0 AND GFDL-1.1-or-later AND GPL-1.0-or-later AND FSFUL AND MIT AND Inner-Net-2.0 AND X11 AND GPL-2.0-or-later WITH GCC-exception-2.0 AND GFDL-1.3-only AND GFDL-1.1-only AND GPL-3.0-or-later AND GPL-3.0-or-later WITH Autoconf-exception-generic-3.0 AND GPL-3.0-or-later WITH Texinfo-exception
Description : The glibc package contains standard libraries which are used by
: multiple programs on the system. In order to save disk space and
: memory, as well as to make upgrading easier, common system code is
: kept in one place and shared between programs. This particular package
: contains the most important sets of shared libraries: the standard C
: library and the standard math library. Without these two libraries, a
: Linux system will not function.
@@ -0,0 +1,13 @@
Installed Packages
Name : su-dummy-a
Version : 1.0
Release : 1
Architecture : noarch
Size : 15
Source : su-dummy-a-1.0-1.src.rpm
Repository : @System
Summary : skeptical-updater dummy su-dummy-a (v1.0)
License : MIT
Description : Dummy package su-dummy-a version 1.0 for skeptical-updater tests.
:
: Second paragraph of su-dummy-a 1.0 (blank line above on purpose).
@@ -0,0 +1,13 @@
Installed Packages
Name : su-dummy-b
Version : 1.0
Release : 1
Architecture : noarch
Size : 15
Source : su-dummy-b-1.0-1.src.rpm
Repository : @System
Summary : skeptical-updater dummy su-dummy-b (v1.0)
License : MIT
Description : Dummy package su-dummy-b version 1.0 for skeptical-updater tests.
:
: Second paragraph of su-dummy-b 1.0 (blank line above on purpose).
@@ -0,0 +1,16 @@
Installed packages
Name : su-dummy-b
Epoch : 0
Version : 1.0
Release : 1
Architecture : noarch
Installed size : 15.0 B
Source : su-dummy-b-1.0-1.src.rpm
From repository : <unknown>
Summary : skeptical-updater dummy su-dummy-b (v1.0)
URL :
License : MIT
Description : Dummy package su-dummy-b version 1.0 for skeptical-updater tests.
:
: Second paragraph of su-dummy-b 1.0 (blank line above on purpose).
Vendor : <NULL>
@@ -0,0 +1,18 @@
Available Upgrades
Name : glibc
Version : 2.34
Release : 283.el9_8
Architecture : x86_64
Size : 2.0 M
Source : glibc-2.34-283.el9_8.src.rpm
Repository : baseos
Summary : The GNU libc libraries
URL : http://www.gnu.org/software/glibc/
License : LGPL-2.1-or-later AND SunPro AND LGPL-2.1-or-later WITH GCC-exception-2.0 AND BSD-3-Clause AND GPL-2.0-or-later AND LGPL-2.1-or-later WITH GNU-compiler-exception AND GPL-2.0-only AND ISC AND LicenseRef-Fedora-Public-Domain AND HPND AND CMU-Mach AND LGPL-2.0-or-later AND Unicode-3.0 AND GFDL-1.1-or-later AND GPL-1.0-or-later AND FSFUL AND MIT AND Inner-Net-2.0 AND X11 AND GPL-2.0-or-later WITH GCC-exception-2.0 AND GFDL-1.3-only AND GFDL-1.1-only AND GPL-3.0-or-later AND GPL-3.0-or-later WITH Autoconf-exception-generic-3.0 AND GPL-3.0-or-later WITH Texinfo-exception
Description : The glibc package contains standard libraries which are used by
: multiple programs on the system. In order to save disk space and
: memory, as well as to make upgrading easier, common system code is
: kept in one place and shared between programs. This particular package
: contains the most important sets of shared libraries: the standard C
: library and the standard math library. Without these two libraries, a
: Linux system will not function.
@@ -0,0 +1,13 @@
Available Upgrades
Name : su-dummy-a
Version : 2.0
Release : 1
Architecture : noarch
Size : 6.3 k
Source : su-dummy-a-2.0-1.src.rpm
Repository : su-dummy
Summary : skeptical-updater dummy su-dummy-a (v2.0)
License : MIT
Description : Dummy package su-dummy-a version 2.0 for skeptical-updater tests.
:
: Second paragraph of su-dummy-a 2.0 (blank line above on purpose).
@@ -0,0 +1,13 @@
Available Upgrades
Name : su-dummy-b
Version : 2.0
Release : 1
Architecture : noarch
Size : 6.5 k
Source : su-dummy-b-2.0-1.src.rpm
Repository : su-dummy
Summary : skeptical-updater dummy su-dummy-b (v2.0)
License : MIT
Description : Dummy package su-dummy-b version 2.0 for skeptical-updater tests.
:
: Second paragraph of su-dummy-b 2.0 (blank line above on purpose).
@@ -0,0 +1,17 @@
Available upgrades
Name : su-dummy-b
Epoch : 0
Version : 2.0
Release : 1
Architecture : noarch
Download size : 6.6 KiB
Installed size : 15.0 B
Source : su-dummy-b-2.0-1.src.rpm
Repository : su-dummy
Summary : skeptical-updater dummy su-dummy-b (v2.0)
URL :
License : MIT
Description : Dummy package su-dummy-b version 2.0 for skeptical-updater tests.
:
: Second paragraph of su-dummy-b 2.0 (blank line above on purpose).
Vendor :
+24
View File
@@ -264,3 +264,27 @@ Install Reason : Explicitly installed
Install Script : No
Validated By : None
Name : glib2
Version : 2.88.3-1
Description : Low level core library
Architecture : x86_64
URL : https://gitlab.gnome.org/GNOME/glib
Licenses : LGPL-2.1-or-later
Groups : None
Provides : libglib-2.0.so=0-64 libgio-2.0.so=0-64 libgirepository-2.0.so=0-64 libgmodule-2.0.so=0-64 libgobject-2.0.so=0-64 libgthread-2.0.so=0-64
Depends On : bash glibc libffi libsysprof-capture pcre2 util-linux-libs zlib libffi.so=8-64 libmount.so=1-64
Optional Deps : dconf: GSettings storage backend
glib2-devel: development tools
gvfs: most gio functionality
Required By : libsecret pinentry
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 37.89 MiB
Packager : Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Build Date : Wed Jul 29 14:57:16 2026
Install Date : Sun Oct 4 00:00:00 2026
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
+22
View File
@@ -93,3 +93,25 @@ Packager : su-fixture <su-fixture@example.invalid>
Build Date : Tue Nov 14 22:13:20 2023
Validated By : None
Repository : core
Name : glib2
Version : 2.90.1-1
Description : Low level core library
Architecture : x86_64
URL : https://gitlab.gnome.org/GNOME/glib
Licenses : LGPL-2.1-or-later
Groups : None
Provides : libglib-2.0.so=0-64 libgio-2.0.so=0-64 libgirepository-2.0.so=0-64 libgmodule-2.0.so=0-64 libgobject-2.0.so=0-64 libgthread-2.0.so=0-64
Depends On : bash glibc libffi libsysprof-capture pcre2 util-linux-libs zlib libffi.so=8-64 libmount.so=1-64
Optional Deps : dconf: GSettings storage backend
glib2-devel: development tools
gvfs: most gio functionality
python: gdbus-codegen
Conflicts With : None
Replaces : None
Download Size : 5.12 MiB
Installed Size : 38.39 MiB
Packager : Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Build Date : Tue Oct 6 16:19:12 2026
Validated By : SHA-256 Sum Signature
+1
View File
@@ -6,4 +6,5 @@ extra pacman-contrib 1.13.1-1
su-dummy su-dummy-a 2.0-1 [installed: 1.0-1]
su-dummy su-dummy-b 2.0-1 [installed: 1.0-1]
su-dummy su-dummy-c 2.0-1 [installed: 1.0-1]
su-dummy su-dummy-new 1.0-1
su-dummy2 su-dummy-b 3.0-1