Anyway, glad you were able to figure it out - no hard feelings, have a nice day.
You too! Honestly, I wouldn't have worked it out without your help, so I'm sincerely sorry if it came across the wrong way. Thank you again.
]]>Anyway, glad you were able to figure it out - no hard feelings, have a nice day.
]]>You prepended 'sudo (bash -c)' to the command from the hook when testing it - the command actually doesn't need root on a regular arch system (also see the upstream link you posted). To be clear, this is the exec array from the hook:
/usr/bin/vim -es --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q"
which is not the same as
sudo bash -c '/usr/bin/vim -es --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q"'
that you claim is the command from the hook...
My understanding (and again I could be wrong) is that pacman hooks are essentially run as a root user. Hence, if I were to run the first command as a non-root user it would be different from running is from the hook. Which is indeed what I saw with it causing permission errors.
Anyway apologies again if I have offended. Thank you again for your help.
]]>You prepended 'sudo (bash -c)' to the command from the hook when testing it - the command actually doesn't need root on a regular arch system (also see the upstream link you posted). To be clear, this is the exec array from the hook:
/usr/bin/vim -es --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q"
which is not the same as
sudo bash -c '/usr/bin/vim -es --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q"'
that you claim is the command from the hook...
Anyway. it doesn't matter since 'vim-diffchar' is an aur package (hence not part of a regular arch system)...
]]>I'm asking because you said you tested the hook manually issuing
sudo bash -c '/usr/bin/vim -es --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q"'
Yes, that's correct. That's the same command as in the hook.
EDIT: The above command should open an interactive vim instance, and '--cmd ":q" would be skipped,
No, that command does not open up an interactive vim session. Firstly it's silent because of the -s part, but then the :q part quits vim anyway. I can run it manually and confirm that it quits, i.e.
$ sudo vim -es
:helptags /usr/share/vim/vimfiles/doc
:q
$
hence the error message (when run from a pacman hook, since pacman doesn't get an exit 0 from it)...
Ahhh! Yes, this is correct. I'm quite sure my sudo bash -c code is fine, but I do indeed get a non-zero code after running it.
Maybe the presumably modified old '/usr/share/libalpm/hooks/vimdoc.hook'
It was not modified on my system and never was.
was still cached during the session where you reinstalled 'vim-runtime' and tried to install 'vim-ctrlp'
I don't think this makes sense. Hooks are not cached.
(EDIT#2: 'sudo' alone would already have caused the hook to fail, anyway...) - do you still get the error after a logout/reboot?
This doesn't seem to make sense either. I need to run vim with root permissions, otherwise I can't run the command. For example, if I try and run the command with a non-root user.
E152: Cannot open /usr/share/vim/vimfiles/doc/tags for writing
However, you've put me onto the right path with the non-zero exit code. After more investigation, I think I've worked out the issue. Firstly, if I run the vim instance without the silent -s option it is more informative, i.e. sudo vim-e. I then run :helptags /usr/share/vim/vimfiles/doc, and can see the following issue.
::helptags /usr/share/vim/vimfiles/doc
E154: Duplicate tag "lazy" in file /usr/share/vim/vimfiles/doc/diffchar.txt
E154: Duplicate tag "quick" in file /usr/share/vim/vimfiles/doc/diffchar.txt
Looks like it's a bug with the vim-diffchar package, which has now been fixed upstream.
Thanks again for putting me on the right direction.
]]>Exec = /usr/bin/vim -es --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q"
...
EDIT: The above command should open an interactive vim instance, and '--cmd ":q" would be skipped, hence the error message (when run from a pacman hook, since pacman doesn't get an exit 0 from it)... Maybe the presumably modified old '/usr/share/libalpm/hooks/vimdoc.hook' was still cached during the session where you reinstalled 'vim-runtime' and tried to install 'vim-ctrlp' (EDIT#2: 'sudo' alone would already have caused the hook to fail, anyway...) - do you still get the error after a logout/reboot?
]]>Please post the contents of '/usr/share/libalpm/hooks/vimdoc.hook'
It's totally unmodified. It's identical to upstream.
]]>cat /usr/share/libalpm/hooks/vimdoc.hook
# pacman -Syu vim-runtime
$ sudo pacman --debug -S --asdeps vim-ctrlp
...
:: Running post-transaction hooks...
...
(2/2) Updating Vim help tags...
debug: executing "/usr/bin/vim" under chroot "/"
debug: call to waitpid succeeded
error: command failed to execute correctly
debug: unregistering database 'local'
debug: freeing package cache for repository 'local'
debug: unregistering database 'core'
debug: freeing package cache for repository 'core'
debug: unregistering database 'extra'
debug: freeing package cache for repository 'extra'
debug: unregistering database 'community'
debug: freeing package cache for repository 'community'
debug: unregistering database 'multilib'
$