MCPcopy Create free account
hub / github.com/ceph/ceph / dnf_cache_dir

Function dnf_cache_dir

src/script/build-with-container.py:698–709  ·  view source on GitHub ↗

Set up a DNF cache directory for reuse across container builds.

(ctx)

Source from the content-addressed store, hash-verified

696
697@Builder.set(Steps.DNF_CACHE)
698def 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)

Callers

nothing calls this directly

Calls 3

uses_dnfMethod · 0.80
mkdirMethod · 0.45
touchMethod · 0.45

Tested by

no test coverage detected