From 47f461b35fe77c9454488b64fddc2576ff2561be Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 12 Aug 2026 03:17:30 +0000 Subject: Exclude nested internal metadata from manifests --- src/manifest.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/manifest.rs b/src/manifest.rs index ed326e1..307913e 100644 --- a/src/manifest.rs +++ b/src/manifest.rs @@ -157,7 +157,7 @@ fn collect_files(rootfs: &Path) -> Result> { for entry in WalkDir::new(rootfs).follow_links(false).min_depth(1) { let entry = entry.with_context(|| format!("walk rootfs {}", rootfs.display()))?; let relative = entry.path().strip_prefix(rootfs).expect("walk entry is below rootfs"); - if relative.components().next().is_some_and(|part| part.as_os_str() == ".host" || part.as_os_str() == ".fakedata") { + if is_internal_metadata_path(&portable_path(relative)?) { continue; } let path = portable_path(relative)?; @@ -301,7 +301,7 @@ fn is_enabled_service(path: &str) -> bool { } fn is_internal_metadata_path(path: &str) -> bool { - matches!(path.split('/').next(), Some(".host" | ".fakedata")) + path.split('/').any(|component| matches!(component, ".host" | ".fakedata")) } fn is_archive_root_path(path: &str) -> bool { -- cgit v1.2.3