Hide Forgot
Description of problem: When baseurl is *not* used, dnf apparently checks whether the repo has changed, before re-downloading it. When dnf is configured with a repo with a baseurl (i.e. for a local repo) and the cache passes it's maximum age, dnf has to download tens of megabytes. Version-Release number of selected component (if applicable): dnf-1.1.10-1.fc24.noarch How reproducible: always Steps to Reproduce: 1. edit /etc/yum.repo.d/fedora.repo, comment out "metalink" and uncomment "baseurl" 2. dnf --refresh check-update 3. dnf --refresh check-update Actual results: Step 3 re-downloads 10s of megabytes, despite the repo not having changed since step 2. Expected results: Only repomd.xml needs to be re-downloaded to check for changes. Additional info: I noticed this after configuring my system with baseurl. I checked the source code of dnf and found this code, which relies on metalink. The check could be changed, or a check added, to re-download repomd.xml, if the file contents are identical then the existing cache can be re-used. if self.metadata or self._try_cache(): if self.sync_strategy in (SYNC_ONLY_CACHE, SYNC_LAZY) or \ not self._expired: logger.debug('repo: using cache for: %s', self.id) return False if self.sync_strategy == SYNC_ONLY_CACHE: msg = "Cache-only enabled but no cache for '%s'" % self.id raise dnf.exceptions.RepoError(msg) try: if self._try_revive(): # the expired metadata still reflect the origin: self.metadata.reset_age() self._expired = False return True def _try_revive(self): """Use metalink to check whether our metadata are still current.""" if not self.metadata: return False if not self.metalink: return False
https://github.com/rpm-software-management/dnf/pull/601
Fixed in dnf-2.0.1-1 and released into rawhide