From 1afb35822162344a98772aed5fca547df341b27a Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 5 Oct 2009 21:57:48 +0200 Subject: [PATCH] Fix bug #443436: endless loop if indirect dep missing in repo. Make xbps_find_deps_in_pkg() return ENOENT when missing deps are found. --HG-- extra : convert_revision : xtraeme%40gmail.com-20091005195748-nhhsgldgg3hwfcz7 --- lib/depends.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/depends.c b/lib/depends.c index bbd13794..dabb5d31 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -143,6 +143,7 @@ xbps_find_deps_in_pkg(prop_dictionary_t master, prop_dictionary_t pkg) prop_array_t pkg_rdeps, missing_rdeps; struct repository_data *rdata; int rv = 0; + bool missingdeps = false; assert(pkg != NULL); assert(iter != NULL); @@ -165,6 +166,7 @@ xbps_find_deps_in_pkg(prop_dictionary_t master, prop_dictionary_t pkg) if (rv != 0) { if (rv == ENOENT) { rv = 0; + missingdeps = true; continue; } break; @@ -185,7 +187,10 @@ xbps_find_deps_in_pkg(prop_dictionary_t master, prop_dictionary_t pkg) return rv; } - return 0; + if (missingdeps) + rv = ENOENT; + + return rv; } static int