Finally fixed vpkg02 test (vpkg provider in transaction).

Rather than collecting dependencies for a pkg that has been added to the
transaction dictionary, do this for all pkgs in transaction once all
packages are already there.
This commit is contained in:
Juan RP 2014-09-04 10:13:02 +02:00
parent d0a4cc5b9d
commit 472f622f6f
2 changed files with 10 additions and 4 deletions

View File

@ -239,11 +239,20 @@ int
xbps_transaction_prepare(struct xbps_handle *xhp) xbps_transaction_prepare(struct xbps_handle *xhp)
{ {
xbps_array_t array; xbps_array_t array;
unsigned int i;
int rv = 0; int rv = 0;
if (xhp->transd == NULL) if (xhp->transd == NULL)
return ENXIO; return ENXIO;
/*
* Collect dependencies for pkgs in transaction.
*/
array = xbps_dictionary_get(xhp->transd, "unsorted_deps");
for (i = 0; i < xbps_array_count(array); i++) {
if ((rv = xbps_repository_find_deps(xhp, array, xbps_array_get(array, i))) != 0)
return rv;
}
/* /*
* If there are missing deps or revdeps bail out. * If there are missing deps or revdeps bail out.
*/ */
@ -253,7 +262,7 @@ xbps_transaction_prepare(struct xbps_handle *xhp)
return ENODEV; return ENODEV;
array = xbps_dictionary_get(xhp->transd, "unsorted_deps"); array = xbps_dictionary_get(xhp->transd, "unsorted_deps");
for (unsigned int i = 0; i < xbps_array_count(array); i++) for (i = 0; i < xbps_array_count(array); i++)
xbps_pkg_find_conflicts(xhp, array, xbps_array_get(array, i)); xbps_pkg_find_conflicts(xhp, array, xbps_array_get(array, i));
/* /*
* If there are package conflicts bail out. * If there are package conflicts bail out.

View File

@ -158,9 +158,6 @@ trans_find_pkg(struct xbps_handle *xhp, const char *pkg, bool reinstall)
} }
} }
if ((rv = xbps_repository_find_deps(xhp, unsorted, pkg_repod)) != 0)
return rv;
pkgname = xbps_pkg_name(repopkgver); pkgname = xbps_pkg_name(repopkgver);
assert(pkgname); assert(pkgname);
/* /*