diff options
| author | Hermes Agent <hermes@localhost> | 2026-08-12 06:31:13 +0000 |
|---|---|---|
| committer | Hermes Agent <hermes@localhost> | 2026-08-12 06:31:13 +0000 |
| commit | 200df1f46cc5a5a5659c90ab37c2ba624cb17b5a (patch) | |
| tree | d0f0c2580ad9a6b73f3c3adc5b43908093b5f631 /src/cli.rs | |
| parent | 80686835f4d6ef1a42a97ffcfbc48746861a129c (diff) | |
Prefer companion manifests during artifact comparison
Diffstat (limited to 'src/cli.rs')
| -rw-r--r-- | src/cli.rs | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -101,8 +101,17 @@ pub fn run(cli: Cli) -> Result<()> { } fn load_artifact(path: &std::path::Path) -> Result<ArtifactManifest> { - match path.extension().and_then(|extension| extension.to_str()) { - Some("toml") => ArtifactManifest::load(path), - _ => ArtifactManifest::collect_archive(path), + if matches!(path.extension().and_then(|extension| extension.to_str()), Some("toml")) { + return ArtifactManifest::load(path); + } + + // A completed native build writes richer package and initramfs facts beside + // its tarball. Prefer that project-owned semantic record while retaining + // direct legacy-tar inspection when no companion is available. + let companion = ArtifactManifest::path_beside(path)?; + if companion.is_file() { + ArtifactManifest::load(companion) + } else { + ArtifactManifest::collect_archive(path) } } |