From 472f622f6f5e0aeadab767171f3852c55dceeb95 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 4 Sep 2014 10:13:02 +0200 Subject: [PATCH] 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. --- lib/transaction_dictionary.c | 11 ++++++++++- lib/transaction_ops.c | 3 --- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/transaction_dictionary.c b/lib/transaction_dictionary.c index b08bf315..c8050e51 100644 --- a/lib/transaction_dictionary.c +++ b/lib/transaction_dictionary.c @@ -239,11 +239,20 @@ int xbps_transaction_prepare(struct xbps_handle *xhp) { xbps_array_t array; + unsigned int i; int rv = 0; if (xhp->transd == NULL) 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. */ @@ -253,7 +262,7 @@ xbps_transaction_prepare(struct xbps_handle *xhp) return ENODEV; 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)); /* * If there are package conflicts bail out. diff --git a/lib/transaction_ops.c b/lib/transaction_ops.c index 5e3baf4c..87191d44 100644 --- a/lib/transaction_ops.c +++ b/lib/transaction_ops.c @@ -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); assert(pkgname); /*