Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#69929 - Support specifiers for alpm-hooks for exec action

Attached to Project: Pacman
Opened by Edward Shen (xes) - Wednesday, 10 March 2021, 01:58 GMT
Last edited by Eli Schwartz (eschwartz) - Monday, 05 April 2021, 23:23 GMT
Task Type Feature Request
Category General
Status Closed
Assigned To No-one
Architecture All
Severity Very Low
Priority Normal
Reported Version 5.2.2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:

Hi folks. I'm looking to have support for a limited set of specifiers for an alpm-hook in the Exec section of an action. Specifically, I'm looking for a way to access metadata about the trigger itself so I can provide this information to a separate command. I'm thinking of something like:

%p => What triggered the hook (e.g. path or package name)
%o => What type of operation was used for the trigger.

a la systemd specifiers.

My specific use case was to log what packages I've installed for dotfile management. This would greatly help with this, as otherwise as far as I can tell this would require diffing all installed packages with some older list of packages.

I think there's other reasonable use cases as well, such as logging package modification/deletion(/addition) time for system auditing or debugging.

(Thank you for the time and effort for working on pacman. I really appreciate the love put into it!)
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Monday, 05 April 2021, 23:23 GMT
Reason for closing:  Works for me
Additional comments about closing:  See first comment.
Comment by Eli Schwartz (eschwartz) - Wednesday, 10 March 2021, 02:07 GMT
%p is already there, it's called NeedsTargets.

%o is just passing "Install", "Upgrade", or "Remove", yes? You could solve this by creating 3 hooks, one for each, with different Exec lines.
Comment by Eli Schwartz (eschwartz) - Wednesday, 10 March 2021, 02:08 GMT
See also FS#58900
Comment by Edward Shen (xes) - Wednesday, 10 March 2021, 02:11 GMT
Ah, you're right on both accounts. Looks like I missed NeedsTargets and didn't considering multiple hooks. Looks like this can be closed then. Sorry for the noise!
Comment by Eli Schwartz (eschwartz) - Wednesday, 10 March 2021, 02:13 GMT
Being able to do it in one hook could be considered more elegant, but probably falls under the domain of the linked ticket.

Loading...