diff options
Diffstat (limited to 'src/manifest.rs')
| -rw-r--r-- | src/manifest.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/manifest.rs b/src/manifest.rs index 57e57c5..c25f0a8 100644 --- a/src/manifest.rs +++ b/src/manifest.rs @@ -96,6 +96,9 @@ impl ArtifactManifest { let mut entry = entry .with_context(|| format!("read archive member from {}", archive_path.display()))?; let path = portable_path(&entry.path()?)?; + if is_archive_root_path(&path) || is_internal_metadata_path(&path) { + continue; + } let entry_type = entry.header().entry_type(); let kind = match entry_type { EntryType::Regular => "file", @@ -235,6 +238,14 @@ fn is_enabled_service(path: &str) -> bool { && path.ends_with(".service") } +fn is_internal_metadata_path(path: &str) -> bool { + matches!(path.split('/').next(), Some(".host" | ".fakedata")) +} + +fn is_archive_root_path(path: &str) -> bool { + path == "." || path == "./" +} + fn service_name(path: &str) -> Result<&str> { path.rsplit('/') .next() |