fzf-vim: post-install fails if vim not already installed
While doing a "perfectly normal" thing to do with Alpine, I saw this:
(4760/19499) Installing fzf-vim (0.38.0-r1)
Executing fzf-vim-0.38.0-r1.post-install
lib/apk/exec/fzf-vim-0.38.0-r1.post-install: 2: vim: not found
ERROR: fzf-vim-0.38.0-r1.post-install: script exited with error 127
The root cause seems to be that fzf-vim does not list a dependency on vim, despite needing it in the post-install script. post-install running correctly depends entirely on whether vim was already installed.
This can lead to the following error:
vimless:~# apk add fzf-vim vim
(1/4) Installing fzf-vim (0.38.0-r1)
Executing fzf-vim-0.38.0-r1.post-install
lib/apk/exec/fzf-vim-0.38.0-r1.post-install: line 2: vim: not found
ERROR: fzf-vim-0.38.0-r1.post-install: script exited with error 127
(2/4) Installing vim-common (9.0.1413-r0)
(3/4) Installing xxd (9.0.1413-r0)
(4/4) Installing vim (9.0.1413-r0)
Executing busybox-1.36.0-r5.trigger
1 error; 93 MiB in 68 packages
This failure does not occur if vim
was already installed.
vigor:~# apk add vim
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
(1/3) Installing vim-common (9.0.1413-r0)
(2/3) Installing xxd (9.0.1413-r0)
(3/3) Installing vim (9.0.1413-r0)
Executing busybox-1.36.0-r5.trigger
OK: 90 MiB in 62 packages
vigor:~# apk add fzf-vim
(1/1) Installing fzf-vim (0.38.0-r1)
Executing fzf-vim-0.38.0-r1.post-install
OK: 90 MiB in 63 packages