Treat pkgs with NULL or empty requiredby arrays as orphans.

This commit is contained in:
Juan RP 2011-02-26 11:08:58 +01:00
parent f2ef0c0050
commit 2c644c6587

View File

@ -97,13 +97,10 @@ find_orphan_pkg(prop_object_t obj, void *arg, bool *loop_done)
return 0; return 0;
reqby = prop_dictionary_get(obj, "requiredby"); reqby = prop_dictionary_get(obj, "requiredby");
if (prop_object_type(reqby) != PROP_TYPE_ARRAY) if (reqby == NULL || ((cnt = prop_array_count(reqby)) == 0)) {
return EINVAL;
/* /*
* Add packages with empty "requiredby" arrays. * Add packages with empty or missing "requiredby" arrays.
*/ */
cnt = prop_array_count(reqby);
if (cnt == 0) {
prop_array_add(od->array, obj); prop_array_add(od->array, obj);
return 0; return 0;
} }