xbps_pkgdb_get_pkg_revdeps: make sure to not have dup entries.
This commit is contained in:
parent
8c84e22b94
commit
0e40a2dbba
@ -226,11 +226,7 @@ xbps_pkgdb_get_pkg_revdeps(struct xbps_handle *xhp, const char *pkg)
|
|||||||
prop_object_iterator_t iter;
|
prop_object_iterator_t iter;
|
||||||
const char *pkgver, *curpkgver;
|
const char *pkgver, *curpkgver;
|
||||||
|
|
||||||
if (xbps_pkgdb_init(xhp) != 0)
|
if ((pkgd = xbps_pkgdb_get_pkg(xhp, pkg)) == NULL)
|
||||||
return NULL;
|
|
||||||
|
|
||||||
pkgd = xbps_find_pkg_in_array(xhp->pkgdb, pkg);
|
|
||||||
if (pkgd == NULL)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
prop_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver);
|
prop_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver);
|
||||||
@ -261,7 +257,8 @@ xbps_pkgdb_get_pkg_revdeps(struct xbps_handle *xhp, const char *pkg)
|
|||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
result = prop_array_create();
|
result = prop_array_create();
|
||||||
|
|
||||||
prop_array_add_cstring_nocopy(result, curpkgver);
|
if (!xbps_match_string_in_array(result, curpkgver))
|
||||||
|
prop_array_add_cstring_nocopy(result, curpkgver);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prop_object_iterator_release(iter);
|
prop_object_iterator_release(iter);
|
||||||
|
Loading…
Reference in New Issue
Block a user