lib: run pre-remove and pre-install scripts before unpacking

This commit is contained in:
Duncan Overbruck
2021-06-24 17:33:26 +02:00
parent c94648630c
commit 02367e3c00
4 changed files with 57 additions and 23 deletions

View File

@ -153,18 +153,7 @@ xbps_remove_pkg(struct xbps_handle *xhp, const char *pkgver, bool update)
/* If package was "half-removed", remove it fully. */
if (state == XBPS_PKG_STATE_HALF_REMOVED)
goto purge;
/*
* Run the pre remove action and show pre-remove message if exists.
*/
rv = xbps_pkg_exec_script(xhp, pkgd, "remove-script", "pre", update);
if (rv != 0) {
xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_FAIL,
errno, pkgver,
"%s: [remove] REMOVE script failed to "
"execute pre ACTION: %s",
pkgver, strerror(rv));
goto out;
}
/* show remove-msg if exists */
if ((rv = xbps_cb_message(xhp, pkgd, "remove-msg")) != 0)
goto out;