lib: run all post/purge-remove scripts at the end of the transaction

This commit is contained in:
Duncan Overbruck
2021-06-24 19:27:23 +02:00
parent 02367e3c00
commit 1f99a099e8
2 changed files with 109 additions and 26 deletions

View File

@ -192,18 +192,6 @@ xbps_remove_pkg(struct xbps_handle *xhp, const char *pkgver, bool update)
goto out;
}
/*
* Execute the post REMOVE action if file exists and we aren't
* updating the package.
*/
rv = xbps_pkg_exec_script(xhp, pkgd, "remove-script", "post", false);
if (rv != 0) {
xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_FAIL,
rv, pkgver,
"%s: [remove] REMOVE script failed to execute "
"post ACTION: %s", pkgver, strerror(rv));
goto out;
}
/*
* Set package state to "half-removed".
*/
@ -216,19 +204,9 @@ xbps_remove_pkg(struct xbps_handle *xhp, const char *pkgver, bool update)
pkgver, strerror(rv));
goto out;
}
/* XXX: setting the state and then removing the package seems useless. */
purge:
/*
* Execute the purge REMOVE action if file exists.
*/
rv = xbps_pkg_exec_script(xhp, pkgd, "remove-script", "purge", false);
if (rv != 0) {
xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_FAIL,
rv, pkgver,
"%s: REMOVE script failed to execute "
"purge ACTION: %s", pkgver, strerror(rv));
goto out;
}
/*
* Remove package metadata plist.
*/