xbps-query(8): fix --fulldeptree with pkgs that have multiple vpkgs.

This commit is contained in:
Juan RP 2014-08-23 08:47:38 +02:00
parent 4c14785480
commit 1d2dabca09

View File

@ -62,8 +62,10 @@ print_rdeps(struct xbps_handle *xhp, xbps_array_t rdeps, bool full, bool repo)
continue; continue;
} }
if (repo) { if (repo) {
if ((pkgd = xbps_rpool_get_pkg(xhp, curdep)) == NULL) if ((pkgd = xbps_rpool_get_pkg(xhp, curdep)) == NULL) {
pkgd = xbps_rpool_get_virtualpkg(xhp, curdep); pkgd = xbps_rpool_get_virtualpkg(xhp, curdep);
virtual = true;
}
} else { } else {
if ((pkgd = xbps_pkgdb_get_pkg(xhp, curdep)) == NULL) { if ((pkgd = xbps_pkgdb_get_pkg(xhp, curdep)) == NULL) {
pkgd = xbps_pkgdb_get_virtualpkg(xhp, curdep); pkgd = xbps_pkgdb_get_virtualpkg(xhp, curdep);
@ -81,7 +83,7 @@ print_rdeps(struct xbps_handle *xhp, xbps_array_t rdeps, bool full, bool repo)
p = xbps_pkg_name(curdep); p = xbps_pkg_name(curdep);
assert(p); assert(p);
vpkg = xbps_xasprintf("%s-0.1_1", p); vpkg = xbps_xasprintf("%s-%s", p, xbps_pkg_version(pkgver));
assert(vpkg); assert(vpkg);
free(p); free(p);
} }
@ -105,6 +107,7 @@ print_rdeps(struct xbps_handle *xhp, xbps_array_t rdeps, bool full, bool repo)
pd->rdeps = xbps_array_copy(currdeps); pd->rdeps = xbps_array_copy(currdeps);
SLIST_INSERT_HEAD(&pkgdep_list, pd, pkgdep_entries); SLIST_INSERT_HEAD(&pkgdep_list, pd, pkgdep_entries);
//printf("Added %s into the slist\n", pd->pkg);
} }
if (xbps_array_count(currdeps)) if (xbps_array_count(currdeps))
print_rdeps(xhp, currdeps, full, repo); print_rdeps(xhp, currdeps, full, repo);
@ -153,7 +156,10 @@ sort_rdeps(void)
found = true; found = true;
break; break;
} }
//printf("%s ndeps: %u result: %u rdeps: %u mdeps: %u\n", pd->pkg, ndeps, xbps_array_count(result), rdeps, mdeps); /*
printf("%s ndeps: %u result: %u rdeps: %u mdeps: %u\n",
pd->pkg, ndeps, xbps_array_count(result), rdeps, mdeps);
*/
} }
if (found && !xbps_match_string_in_array(result, pd->pkg)) { if (found && !xbps_match_string_in_array(result, pd->pkg)) {
xbps_array_add_cstring_nocopy(result, pd->pkg); xbps_array_add_cstring_nocopy(result, pd->pkg);