summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-05-25 15:46:56 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-05-25 17:14:21 +0200
commit9b47e557a40dab7bd13e92790c4515d05f073157 (patch)
tree1344e96f745df9322f86ceedbc86989747b8edd8
parente8063c060cddef9a6f1d8757eaf17c23d6c387a3 (diff)
Fix: Error out if a dependency cannot be found
This fixes a bug where dependencies were not found, but this was ignored. This happened even if there was a typo in the version of the dependency, for example. Signed-off-by: Matthias Beyer <mail@beyermatthias.de> Tested-by: Matthias Beyer <mail@beyermatthias.de> (cherry picked from commit 45806c89605c155df992c1e5e9917f315e9fa495)
-rw-r--r--src/package/dag.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/package/dag.rs b/src/package/dag.rs
index e7b8dc3..1075dda 100644
--- a/src/package/dag.rs
+++ b/src/package/dag.rs
@@ -53,6 +53,9 @@ impl Dag {
.and_then_ok(|(name, constr)| {
trace!("Dependency for {} {} found: {:?}", p.name(), p.version(), name);
let packs = repo.find_with_version(&name, &constr);
+ if packs.is_empty() {
+ return Err(anyhow!("Dependency of {} {} not found: {} {}", p.name(), p.version(), name, constr))
+ }
trace!("Found in repo: {:?}", packs);
// If we didn't check that dependency already