From 0c860d1db0bcd20db7f49315c7962f4383ac409f Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 20 Apr 2019 13:06:30 +0200 Subject: [PATCH] xbps-dgraph: fix regresion introduced by the fulldeptree changes. This now works as expected again, see https://i.imgur.com/pr2XO70.png for the full dependency graph of the sway pkg installed on my system. Closes: #80 [via git-merge-pr] --- bin/xbps-dgraph/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/xbps-dgraph/main.c b/bin/xbps-dgraph/main.c index 633e4515..3075d9ea 100644 --- a/bin/xbps-dgraph/main.c +++ b/bin/xbps-dgraph/main.c @@ -347,13 +347,17 @@ process_fulldeptree(struct xbps_handle *xhp, FILE *f, xbps_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver); - for (i = 0; i < xbps_array_count(rdeps); i++) { + i = xbps_array_count(rdeps); + while (i--) { xbps_dictionary_t rpkgd; const char *pkgdep; unsigned int pkgidx = 0; bool found = false; xbps_array_get_cstring_nocopy(rdeps, i, &pkgdep); + if (strcmp(pkgdep, pkgver) == 0) + continue; + SLIST_FOREACH(pd, &pkgdep_list, pkgdep_entries) { if (strcmp(pd->pkgver, pkgdep) == 0) { found = true;