FS#9321 - package removal should fail when pre_remove fails
Attached to Project:
Pacman
Opened by Antoine Martin (antoinemartin) - Wednesday, 23 January 2008, 20:55 GMT
Last edited by Allan McRae (Allan) - Sunday, 31 January 2016, 04:55 GMT
Opened by Antoine Martin (antoinemartin) - Wednesday, 23 January 2008, 20:55 GMT
Last edited by Allan McRae (Allan) - Sunday, 31 January 2016, 04:55 GMT
|
Details
Summary and Info:
package removal should fail when pre_remove in install file fails Steps to Reproduce: Within a package with an install file, make the pre_remove method fail (return a value other than 0). The package removal continues. IMHO, the package removal should stop at this point. In lib/libalpm/remove.c line 289, some action should be taken if the call to _alpm_runscriptlet returns something different from 0. Thank you in advance. |
This task depends upon
Closed by Allan McRae (Allan)
Sunday, 31 January 2016, 04:55 GMT
Reason for closing: Implemented
Additional comments about closing: Use a PreTransaction hook
Sunday, 31 January 2016, 04:55 GMT
Reason for closing: Implemented
Additional comments about closing: Use a PreTransaction hook
Fortunately, we sort the packages by deps (so the packages will be removed _before_ its dependencies), but in case of dependency cycle this still can cause problems (database inconsistency) until we have no transaction-rollback implemented.
And the same true for pressing ctrl-c in the middle of a transaction, I suggest not to do that (that is more dangerous, it blindly trust in our "event" handling)
failing on pre_remove returning 0 seems better to me than Ctrl-C.
Basically, I like the idea, I also suggested doing this here: http://www.archlinux.org/pipermail/pacman-dev/2007-August/009127.html
IMHO this is quite easy to implement now, but in my head this depends on FS#8585 (and an other good reasoning for that).
But if you can convince us why implementing this is less dangerous than the current situation, we may give it a try ;-)
1) Run the pre_remove of all packages that are marked for removal before actually remove any package and fail if one of them fails. This is what happens for files already present in the filesystem before installation.
2) Emit a warning to the user and ask him what to do : 1) remove anyway 2) don't remove 3) abort transaction ( (1) being default for --noconfirm)