apk does not stop if pre-upgrade script fails
Testing on fully updated edge box with apk-tools-2.6.7-r2 by running ‘apk fix -r test’ where the test.pre-upgrade fails. I see the following output:
- apk fix -r test
(1/1) Reinstalling test (0.1-r1)
Executing test-0.1-r1.pre-upgrade
ERROR: test-0.1-r1.pre-upgrade: script exited with error 1
Executing test-0.1-r1.post-upgrade
1 errors; 522 MiB in 136 packages
The files are still installed and, as can be seen, the post-upgrade script is still run. The documentation at https://wiki.alpinelinux.org/wiki/Creating\_an\_Alpine\_package indicates that pre-upgrade is similar to pre-install in that exiting with failure will cause apk to exit with failure.
(from redmine: issue id 6369, created on 2016-10-19, closed on 2016-10-24)