Set up a DNF cache directory for reuse across container builds.
(ctx)
| 696 | |
| 697 | @Builder.set(Steps.DNF_CACHE) |
| 698 | def dnf_cache_dir(ctx): |
| 699 | """Set up a DNF cache directory for reuse across container builds.""" |
| 700 | if ctx.cli.distro not in DistroKind.uses_dnf(): |
| 701 | return |
| 702 | if not ctx.cli.dnf_cache_path: |
| 703 | return |
| 704 | |
| 705 | ctx.distro_cache_name = f"_ceph_{ctx.cli.distro}" |
| 706 | cache_dir = ctx.dnf_cache_dir |
| 707 | (cache_dir / "lib").mkdir(parents=True, exist_ok=True) |
| 708 | (cache_dir / "cache").mkdir(parents=True, exist_ok=True) |
| 709 | (cache_dir / ".DNF_CACHE").touch(exist_ok=True) |
| 710 | |
| 711 | |
| 712 | @Builder.set(Steps.NPM_CACHE) |