From 4e38be11f41a08a611764c039a7e311248a0592a Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 29 Nov 2009 05:51:49 +0100 Subject: [PATCH] xbps-bin: fix assertion with pkgs containing the "replaces" obj. --HG-- extra : convert_revision : xtraeme%40gmail.com-20091129045149-l8zvcbo1w1jzglai --- bin/xbps-bin/install.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/xbps-bin/install.c b/bin/xbps-bin/install.c index a83a2a87..2be56e9f 100644 --- a/bin/xbps-bin/install.c +++ b/bin/xbps-bin/install.c @@ -393,6 +393,9 @@ xbps_exec_transaction(const char *pkgname, bool force, bool update) show_missing_deps(trans->dict, pkgname); goto out2; } + + DPRINTF(("%s", prop_dictionary_externalize(trans->dict))); + if (update) { /* * Sort the package transaction dictionary. @@ -436,7 +439,7 @@ replace_packages(prop_object_iterator_t iter, const char *pkgver) { prop_dictionary_t instd; prop_object_t obj; - const char *reppkgn; + const char *reppkgn, *version; int rv = 0; /* @@ -454,7 +457,8 @@ replace_packages(prop_object_iterator_t iter, const char *pkgver) printf("Replacing package '%s' with '%s' ...\n", reppkgn, pkgver); - if ((rv = xbps_remove_pkg(reppkgn, NULL, false)) != 0) { + version = xbps_get_pkg_version(pkgver); + if ((rv = xbps_remove_pkg(reppkgn, version, false)) != 0) { printf("Couldn't remove %s (%s)\n", reppkgn, strerror(rv)); return rv;