Simplify find_pkg_in_array().

This commit is contained in:
Juan RP 2011-02-21 23:21:53 +01:00
parent c4db906a1f
commit 511dbffa9e

View File

@ -130,21 +130,19 @@ find_pkg_in_array(prop_array_t array, const char *str, bool bypattern)
continue; continue;
if (xbps_pkgpattern_match(pkgver, __UNCONST(str))) if (xbps_pkgpattern_match(pkgver, __UNCONST(str)))
break; break;
/*
* Finally check if package pattern matches
* any virtual package version in dictionary.
*/
if (xbps_find_virtual_pkg_in_dict(obj, str, true))
break;
} else { } else {
if (!prop_dictionary_get_cstring_nocopy(obj, if (!prop_dictionary_get_cstring_nocopy(obj,
"pkgname", &dpkgn)) "pkgname", &dpkgn))
continue; continue;
if (strcmp(dpkgn, str) == 0) if (strcmp(dpkgn, str) == 0)
break; break;
if (xbps_find_virtual_pkg_in_dict(obj, str, false))
break;
} }
/*
* Finally check if package pattern matches
* any virtual package version in dictionary.
*/
if (xbps_find_virtual_pkg_in_dict(obj, str, bypattern))
break;
} }
prop_object_iterator_release(iter); prop_object_iterator_release(iter);
if (obj == NULL) { if (obj == NULL) {