From 97fcd43bbe018557305505926ac1a8f07d3135e3 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 23 Jun 2011 11:46:15 +0200 Subject: [PATCH] xbps-bin: also purge pkgs that shall be replaced. --- bin/xbps-bin/install.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/xbps-bin/install.c b/bin/xbps-bin/install.c index b1b2c57a..86b171d7 100644 --- a/bin/xbps-bin/install.c +++ b/bin/xbps-bin/install.c @@ -439,13 +439,18 @@ exec_transaction(struct transaction *trans) prop_dictionary_get_bool(obj, "remove-and-update", &update); - /* Remove a package */ + /* Remove and purge packages that shall be replaced */ printf("Removing `%s' package ...\n", pkgver); rv = xbps_remove_pkg(pkgname, version, update); if (rv != 0) { xbps_error_printf("xbps-bin: failed to " - "remove `%s': %s\n", pkgver, - strerror(rv)); + "remove `%s': %s\n", pkgver, strerror(rv)); + return rv; + } + printf("Purging `%s' package...\n", pkgver); + if ((rv = xbps_purge_pkg(pkgname, false)) != 0) { + xbps_error_printf("xbps-bin: failed to " + "purge `%s': %s\n", pkgver, strerror(rv)); return rv; } }