From ed87b42ecdaabc00e7752d78a92609805d9fbb3c Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Tue, 13 Feb 2024 00:11:27 +0000 Subject: [PATCH] backends dnf: add load_filelists implementation Relates: https://github.com/rpm-software-management/dnf/pull/2012 --- src/fedrq/backends/dnf/backend/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/fedrq/backends/dnf/backend/__init__.py b/src/fedrq/backends/dnf/backend/__init__.py index 3a4d323..e8c3c41 100644 --- a/src/fedrq/backends/dnf/backend/__init__.py +++ b/src/fedrq/backends/dnf/backend/__init__.py @@ -65,6 +65,17 @@ def set_var(self, key: str, value: t.Any) -> None: raise KeyError(f"{key} is not a valid substitution") self.set(key, value) + def load_filelists(self, enable: bool = True) -> None: + # Old versions of dnf always load filelists + if not hasattr(self.conf, "optional_metadata_types"): + return + types: list[str] = self.conf.optional_metadata_types + if enable: + types.append("filelists") + return + while "filelists" in types: + types.remove("filelists") + def load_changelogs(self, enable: bool = True) -> None: for repo in self.base.repos.iter_enabled(): repo.load_metadata_other = enable