From 0e40a2dbba265972d96329e4387a26c17741db15 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 1 Dec 2012 08:10:47 +0100 Subject: [PATCH] xbps_pkgdb_get_pkg_revdeps: make sure to not have dup entries. --- lib/pkgdb.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/pkgdb.c b/lib/pkgdb.c index 29dbfd74..3f9864ea 100644 --- a/lib/pkgdb.c +++ b/lib/pkgdb.c @@ -226,11 +226,7 @@ xbps_pkgdb_get_pkg_revdeps(struct xbps_handle *xhp, const char *pkg) prop_object_iterator_t iter; const char *pkgver, *curpkgver; - if (xbps_pkgdb_init(xhp) != 0) - return NULL; - - pkgd = xbps_find_pkg_in_array(xhp->pkgdb, pkg); - if (pkgd == NULL) + if ((pkgd = xbps_pkgdb_get_pkg(xhp, pkg)) == NULL) return NULL; 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) 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);