diff options
| author | Hermes Agent <hermes@localhost> | 2026-08-12 03:17:30 +0000 |
|---|---|---|
| committer | Hermes Agent <hermes@localhost> | 2026-08-12 03:17:30 +0000 |
| commit | 47f461b35fe77c9454488b64fddc2576ff2561be (patch) | |
| tree | afd43266757c4902edc62357d5c0d81f1830825c /src | |
| parent | ca6572f7c96fd14733b42ad6dcd361bc136093ed (diff) | |
Exclude nested internal metadata from manifests
Diffstat (limited to 'src')
| -rw-r--r-- | src/manifest.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<Vec<FileRecord>> { 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 { |