Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make dnf update output narrower #1723

Open
juhp opened this issue Sep 23, 2024 · 2 comments
Open

make dnf update output narrower #1723

juhp opened this issue Sep 23, 2024 · 2 comments

Comments

@juhp
Copy link

juhp commented Sep 23, 2024

Compared to dnf4, the output of dnf5 update seems a bit more verbose and generally wider.

Some sample output (157 characters wide) from a maximized terminal:

Package                                                    Arch      Version                                           Repository                        Size
Upgrading:
:
 evolution-data-server                                     x86_64    3.54.0-1.fc41                                     updates-testing                8.8 MiB
   replacing evolution-data-server                         x86_64    3.53.3-1.fc41                                     anaconda                       8.8 MiB
 evolution-data-server-langpacks                           noarch    3.54.0-1.fc41                                     updates-testing                8.7 MiB
   replacing evolution-data-server-langpacks               noarch    3.53.3-1.fc41                                     anaconda                       8.7 MiB
 firefox                                                   x86_64    130.0.1-1.fc41                                    updates-testing              222.9 MiB
   replacing firefox                                       x86_64    130.0-5.fc41                                      anaconda                     222.1 MiB
 firefox-langpacks                                         x86_64    130.0.1-1.fc41                                    updates-testing               58.8 MiB
   replacing firefox-langpacks                             x86_64    130.0-5.fc41                                      anaconda                      58.8 MiB
 gjs                                                       x86_64    1.82.0-1.fc41                                     updates-testing                1.6 MiB
   replacing gjs                                           x86_64    1.81.2-1.fc41                                     anaconda                       1.6 MiB
:
 libvirt-daemon-driver-storage-iscsi                       x86_64    10.6.0-4.fc41                                     updates-testing               23.8 KiB
   replacing libvirt-daemon-driver-storage-iscsi           x86_64    10.6.0-2.fc41                                     anaconda                      23.8 KiB
 libvirt-daemon-driver-storage-iscsi-direct                x86_64    10.6.0-4.fc41                                     updates-testing               31.9 KiB
   replacing libvirt-daemon-driver-storage-iscsi-direct    x86_64    10.6.0-2.fc41                                     anaconda                      31.9 KiB
 libvirt-daemon-driver-storage-logical                     x86_64    10.6.0-4.fc41                                     updates-testing               32.0 KiB
   replacing libvirt-daemon-driver-storage-logical         x86_64    10.6.0-2.fc41                                     anaconda                      32.0 KiB
:

(In this case libvirt-daemon-driver-storage-iscsi-direct is the longest package name.)
The use of "replacing" exasperates the problem in a narrow terminal by making the output even wider:
you could consider not repeating the package name on the second old NVR line when it is not a package replacement?
That could prevent some of the additional width (~10 characters).

This also means that nearly always the update is too wide to fit in a 80 character wide terminal.

I think it would be better to try to respect the terminal width like dnf4 did I believe, and only let very long package name lines overflow/spill over to the next time: also not stretching the text to use all the available width in a wide maximized terminal.

The corresponding output in a 80 character terminals is 104 characters wide:

Package                                                 Arch   Version                 Reposit      Size
Upgrading:
:
 evolution-data-server                                  x86_64 3.54.0-1.fc41           updates   8.8 MiB
   replacing evolution-data-server                      x86_64 3.53.3-1.fc41           anacond   8.8 MiB
 evolution-data-server-langpacks                        noarch 3.54.0-1.fc41           updates   8.7 MiB
   replacing evolution-data-server-langpacks            noarch 3.53.3-1.fc41           anacond   8.7 MiB
 firefox                                                x86_64 130.0.1-1.fc41          updates 222.9 MiB
   replacing firefox                                    x86_64 130.0-5.fc41            anacond 222.1 MiB
 firefox-langpacks                                      x86_64 130.0.1-1.fc41          updates  58.8 MiB
   replacing firefox-langpacks                          x86_64 130.0-5.fc41            anacond  58.8 MiB
 gjs                                                    x86_64 1.82.0-1.fc41           updates   1.6 MiB
   replacing gjs                                        x86_64 1.81.2-1.fc41           anacond   1.6 MiB
:
 libvirt-daemon-driver-storage-iscsi                    x86_64 10.6.0-4.fc41           updates  23.8 KiB
   replacing libvirt-daemon-driver-storage-iscsi        x86_64 10.6.0-2.fc41           anacond  23.8 KiB
 libvirt-daemon-driver-storage-iscsi-direct             x86_64 10.6.0-4.fc41           updates  31.9 KiB
   replacing libvirt-daemon-driver-storage-iscsi-direct x86_64 10.6.0-2.fc41           anacond  31.9 KiB
 libvirt-daemon-driver-storage-logical                  x86_64 10.6.0-4.fc41           updates  32.0 KiB
   replacing libvirt-daemon-driver-storage-logical      x86_64 10.6.0-2.fc41           anacond  32.0 KiB
:

I should really copy it in a way that makes the wrapping obvious: here is a screenshot:

terminal-update

@juhp
Copy link
Author

juhp commented Sep 23, 2024

(No matter how wide the terminal, dnf5 update always stretches the package output to use the maximum available wide.)

@ilikelinux69
Copy link

ilikelinux69 commented Sep 23, 2024

+1 Observed same issue.

you could consider not repeating the package name on the second old NVR line when it is not a package replacement?
That could prevent some of the additional width (~10 characters).

Or maybe to shorten the second line and make it expandable with extra parameters as journalctl does, to see the whole line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants