From e4ac987ff17bfcca328f671e6e8b0bdc074f3400 Mon Sep 17 00:00:00 2001 From: Erik Skultety Date: Wed, 17 Apr 2024 17:10:03 +0200 Subject: [PATCH] package_managers: rpm: inject_files: Drop sorting repo directories The sorting was added solely to make comparing of the expected and generated repo files' contents more deterministic in unit tests, but now that we're driving the generation process with ConfigParser, we can perform the comparisons on the object level rather than actual file contents, and so we no longer need to sacrifice the beauty of using iterdir's generator by converting it to a list just to keep tests deterministic. Signed-off-by: Erik Skultety --- cachi2/core/package_managers/rpm/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cachi2/core/package_managers/rpm/main.py b/cachi2/core/package_managers/rpm/main.py index 9e02fdf2c..9511a3321 100644 --- a/cachi2/core/package_managers/rpm/main.py +++ b/cachi2/core/package_managers/rpm/main.py @@ -314,7 +314,8 @@ def _generate_repofiles(from_output_dir: Path, for_output_dir: Path) -> None: continue log.debug(f"Preparing repofile content for arch '{arch.name}'") repofile = _Repofile(defaults={"gpgcheck": "1"}) - for entry in sorted(arch.iterdir()): + + for entry in arch.iterdir(): if not entry.is_dir() or entry.name == "repos.d": continue repoid = entry.name