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

dnf-repo: Don't download repository if our local cache is up to date #1626

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

aleasto
Copy link
Contributor

@aleasto aleasto commented Sep 28, 2023

Verified by comparing the hash of repomd.xml

@@ -969,6 +969,8 @@ dnf_repo_set_keyfile_data(DnfRepo *repo, gboolean reloadFromGKeyFile, GError **e
dnf_repo_apply_setopts(*conf, repoId);
}

conf->basecachedir().set(libdnf::Option::Priority::REPOCONFIG, dnf_context_get_cache_dir(priv->context));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if this is the right place to do so, but we need to set basecachedir at some point.

@aleasto aleasto force-pushed the refresh branch 5 times, most recently from 6c5eca2 to 730dd1a Compare September 28, 2023 16:46
@aleasto
Copy link
Contributor Author

aleasto commented Sep 28, 2023

I put the check in the dnf_repo_update step rather than the dnf_repo_check step, as frontends may want to know that some download is happening, in this case only either the metalink or the repomd download.

But the integration test is still failing. Where should this be put so that frontends are aware we're downloading new metadata? After dnf_state_set_steps? After dnf_state_action_start(.., DNF_STATE_ACTION_DOWNLOAD_METADATA, ..)?

Verified by comparing the hash of repomd.xml
@aleasto
Copy link
Contributor Author

aleasto commented Sep 28, 2023

Done

@aleasto
Copy link
Contributor Author

aleasto commented Sep 29, 2023

This considerably speeds up the time to refresh in microdnf but most importantly in PackageKit. It improves the experience of using Gnome Software or Plasma Discover

@jrohel @kontura @Conan-Kudo

@Conan-Kudo Conan-Kudo merged commit e7cf3d1 into rpm-software-management:dnf-4-master Sep 29, 2023
3 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.

None yet

2 participants