Don't process processed packages again in collect_rdeps

Otherwise we will get exponential time complexity
This commit is contained in:
Yuxuan Shui 2019-01-09 17:58:44 +00:00 committed by Helmut Pozimski
parent 07ec982b07
commit 2c69345acc

View File

@ -107,12 +107,12 @@ collect_rdeps(struct xbps_handle *xhp, xbps_dictionary_t pkgd, bool rpool)
pd->pkg = curpkgver;
pd->rdeps = xbps_array_copy(currdeps);
SLIST_INSERT_HEAD(&pkgdep_list, pd, pkgdep_entries);
}
if (xbps_array_count(currdeps)) {
int rv;
if (xbps_array_count(currdeps)) {
int rv;
if ((rv = collect_rdeps(xhp, curpkgd, rpool)) != 0)
return rv;
if ((rv = collect_rdeps(xhp, curpkgd, rpool)) != 0)
return rv;
}
}
}
return 0;