summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cli.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 30e1a46..f34f485 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -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)
}
}