FS#17886 - Pacman's pre_upgrade/install scripts does not stop 'upgrading/installing' after an error
Attached to Project:
Pacman
Opened by Anton Prins (aprins) - Monday, 18 January 2010, 08:25 GMT
Last edited by Allan McRae (Allan) - Sunday, 31 January 2016, 04:29 GMT
Opened by Anton Prins (aprins) - Monday, 18 January 2010, 08:25 GMT
Last edited by Allan McRae (Allan) - Sunday, 31 January 2016, 04:29 GMT
|
Details
Description:
Pacman's pre_upgrade/install scripts does not stop 'upgrading/installing' after an error. With a return value <> 0, you can trigger an error message, but pacman just goes further... I would like to have a 'freespace' check in my pre_upgrade scriptlet and if not enough space, pacman must stop. Additional info: * package version(s) 3.2.2 i'm currently using, but saw code in version 3.3.3 does the same thing. * config and/or log files etc. Steps to reproduce: have in a PKGBUILD the section; pre_upgrade() { return 1 } |
This task depends upon
Closed by Allan McRae (Allan)
Sunday, 31 January 2016, 04:29 GMT
Reason for closing: Implemented
Additional comments about closing: Can be handled with a PreTransaction hook.
Sunday, 31 January 2016, 04:29 GMT
Reason for closing: Implemented
Additional comments about closing: Can be handled with a PreTransaction hook.
FS#9321Correct, its about the same, the scriptlet function return value as in
FS#9321Further Allan, sure it could be strange te stop in the middle, but what i mention is not 'in the middle'.
its in the pre_xxxx functions... so if my own scripts detects a problem i want to abort pacman's upgrade.
(before pacman overwrites binaries)...
But i have seen file-conflicts could also 'abort' installations (of the current package).
I just wonder how we can handle this without problems!
FS#9321:"Fortunately, we sort the packages by deps..."
So broken dependencies should not be an issue (unless we have a dependency cycle), but partial upgrade is not recommended in general.
e.g. libarchive has a soname bump, so pacman is rebuilt against it. Update your system, libarchive gets installed then some install script returns non-zero and pacman aborts before it is upgraded. Now pacman is broken...
Here is an idea: Whenever pacman detects that a transaction cannot be reduced to a sequence of single-package transactions, it creates an aufs sandbox, installs everything in the transaction into the sandbox, and then merges the sandbox into the root filesystem if nothing failed. If anything failed, then the sandbox is discarded and the system remains unchanged.
In normal situations, the aufs sandbox step would be unnecessary, so there would be no significant performance degradation. Just for special cases like the libarchive/pacman example above the aufs sandbox would be used.