rpm-software-management / dnf5

Next-generation RPM package management system
Other
223 stars 76 forks source link

Upgrade summary output too wide (> 80 cols) #785

Open rwmjones opened 12 months ago

rwmjones commented 12 months ago
# dnf install wine --enablerepo=rawhide
Updating and loading repositories:
Repositories loaded.
Package                                      Arch   Version                 Repository      Size
Downgrading:                                                                                    
 openssl                                     x86_64 1:3.0.8-4.fc39          rawhide      1.6 MiB
  replacing openssl                          x86_64 1:3.0.9-1.fc38          updates      1.6 MiB
 openssl-devel                               x86_64 1:3.0.8-4.fc39          rawhide      4.1 MiB
  replacing openssl-devel                    x86_64 1:3.0.9-1.fc38          updates      4.1 MiB
 openssl-libs                                x86_64 1:3.0.8-4.fc39          rawhide      6.4 MiB
   replacing openssl-libs                    x86_64 1:3.0.9-1.fc38          updates      6.4 MiB
Upgrading:                                                                                      
 SDL2                                        x86_64 2.26.5-2.fc39           rawhide      1.8 MiB
  replacing SDL2                             x86_64 2.26.5-1.fc39           <unknown>    1.8 MiB
 SDL2-devel                                  x86_64 2.26.5-2.fc39           rawhide      2.7 MiB
  replacing SDL2-devel                       x86_64 2.26.5-1.fc39           <unknown>    2.8 MiB
 alsa-lib                                    x86_64 1.2.9-4.fc39            rawhide      1.4 MiB
  replacing alsa-lib                         x86_64 1.2.9-3.fc39            <unknown>    1.4 MiB
[etc]

This is wider than 80 columns.

rwmjones commented 12 months ago

(Apparently you cannot put a screenshot here)

It looks like this: http://oirase.annexia.org/tmp/Screenshot_2023-08-01_11-34-49.png

kontura commented 11 months ago

If there is an interactive terminal dnf5 is trying to use the full width it has available so yes it can be wider than 80. I believe this is consistent with old dnf as well.

But it shouldn't be stretching the outputs over multiple lines like in your screenshot (unless you first print the transaction table and then resize the window). In my testing if there is not enough space it cuts off the too long elements rather than spilling over the lines.

rwmjones commented 11 months ago

I didn't resize the terminal. Everything would fit into 80 columns fine if there wasn't so much whitespace.

kontura commented 11 months ago

Interesting, do you have a reproducer for this? Does it happen on every dnf5 command?

rwmjones commented 11 months ago

It happens with any install command that needs to install a significant number of packages. For example just now I did:

# dnf install libreoffice --enablerepo=rawhide
Updating and loading repositories:
Repositories loaded.
Package                             Arch   Version                 Repository      Size
Upgrading:                                                                             
 gpgme                              x86_64 1.20.0-5.fc39           rawhide    577.5 KiB
  replacing gpgme                   x86_64 1.20.0-4.fc39           fedora     577.8 KiB
 javapackages-filesystem            noarch 6.1.0-10.fc39           rawhide      1.9 KiB
  replacing javapackages-filesystem noarch 6.1.0-9.fc39            <unknown>    1.9 KiB
 python3-gpg                        x86_64 1.20.0-5.fc39           rawhide      1.5 MiB
   replacing python3-gpg            x86_64 1.20.0-4.fc39           fedora       1.5 MiB
Installing:                                                                            
 libreoffice                        x86_64 1:7.5.5.2-1.fc39        rawhide      0.0   B
Installing dependencies:                                                               
 Box2D                              x86_64 2.4.1-11.fc39           rawhide    242.3 KiB
 autocorr-en                        noarch 1:7.5.5.2-1.fc39        rawhide    286.1 KiB
 clucene-contribs-lib               x86_64 2.3.3.4-46.20130812.e8e rawhide    385.0 KiB
 clucene-core                       x86_64 2.3.3.4-46.20130812.e8e rawhide      2.0 MiB
 firebird                           x86_64 4.0.2.2816-5.fc39       rawhide     32.6 MiB
 firebird-utils                     x86_64 4.0.2.2816-5.fc39       rawhide     17.4 MiB
 flute                              noarch 1.3.0-34.OOo31.fc39     rawhide     63.6 KiB
 google-carlito-fonts               noarch 1.103-0.22.20130920.fc3 rawhide      2.6 MiB
 google-crosextra-caladea-fonts     noarch 1:1.002-0.16.20130214.f rawhide    251.1 KiB
 gpgmepp                            x86_64 1.20.0-5.fc39           rawhide    416.1 KiB
 hyphen-en                          noarch 2.8.8-21.fc39           rawhide    103.9 KiB
 javapackages-tools                 noarch 6.1.0-10.fc39           rawhide     68.1 KiB
 libabw                             x86_64 0.1.3-13.fc39           rawhide    269.4 KiB
 libbase                            noarch 1.1.3-39.fc39           rawhide    153.1 KiB
 libcdr                             x86_64 0.1.7-14.fc39           rawhide    849.5 KiB
 libcmis                            x86_64 0.5.2-22.fc39           rawhide      1.1 MiB
 libe-book                          x86_64 0.1.3-32.fc39           rawhide    486.1 KiB
 libeot                             x86_64 0.01-29.fc39            rawhide     77.0 KiB
 libepubgen                         x86_64 0.1.1-16.fc39           rawhide    387.9 KiB
 libetonyek                         x86_64 0.1.10-10.fc39          rawhide      2.5 MiB
 libexttextcat                      x86_64 3.4.6-7.fc39            rawhide    457.8 KiB
 libfbclient2                       x86_64 4.0.2.2816-5.fc39       rawhide      3.3 MiB
 libfonts                           noarch 1.1.3-43.fc39           rawhide    222.0 KiB
 libformula                         noarch 1.1.3-40.fc39           rawhide    441.0 KiB
 libfreehand                        x86_64 0.1.2-21.fc39           rawhide    441.5 KiB
 libib-util                         x86_64 4.0.2.2816-5.fc39       rawhide     15.1 KiB
 liblangtag                         x86_64 0.6.4-5.fc39            rawhide    217.3 KiB
 liblangtag-data                    noarch 0.6.4-5.fc39            rawhide      2.1 MiB
 liblayout                          noarch 0.2.10-33.fc39          rawhide    840.1 KiB
 libloader                          noarch 1.1.3-41.fc39           rawhide    164.0 KiB
 libmspub                           x86_64 0.1.4-29.fc39           rawhide    408.4 KiB
 libmwaw                            x86_64 0.3.21-7.fc39           rawhide      6.7 MiB
 libnumbertext                      x86_64 1.0.11-4.fc39           rawhide    756.7 KiB
 libodfgen                          x86_64 0.1.8-9.fc39            rawhide    753.1 KiB
 liborcus                           x86_64 0.17.2-11.fc39          rawhide      1.6 MiB
 libpagemaker                       x86_64 0.0.4-21.fc39           rawhide    162.7 KiB
 libqxp                             x86_64 0.0.2-23.fc39           rawhide    324.3 KiB
 libreoffice-base                   x86_64 1:7.5.5.2-1.fc39        rawhide      5.7 MiB
 libreoffice-calc                   x86_64 1:7.5.5.2-1.fc39        rawhide     26.4 MiB
 libreoffice-core                   x86_64 1:7.5.5.2-1.fc39        rawhide    301.9 MiB
 libreoffice-data                   x86_64 1:7.5.5.2-1.fc39        rawhide      3.2 MiB
 libreoffice-draw                   x86_64 1:7.5.5.2-1.fc39        rawhide     14.0 KiB
 libreoffice-emailmerge             x86_64 1:7.5.5.2-1.fc39        rawhide     25.0 KiB
 libreoffice-graphicfilter          x86_64 1:7.5.5.2-1.fc39        rawhide      1.0 MiB
 libreoffice-impress                x86_64 1:7.5.5.2-1.fc39        rawhide      1.7 MiB
 libreoffice-langpack-en            x86_64 1:7.5.5.2-1.fc39        rawhide    171.5 KiB
 libreoffice-math                   x86_64 1:7.5.5.2-1.fc39        rawhide     11.2 KiB
 libreoffice-ogltrans               x86_64 1:7.5.5.2-1.fc39        rawhide    324.9 KiB
 libreoffice-opensymbol-fonts       noarch 1:7.5.5.2-1.fc39        rawhide    437.5 KiB
 libreoffice-pdfimport              x86_64 1:7.5.5.2-1.fc39        rawhide    586.2 KiB
 libreoffice-pyuno                  x86_64 1:7.5.5.2-1.fc39        rawhide      1.7 MiB
 libreoffice-ure                    x86_64 1:7.5.5.2-1.fc39        rawhide      6.7 MiB
 libreoffice-ure-common             x86_64 1:7.5.5.2-1.fc39        rawhide      2.4 MiB
 libreoffice-writer                 x86_64 1:7.5.5.2-1.fc39        rawhide     12.2 MiB
 libreoffice-x11                    x86_64 1:7.5.5.2-1.fc39        rawhide    609.3 KiB
 librepository                      noarch 1.1.3-40.fc39           rawhide     86.8 KiB
 librevenge                         x86_64 0.0.5-5.fc39            rawhide    752.6 KiB
 libserializer                      noarch 1.1.2-39.fc39           rawhide     50.0 KiB
 libstaroffice                      x86_64 0.0.7-11.fc39           rawhide      2.3 MiB
 libvisio                           x86_64 0.1.7-20.fc39           rawhide    676.4 KiB
 libwpd                             x86_64 0.10.3-17.fc39          rawhide    725.8 KiB
 libwpg                             x86_64 0.3.3-16.fc39           rawhide    165.1 KiB
 libwps                             x86_64 0.4.13-3.fc39           rawhide      2.1 MiB
 libzmf                             x86_64 0.0.2-31.fc39           rawhide    184.9 KiB
 lpsolve                            x86_64 5.5.2.11-3.fc39         rawhide    716.4 KiB
 mythes                             x86_64 1.2.5-4.fc39            rawhide     27.3 KiB
 mythes-en                          noarch 3.0-37.fc39             rawhide     20.7 MiB
 ongres-scram                       noarch 2.1-10.fc39             rawhide     74.0 KiB
 ongres-scram-client                noarch 2.1-10.fc39             rawhide     20.0 KiB
 ongres-stringprep                  noarch 1.1-8.fc39              rawhide     52.1 KiB
 pentaho-libxml                     noarch 1.1.3-39.fc39           rawhide    125.2 KiB
 pentaho-reporting-flow-engine      noarch 1:0.9.4-32.fc39         rawhide    431.8 KiB
 postgresql-jdbc                    noarch 42.6.0-3.fc39           rawhide    944.7 KiB
 raptor2                            x86_64 2.0.15-39.fc39          rawhide    575.4 KiB
 rasqal                             x86_64 0.9.33-25.fc39          rawhide    886.6 KiB
 redland                            x86_64 1.0.17-35.fc39          rawhide    514.1 KiB
 sac                                noarch 1.3-44.fc39             rawhide     18.5 KiB
 xmlsec1                            x86_64 1:1.2.37-5.fc39         rawhide    559.2 KiB
 xmlsec1-nss                        x86_64 1:1.2.37-5.fc39         rawhide    204.7 KiB
 zxing-cpp                          x86_64 2.0.0-5.fc39            rawhide      1.2 MiB
Installing weak dependencies:                                                          
 libreoffice-gtk4                   x86_64 1:7.5.5.2-1.fc39        rawhide      2.1 MiB
 libreoffice-help-en                x86_64 1:7.5.5.2-1.fc39        rawhide     27.3 MiB

Transaction Summary:
 Installing:       83 packages
 Upgrading:         3 packages
 Replacing:         3 packages

Total size of inbound packages is 176 MiB. Need to download 176 MiB.
After this operation 509 MiB will be used (install 511 MiB, remove 2 MiB).
Is this ok [y/N]: 

This happens to be with dnf5-5.0.15-4.fc39.x86_64

rwmjones commented 11 months ago

(which is wider than 80 columns and appears wrapped)

kontura commented 11 months ago

Right, as you can see in the output you provided there is really no way to make it smaller and keep the columns aligned. There is always at least on entry in each column that is fully using it. It is already cutting the Version column: noarch 1:1.002-0.16.20130214.f should be noarch 1:1.002-0.16.20130214.f39.

We could also look into cutting the packages names if too long but it might make the output even more confusing.

There is this other issue to make the output smaller/configurable https://github.com/rpm-software-management/dnf5/issues/326 that I think is related to your request.

rwmjones commented 11 months ago

Old dnf does this:

# dnf install javapackages-filesystem google-crosextra-caladea-fonts pentaho-reporting-flow-engine --releasever=39 --best
Last metadata expiration check: 0:01:49 ago on Mon 07 Aug 2023 11:48:07 BST.
Package javapackages-filesystem-6.1.0-7.fc38.noarch is already installed.
Package google-crosextra-caladea-fonts-1:1.002-0.15.20130214.fc38.noarch is already installed.
Package pentaho-reporting-flow-engine-1:0.9.4-29.fc38.noarch is already installed.
Dependencies resolved.
================================================================================
 Package                        Arch   Version                     Repo    Size
================================================================================
Upgrading:
 google-crosextra-caladea-fonts noarch 1:1.002-0.16.20130214.fc39  fedora  98 k
 javapackages-filesystem        noarch 6.1.0-10.fc39               fedora  12 k
 javapackages-tools             noarch 6.1.0-10.fc39               fedora  37 k
 pentaho-reporting-flow-engine  noarch 1:0.9.4-32.fc39             fedora 285 k

Transaction Summary
================================================================================
Upgrade  4 Packages

Total download size: 432 k
Is this ok [y/N]: n
Operation aborted.

where the summary part is all nicely under 80 columns.

kontura commented 11 months ago

Ok, so if I understand correctly the core of this issue is that dnf5 transaction output is wider because:

rwmjones commented 11 months ago

The issue is that the output is wider than 80 columns on an 80 column terminal, when it doesn't need to be.