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

Use actual repository ID in stored transactions #2061

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

m-blaha
Copy link
Member

@m-blaha m-blaha commented Feb 13, 2025

Currently, when replaying a stored transaction, all RPM files are placed into a single @stored_transaction repository. This can be confusing, especially during a system upgrade, which also uses stored transactions.

With this patch, local RPM files from stored transactions are placed to the repository they originally came from.

Fixes: #1851

@kontura kontura self-assigned this Feb 13, 2025
@m-blaha m-blaha force-pushed the mblaha/system-upgrade-repos branch 3 times, most recently from 460a416 to 544667e Compare February 19, 2025 13:24
Previously, the `Package::get_package_path()` method worked correctly
only for packages in repositories of type `Repo::Type::COMMANDLINE`. When
an RPM file was added to a regular `Repo::Type::AVAILABLE` repository,
its package path incorrectly pointed to the cache directory instead of
the local RPM file. This fix ensures the correct path is used.
Currently, when replaying a stored transaction, all RPM files are
placed into a single `@stored_transaction` repository. The user can see
this artifitial repository when checking from which repositories the
installed packages came:

❯ dnf repoquery --installed --queryformat="%{full_nevra} %{from_repo}\n"
vlc-plugin-gstreamer-1:3.0.21-15.fc40.x86_64 @stored_transaction

This can be confusing, especially during a system upgrade, which also
uses stored transactions.

With this patch, local RPM files from stored transactions are
placed to the repository they originally came from:

❯ dnf repoquery --installed --queryformat="%{full_nevra} %{from_repo}\n"
vlc-plugin-gstreamer-1:3.0.21-15.fc40.x86_64 updates

Fixes: #1851
Use explicit std::vector<std::string> constructor instead of uniform
initialization.
@m-blaha m-blaha force-pushed the mblaha/system-upgrade-repos branch from 544667e to 36d5e1d Compare February 19, 2025 15:43
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.

Incorrect source repository (from_repo) after system upgrade
2 participants