[Aptitude-devel] Bug#1003186: aptitude: is too verbose after updating with -v option

Michael Hannema michael_hannema at hotmail.com
Wed Jan 5 18:32:17 GMT 2022

Package: aptitude
Version: 0.8.13-3
Severity: normal
Tags: patch

Dear Maintainer,

While browsing the source I came upon some functionality that is
apparently unused. When running `aptitude -v update`, it seems
aptitude is meant to only print the number of new/upgradable/broken
packages if they are not zero, and always print them if the -v option is
used multiple times. I deduced this from the logic of the
show_stats_change function in cmdline_util.cc. However, two arguments in
the call to this function are mixed up, causing -v to have the same
behaviour as -vv in this case.

For example, I'm getting this output when updating with -v:

    Current status: 0 (+0) broken, 0 (+0) upgradable, 88466 (+0) new.

While I'm expecting it to be like this:

    Current status: 88466 (+0) new.

The former line is what I would expect when -v is used multiple times.

I have included a patch that switches the arguments. This function is
not called anywhere else in this project.


-- Package-specific info:
Terminal: xterm-256color
$DISPLAY is set.
which aptitude: /usr/bin/aptitude

aptitude version information:
aptitude 0.8.13
Compiler: g++ 10.2.1 20210110
Compiled against:
  apt version 6.0.0
  NCurses version 6.2
  libsigc++ version: 2.10.4
  Gtk+ support disabled.
  Qt support disabled.

Current library versions:
  NCurses version: ncurses 6.2.20201114
  cwidget version: 0.5.18
  Apt version: 6.0.0

aptitude linkage:
	linux-vdso.so.1 (0x00007ffe2f394000)
	libapt-pkg.so.6.0 => /usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0 (0x00007ffb01eba000)
	libncursesw.so.6 => /lib/x86_64-linux-gnu/libncursesw.so.6 (0x00007ffb01e7f000)
	libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007ffb01e50000)
	libsigc-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libsigc-2.0.so.0 (0x00007ffb01e47000)
	libcwidget.so.4 => /usr/lib/x86_64-linux-gnu/libcwidget.so.4 (0x00007ffb01d41000)
	libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007ffb01bfe000)
	libboost_iostreams.so.1.74.0 => /usr/lib/x86_64-linux-gnu/libboost_iostreams.so.1.74.0 (0x00007ffb01be3000)
	libxapian.so.30 => /usr/lib/x86_64-linux-gnu/libxapian.so.30 (0x00007ffb019c1000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ffb0199f000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ffb017d2000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ffb0168e000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ffb01674000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffb014ad000)
	libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007ffb01493000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ffb01476000)
	libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007ffb01463000)
	liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007ffb0143b000)
	liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007ffb01418000)
	libzstd.so.1 => /usr/lib/x86_64-linux-gnu/libzstd.so.1 (0x00007ffb0133b000)
	libudev.so.1 => /usr/lib/x86_64-linux-gnu/libudev.so.1 (0x00007ffb01313000)
	libsystemd.so.0 => /usr/lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007ffb0125e000)
	libgcrypt.so.20 => /usr/lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007ffb0113e000)
	libxxhash.so.0 => /usr/lib/x86_64-linux-gnu/libxxhash.so.0 (0x00007ffb01125000)
	/lib64/ld-linux-x86-64.so.2 (0x00007ffb024f4000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ffb0111f000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ffb01112000)
	libuuid.so.1 => /usr/lib/x86_64-linux-gnu/libuuid.so.1 (0x00007ffb01109000)
	libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007ffb010e3000)

-- System Information:
Debian Release: 11.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-10-amd64 (SMP w/2 CPU threads)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages aptitude depends on:
ii  aptitude-common           0.8.13-3
ii  libapt-pkg6.0             2.2.4
ii  libboost-iostreams1.74.0  1.74.0-9
ii  libc6                     2.31-13+deb11u2
ii  libcwidget4               0.5.18-5
ii  libgcc-s1                 10.2.1-6
ii  libncursesw6              6.2+20201114-2
ii  libsigc++-2.0-0v5         2.10.4-2
ii  libsqlite3-0              3.34.1-3
ii  libstdc++6                10.2.1-6
ii  libtinfo6                 6.2+20201114-2
ii  libxapian30               1.4.18-3

Versions of packages aptitude recommends:
ii  libdpkg-perl    1.20.9
ii  sensible-utils  0.0.14

Versions of packages aptitude suggests:
pn  apt-xapian-index                <none>
ii  aptitude-doc-en [aptitude-doc]  0.8.13-3
pn  debtags                         <none>
ii  tasksel                         3.68

-- no debconf information
-------------- next part --------------
diff --git a/src/cmdline/cmdline_util.cc b/src/cmdline/cmdline_util.cc
index e50942fe..37d5ab8d 100644
--- a/src/cmdline/cmdline_util.cc
+++ b/src/cmdline/cmdline_util.cc
@@ -514,7 +514,7 @@ download_manager::result cmdline_do_download(download_manager *m,
       // cache just (re)loaded in last steps of download_manager
       final_stats = compute_apt_stats();
       show_stats_change(initial_stats, final_stats,
-			verbose >= 1, verbose >= 2,
+			verbose >= 2, verbose >= 1,

More information about the Aptitude-devel mailing list