Avoid endless loop while sorting dependencies due to missing packages.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100129034440-c1c9q0o5b0r1hhh2
This commit is contained in:
Juan RP
2010-01-29 04:44:40 +01:00
parent 83ab3fe977
commit 2daffcc768
2 changed files with 16 additions and 1 deletions

View File

@@ -62,7 +62,7 @@ find_sorteddep_by_name(const char *pkgname)
int HIDDEN
xbps_sort_pkg_deps(prop_dictionary_t chaindeps)
{
prop_array_t sorted, unsorted, rundeps;
prop_array_t sorted, unsorted, rundeps, missingdeps;
prop_object_t obj, obj2;
prop_object_iterator_t iter, iter2;
struct sorted_dependency *sdep;
@@ -73,6 +73,13 @@ xbps_sort_pkg_deps(prop_dictionary_t chaindeps)
assert(chaindeps != NULL);
/*
* If there are missing dependencies, bail out.
*/
missingdeps = prop_dictionary_get(chaindeps, "missing_deps");
if (prop_array_count(missingdeps) > 0)
return ENOENT;
sorted = prop_array_create();
if (sorted == NULL)
return ENOMEM;