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

During package donwload setup first add all downloads then handle local #1989

Merged
merged 4 commits into from
Jan 21, 2025

Conversation

kontura
Copy link
Contributor

@kontura kontura commented Jan 7, 2025

See the last commit for details.

The new unit test doesn't test the fix but I have created it during development and it seems valuable enough to keep.

A proper test would probably need to be added to ci-dnf-stack because it requires dnf5 DownloadCallbacks.

Closes: #1957

Color code sequence can look like: `ESC[32m`, we need to handle two
digits after `ESC[`.

Also add better reporting when an unknown sequence is found.
This caused atleast two problems:
1. When the first package was local and its `end` callback was called
   immediately it updated and printed the MultiProgressBar which thought
   that its finished (because it contained only one finished bar).
   This lead to an extra new line being printed which broke the output,
   reported here: rpm-software-management#1957
2. The numbering of bars was wrong, most noticeable with bigger
   transactions with some already downloaded packages. It could look
   like:
   ```
   Transaction Summary:
    Installing:       296 packages

   Total size of inbound packages is 414 MiB. Need to download 412 MiB.
   After this operation, 1 GiB extra will be used (install 1 GiB, remove 0 B).
   Is this ok [y/N]: y
   [1/1] libreoffice-1:24.8.4.2-2.fc41.x86_64                                                       100% |   0.0   B/s |   0.0   B |  00m00s
   >>> Already downloaded
   -----------------------------------------------------------------------------------------------------------------------------------------
   [1/2] libreoffice-base-1:24.8.4.2-2.fc41.x86_64                                                  100% |   0.0   B/s |   0.0   B |  00m00s
   >>> Already downloaded
   -----------------------------------------------------------------------------------------------------------------------------------------
   [1/4] libreoffice-draw-1:24.8.4.2-2.fc41.x86_64                                                  100% |   0.0   B/s |   0.0   B |  00m00s
   >>> Already downloaded
   -----------------------------------------------------------------------------------------------------------------------------------------
   [2/5] libreoffice-emailmerge-1:24.8.4.2-2.fc41.x86_64                                            100% |   0.0   B/s |   0.0   B |  00m00s
   >>> Already downloaded
   -----------------------------------------------------------------------------------------------------------------------------------------
   [3/6] libreoffice-impress-1:24.8.4.2-2.fc41.x86_64                                               100% |   0.0   B/s |   0.0   B |  00m00s
   >>> Already downloaded
   -----------------------------------------------------------------------------------------------------------------------------------------
   [4/7] libreoffice-math-1:24.8.4.2-2.fc41.x86_64                                                  100% |   0.0   B/s |   0.0   B |  00m00s
   >>> Already downloaded
   -----------------------------------------------------------------------------------------------------------------------------------------
   [  5/296] libreoffice-calc-1:24.8.4.2-2.fc41.x86_64                           0% [<=>               ] |   1.0   B/s |   0.0   B |  97d15h
   ```
Copy link
Member

@m-blaha m-blaha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@m-blaha m-blaha added this pull request to the merge queue Jan 21, 2025
Merged via the queue into rpm-software-management:main with commit 7ea045c Jan 21, 2025
17 checks passed
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

Successfully merging this pull request may close these issues.

Download progressbar repeatedly prints new status on a new line
2 participants