Skip to content

Commit

Permalink
package_managers: rpm: inject_files: Drop sorting repo directories
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
eskultety committed Apr 26, 2024
1 parent 3eab4fd commit e4ac987
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cachi2/core/package_managers/rpm/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e4ac987

Please sign in to comment.