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

Missing newlines after progress bars when stdout is non-interactive #1058

Closed
Tracked by #1224
evan-goode opened this issue Dec 1, 2023 · 2 comments · Fixed by #1076
Closed
Tracked by #1224

Missing newlines after progress bars when stdout is non-interactive #1058

evan-goode opened this issue Dec 1, 2023 · 2 comments · Fixed by #1076
Assignees
Labels
Priority: HIGH Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take

Comments

@evan-goode
Copy link
Member

When stdout is not an interactive TTY, only the final state of a progress bar is printed, which is correct, but it's missing a newline after the progress bar. All repository updates/package downloads get jumbled into a single line.

To reproduce:

sudo dnf5 remove -y hello info && sudo dnf5 clean all && sudo dnf5 install -y hello | tee /tmp/dnf5-out

/tmp/dnf5-out then contains:

Updating and loading repositories:
 Fedora rawhide openh264 (From Cisco) - 100% |  11.1 KiB/s |   4.1 KiB |  00m00s Fedora - Rawhide - Developmental packa 100% |   6.2 MiB/s |   5.6 MiB |  00m01s
Repositories loaded.
Package                       Arch   Version       Repository      Size
Installing:                                                            
 hello                        x86_64 2.12.1-2.fc39 rawhide    192.3 KiB
Installing weak dependencies:                                          
 info                         x86_64 7.1-1.fc40    rawhide    373.6 KiB

Transaction Summary:
 Installing:        2 packages

Total size of inbound packages is 271 KiB. Need to download 271 KiB.
After this operation 566 KiB will be used (install 566 KiB, remove 0 B).
[1/2] hello-0:2.12.1-2.fc39.x86_64      100% | 201.6 KiB/s |  86.1 KiB |  00m00s[2/2] info-0:7.1-1.fc40.x86_64          100% | 378.8 KiB/s | 184.5 KiB |  00m00s
--------------------------------------------------------------------------------
[2/2] Total                             100% | 330.3 KiB/s | 270.5 KiB |  00m01s
Running transaction
[1/4] Verify package files              100% |   2.0 KiB/s |   2.0   B |  00m00s[2/4] Prepare transaction               100% |  13.0   B/s |   2.0   B |  00m00s[3/4] Installing info-0:7.1-1.fc40.x86_ 100% |  40.6 MiB/s | 374.0 KiB |  00m00s[4/4] Installing hello-0:2.12.1-2.fc39. 100% | 616.2 KiB/s | 200.2 KiB |  00m00s
>>> Running trigger-install scriptlet: glibc-common-0:2.38.9000-26.fc40.x86_64
>>> Stop trigger-install scriptlet: glibc-common-0:2.38.9000-26.fc40.x86_64
>>> Running trigger-install scriptlet: man-db-0:2.12.0-3.fc40.x86_64
>>> Stop trigger-install scriptlet: man-db-0:2.12.0-3.fc40.x86_64
>>> Running trigger-install scriptlet: info-0:7.1-1.fc40.x86_64
>>> Stop trigger-install scriptlet: info-0:7.1-1.fc40.x86_64

In comparison, sudo dnf4 remove -y hello info && sudo dnf4 clean all && sudo dnf4 install -y hello | tee /tmp/dnf4-out

Fedora rawhide openh264 (From Cisco) - x86_64   756  B/s | 257  B     00:00    
Fedora - Rawhide - Developmental packages for t  28 MB/s |  72 MB     00:02    
Dependencies resolved.
================================================================================
 Package        Architecture    Version                  Repository        Size
================================================================================
Installing:
 hello          x86_64          2.12.1-2.fc39            rawhide           86 k
Installing weak dependencies:
 info           x86_64          7.1-1.fc40               rawhide          184 k

Transaction Summary
================================================================================
Install  2 Packages

Total download size: 271 k
Installed size: 566 k
Downloading Packages:
(1/2): hello-2.12.1-2.fc39.x86_64.rpm           271 kB/s |  86 kB     00:00    
(2/2): info-7.1-1.fc40.x86_64.rpm               485 kB/s | 184 kB     00:00    
--------------------------------------------------------------------------------
Total                                           507 kB/s | 271 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Installing       : info-7.1-1.fc40.x86_64                                 1/2 
  Installing       : hello-2.12.1-2.fc39.x86_64                             2/2 
  Running scriptlet: hello-2.12.1-2.fc39.x86_64                             2/2 

Installed:
  hello-2.12.1-2.fc39.x86_64               info-7.1-1.fc40.x86_64              

Complete!

For fedora-copr/copr#3040

@github-project-automation github-project-automation bot moved this to Backlog in DNF team Dec 1, 2023
@jan-kolarik jan-kolarik added Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take Priority: LOW labels Dec 4, 2023
@jan-kolarik
Copy link
Member

I am switching to high prio as this is blocking the switch to DNF5 as the default in COPR.

@jan-kolarik
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: HIGH Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants