Fix package conflicts detection (regression from b9136c61c9).

This commit is contained in:
Juan RP 2013-02-01 12:41:27 +01:00
parent 303df5fc46
commit 42e0f19bbe
2 changed files with 11 additions and 1 deletions

3
NEWS
View File

@ -1,5 +1,8 @@
xbps-0.21 (???): 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 * xbps-install(8): removed the -s,--skip-sync option; the new -S,--sync
option makes this redundant and useless. option makes this redundant and useless.

View File

@ -50,10 +50,12 @@ xbps_pkg_find_conflicts(struct xbps_handle *xhp,
trans_cflicts = prop_dictionary_get(xhp->transd, "conflicts"); trans_cflicts = prop_dictionary_get(xhp->transd, "conflicts");
prop_dictionary_get_cstring_nocopy(pkg_repod, "pkgver", &repopkgver); prop_dictionary_get_cstring_nocopy(pkg_repod, "pkgver", &repopkgver);
iter = prop_array_iterator(trans_cflicts); iter = prop_array_iterator(pkg_cflicts);
assert(iter); assert(iter);
while ((obj = prop_object_iterator_next(iter))) { while ((obj = prop_object_iterator_next(iter))) {
cfpkg = prop_string_cstring_nocopy(obj); cfpkg = prop_string_cstring_nocopy(obj);
/* /*
* Check if current pkg conflicts with an installed package. * 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))) { (pkgd = xbps_pkgdb_get_virtualpkg(xhp, cfpkg))) {
prop_dictionary_get_cstring_nocopy(pkgd, prop_dictionary_get_cstring_nocopy(pkgd,
"pkgver", &pkgver); "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 " buf = xbps_xasprintf("%s conflicts with "
"installed pkg %s", repopkgver, pkgver); "installed pkg %s", repopkgver, pkgver);
prop_array_add_cstring(trans_cflicts, buf); 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))) { (pkgd = xbps_find_virtualpkg_in_array(xhp, unsorted, cfpkg))) {
prop_dictionary_get_cstring_nocopy(pkgd, prop_dictionary_get_cstring_nocopy(pkgd,
"pkgver", &pkgver); "pkgver", &pkgver);
xbps_dbg_printf(xhp, "found conflicting pkgs in "
"transaction %s <-> %s\n", pkgver, repopkgver);
buf = xbps_xasprintf("%s conflicts with " buf = xbps_xasprintf("%s conflicts with "
"%s in transaction", repopkgver, pkgver); "%s in transaction", repopkgver, pkgver);
prop_array_add_cstring(trans_cflicts, buf); prop_array_add_cstring(trans_cflicts, buf);