xbps-bin: also purge pkgs that shall be replaced.

This commit is contained in:
Juan RP 2011-06-23 11:46:15 +02:00
parent a1100fd00d
commit 97fcd43bbe

View File

@ -439,13 +439,18 @@ exec_transaction(struct transaction *trans)
prop_dictionary_get_bool(obj, "remove-and-update", prop_dictionary_get_bool(obj, "remove-and-update",
&update); &update);
/* Remove a package */ /* Remove and purge packages that shall be replaced */
printf("Removing `%s' package ...\n", pkgver); printf("Removing `%s' package ...\n", pkgver);
rv = xbps_remove_pkg(pkgname, version, update); rv = xbps_remove_pkg(pkgname, version, update);
if (rv != 0) { if (rv != 0) {
xbps_error_printf("xbps-bin: failed to " xbps_error_printf("xbps-bin: failed to "
"remove `%s': %s\n", pkgver, "remove `%s': %s\n", pkgver, strerror(rv));
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; return rv;
} }
} }