refactor(rootfs): split the entry cache into cache.rs

The cache stopped being an implementation detail of the rootfs
lifecycle: entry naming, the advisory lock, digest freshness,
provisioned-layer pointers, and extraction-to-scratch are a store
in their own right. cache.rs now owns RootfsCache's paths, pointers
and extraction products; rootfs.rs keeps the lifecycle API
(PrepareRequest, PreparedRootfs, prepare, prepare_provisioned).
resolve_source moves next to its inputs in distro. Pure movement -
naming still derives its extension from the URL, next commit
changes that.
This commit is contained in:
vhaudiquet committed 2026-10-30 00:44:46 +01:00
1 parent 52d734063f
commit 479dfb79d0
6 files changed
+657 -627

No files matched your search

+3 -2
View File
@@ -37,7 +37,8 @@ fn cmd_provision(
command: &[String],
cli_verbose: bool,
) -> std::process::ExitCode {
use ecrou::rootfs::{PrepareRequest, RootfsCache};
use ecrou::cache::RootfsCache;
use ecrou::rootfs::PrepareRequest;
use ecrou::spec::ProvisionSpec;
// Two shapes: `provision IMAGE -- COMMAND` bakes a one-off
@@ -251,7 +252,7 @@ fn cmd_probe() -> std::process::ExitCode {
}
print!("cache: ");
match ecrou::rootfs::RootfsCache::default_dir() {
match ecrou::cache::RootfsCache::default_dir() {
Ok(dir) => {
// The run flow creates the cache on demand; probe mirrors it.
if let Err(err) = std::fs::create_dir_all(&dir) {