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

core: Don't try to update libdnf _TYPE_MEDIA repos #1703

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/libpriv/rpmostree-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,8 +1107,14 @@ rpmostree_context_download_metadata (RpmOstreeContext *self,
g_auto(RpmOstreeProgress) progress = { 0, };
rpmostree_output_progress_percent_begin (&progress, "Updating metadata for '%s'",
dnf_repo_get_id (repo));
if (!dnf_repo_update (repo, DNF_REPO_UPDATE_FLAG_FORCE, hifstate, error))
return FALSE;
/* https://discussion.fedoraproject.org/t/rpm-ostree-giving-error/772/2
* This would be better fixed in libdnf but that blocks on the rebase
*/
if (dnf_repo_get_kind (repo) != DNF_REPO_KIND_MEDIA)
{
if (!dnf_repo_update (repo, DNF_REPO_UPDATE_FLAG_FORCE, hifstate, error))
return FALSE;
Copy link
Member

Choose a reason for hiding this comment

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

Were you able to test this out?
ISTM like dnf_repo_update would still be called on that repo when we do dnf_context_setup_sack_with_flags() below, no? The flow there is similar to what we have here:

    ret = dnf_repo_check(repo,
                         permissible_cache_age,
                         state_local,
                         &error_local);
    if (!ret) {
        g_debug("failed to check, attempting update: %s",
                error_local->message);
        g_clear_error(&error_local);
        dnf_state_reset(state_local);
        ret = dnf_repo_update(repo,
                              DNF_REPO_UPDATE_FLAG_FORCE,
                              state_local,
                              &error_local);

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yeah, should have noted I didn't test it beyond compilation. Looks like you're right.

}

did_update = TRUE;

Expand Down