You are not logged in.

#1 2025-02-22 16:49:02

Krasauskas
Member
Registered: 2019-02-19
Posts: 3

Variables within a pacman hook

Is there a way to have transaction dependent variables?

I currently have the following hook:

[Trigger]
Operation = Upgrade
Type = Package
Target = postfix

[Action]
Description = Restart postfix after upgrade
When = PostTransaction
Exec = /usr/bin/systemctl restart postfix
Depends = postfix

I'd like to add more related packages to the same hook; something like this:

[Trigger]
Operation = Upgrade
Type = Package
Target = postfix
Target = opendkim
Target = opendkim-ed25519
Target = opendmarc
Target = spamassassin
Target = dovecot
Target = postfwd

[Action]
Description = Restart email-related services after upgrade
When = PostTransaction
Exec = /usr/bin/systemctl restart $specific-package-that-got-upgraded
Depends = postfix opendkim opendmarc spamassassin dovecot postfwd

man 5 alpm-hooks

does not seem to say anything like this is possible, but thought I'd ask here anyway.

Offline

#2 2025-02-23 06:25:45

mpan
Member
Registered: 2012-08-01
Posts: 1,409
Website

Re: Variables within a pacman hook

How about the `NeedsTargets` option?


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

Board footer

Powered by FluxBB