From 42e0f19bbead36cae4e4a71f02c2e08a0aa2cd8c Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 1 Feb 2013 12:41:27 +0100 Subject: [PATCH] Fix package conflicts detection (regression from b9136c61c95698a). --- NEWS | 3 +++ lib/package_conflicts.c | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 22e76249..8e5fbc46 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ xbps-0.21 (???): + * Fix regression introduced in b9136c61c95698a5dafbc69ee9cd873110c68e45, + breaking package conflicts detection. + * xbps-install(8): removed the -s,--skip-sync option; the new -S,--sync option makes this redundant and useless. diff --git a/lib/package_conflicts.c b/lib/package_conflicts.c index 709a921f..dd076777 100644 --- a/lib/package_conflicts.c +++ b/lib/package_conflicts.c @@ -50,10 +50,12 @@ xbps_pkg_find_conflicts(struct xbps_handle *xhp, trans_cflicts = prop_dictionary_get(xhp->transd, "conflicts"); prop_dictionary_get_cstring_nocopy(pkg_repod, "pkgver", &repopkgver); - iter = prop_array_iterator(trans_cflicts); + iter = prop_array_iterator(pkg_cflicts); assert(iter); + while ((obj = prop_object_iterator_next(iter))) { cfpkg = prop_string_cstring_nocopy(obj); + /* * Check if current pkg conflicts with an installed package. */ @@ -61,6 +63,9 @@ xbps_pkg_find_conflicts(struct xbps_handle *xhp, (pkgd = xbps_pkgdb_get_virtualpkg(xhp, cfpkg))) { prop_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver); + xbps_dbg_printf(xhp, "found conflicting installed " + "pkg %s with pkg in transaction %s\n", pkgver, + repopkgver); buf = xbps_xasprintf("%s conflicts with " "installed pkg %s", repopkgver, pkgver); prop_array_add_cstring(trans_cflicts, buf); @@ -74,6 +79,8 @@ xbps_pkg_find_conflicts(struct xbps_handle *xhp, (pkgd = xbps_find_virtualpkg_in_array(xhp, unsorted, cfpkg))) { prop_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver); + xbps_dbg_printf(xhp, "found conflicting pkgs in " + "transaction %s <-> %s\n", pkgver, repopkgver); buf = xbps_xasprintf("%s conflicts with " "%s in transaction", repopkgver, pkgver); prop_array_add_cstring(trans_cflicts, buf);