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 v2 #2093

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

m-blaha
Copy link
Member

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

This is alternative solution to #2061

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

By default, the repositories are created from config files. But commands
like `dnf offline _execute` can choose not to create them.
@m-blaha m-blaha marked this pull request as ready for review February 27, 2025 15:56
@m-blaha m-blaha requested a review from a team as a code owner February 27, 2025 15:56
@m-blaha m-blaha requested review from jrohel and kontura and removed request for a team February 27, 2025 15:56
Copy link
Contributor

@kontura kontura left a comment

Choose a reason for hiding this comment

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

(I have only a minor suggestion for a comment.)

Personally I prefer this alternative solution and it is good to go from my point of view.

@@ -390,6 +390,9 @@ void OfflineExecuteCommand::pre_configure() {
// checked when the transaction was prepared and serialized. This way, we
// don't need to keep track of which packages need to be gpgchecked.
ctx.get_base().get_config().get_pkg_gpgcheck_option().set(false);

// do not create repos from the system configuration
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be even more helpful to also describe why we don't create repos from the system configs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you. I've amended the commit with more descriptive comment.

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
@m-blaha m-blaha force-pushed the mblaha/system-upgrade-repos-on-the-fly branch from e24c4c1 to 681b1c3 Compare March 3, 2025 08:06
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