You are not logged in.
While the existing documentation on pacman/alpm-hooks is fairly detailed, there are some points that appear to be vague, or left out. In no particular order, these are my questions about them:
can the Exec command determine which Target triggered the hook?
I've seen a reference suggesting %f and %p for files and packages, though I don't know if this is documented or valid.
can the Exec command determine a Target package version?
This may either be through a variable, or e.g. running pacman %p to get the version.
which directories can be used for hooks, and which are preferable to use?
The wiki references both /usr/share/libalpm/hooks/ and /etc/pacman.d/hooks, the latter defaulted by pacman.conf
does the HookDir option in pacman.conf need to exist only when adding additional hook directories?
The wiki is not clear on this, however my current config file has no reference to hooks.
As always, any answers are most appreciated.
Offline
Offline
The man page does not answer these questions, which is why I asked them here.
Offline
[*]can the Exec command determine which Target triggered the hook?
I've seen a reference suggesting %f and %p for files and packages, though I don't know if this is documented or valid.[/*]
man alpm-hooks. Look at NeedsTarget
[*]can the Exec command determine a Target package version?
This may either be through a variable, or e.g. running pacman %p to get the version.[/*]
No version information passed to the hook. You can use pacman -Qq in your hook
[*]which directories can be used for hooks, and which are preferable to use?
The wiki references both /usr/share/libalpm/hooks/ and /etc/pacman.d/hooks, the latter defaulted by pacman.conf[/*]
See HookDir in "man pacman.conf". /usr/share/ is for system managed hooks. /etc/ for user overrides.
[*]does the HookDir option in pacman.conf need to exist only when adding additional hook directories?
The wiki is not clear on this, however my current config file has no reference to hooks.[/*]
See HookDir in "man pacman.conf".
Offline
Ah thank you. I misunderstood the purpose of NeedsTarget. I take it that would be used combined with read in order to obtain the target?
I'd also assume then that should a package add a hook as part of its installation, it would be added to /usr/share/libalpm/hooks/.
Offline
Yes and yes. Look at the existing hooks in /usr/share/libalpm/{hooks,scripts} to see how others have handled it. e.g. gtk-update-icon-cache
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline