Is it possible to add hooks for AUR packages when using pamac to install/upgrade them? I’d like to add hooks on upgrade of certain packages - some of them coming from official repositories (so I’ve added pacman hooks) and some of them coming from AUR.
I primarily use pamac cli to do major upgrades and GUI when there are less than 10 packages to upgrade as using it allows me to use a single place to upgrade both from official repos and from AUR.
Questions:
When a package (coming from the official repos i.e. pacman can find it) is upgraded using pamac and has a hook for it listed in /etc/pacman.d/hooks/ does it get triggered?
I’ve enabled pamac to install (and Update) from AUR. Is it possible to add a hook for these packages?
@linux-aarhus & @Mirdarthos Thank you for the hint and links. I did read through the man page alpm-hooks.5 before posting the question.
The interesting part for me was this:
Hooks are read from files located in the system hook directory /usr/share/libalpm/hooks, and additional custom directories specified in pacman.conf(5) (the default is /etc/pacman.d/hooks). The file names are required to have the suffix “.hook”. Hooks are run in alphabetical order of their file name, where the ordering ignores the suffix.
I was under the impression that since hooks are placed in a directory called pacman.d/hooks they were applicable only when pacman is used, rather than thinking about them as alpm-hooks. But now thinking through this and the fact that both pacman and pamac are based on libalpm and /etc/pacman.d/hooks is an alpm hook directory rather than pacman exclusive, it makes sense.
@robin0800 : I think your answer is about forcing an AUR update through pamac and not related to hooks in general. But I may be mistaken.