1DNF-POST-TRANSACTION-ACTIONS(8)dnf-plugins-coreDNF-POST-TRANSACTION-ACTIONS(8)
2
3
4
6 dnf-post-transaction-actions - DNF post transaction actions Plugin
7
9 The plugin allows to define actions to be executed upon completing an
10 RPM transaction. Each action may define a (glob-like) filtering rule on
11 the package NEVRA or package files, as well as whether the package was
12 installed or removed. Actions are defined in action files.
13
15 The plugin configuration is in /etc/dnf/plugins/post-transac‐
16 tion-actions.conf. All configuration options are in the [main] section.
17
18 enabled
19 Whether the plugin is enabled. Default value is True.
20
21 actiondir
22 Path to the directory with action files. Action files must have
23 the ".action" extension. Default value is "/etc/dnf/plug‐
24 ins/post-transaction-actions.d/".
25
27 Empty lines and lines that start with a '#' character are ignored.
28 Each non-comment line defines an action and consists of three items
29 separated by colons: package_filter:transaction_state:command.
30
31 package_filter
32 A (glob-like) filtering rule aplied on the package NEVRA (also
33 in the shortened forms) or package files.
34
35 transaction_state
36 Filters packages according to their state in the transaction.
37
38 · in - packages that appeared on the system (downgrade, install,
39 obsolete, reinstall, upgrade)
40
41 · out - packages that disappeared from the system (downgraded,
42 obsoleted, remove, upgraded)
43
44 · any - all packages
45
46 command
47 Any shell command. The following variables in the command will
48 be substituted:
49
50 · ${name}, $name - package name
51
52 · ${arch}, $arch - package arch
53
54 · ${ver}, $ver - package version
55
56 · ${rel}, $rel - package release
57
58 · ${epoch}, $epoch - package epoch
59
60 · ${repoid}, $repoid - package repository id
61
62 ·
63
64 ${state}, $state - the change of package state in the
65 transaction:
66 "downgrade", "downgraded", "install", "obsolete",
67 "obsoleted", "reinstall", "reinstalled", "remove",
68 "upgrade", "upgraded"
69
70 The shell command will be evaluated for each package that
71 matched the package_filter and the transaction_state. However,
72 after variable substitution, any duplicate commands will be
73 removed and each command will only be executed once per transac‐
74 tion. The order of execution of the commands may differ from the
75 order of packages in the transaction.
76
77 An example action file:
78 # log all packages (state, nevra, repo) in transaction into a file.
79 *:any:echo '${state} ${name}-${epoch}:${ver}-${rel}.${arch} repo ${repoid}' >>/tmp/post-trans-actions-trans.log
80
81 # The same shell command (after variables substitution) is executed only once per transaction.
82 *:any:echo '${repoid}' >>/tmp/post-trans-actions-repos
83 # will write each repo only once to /tmp/post-trans-actions-repos, even if multiple packages from
84 # the same repo were matched
85
87 See AUTHORS in your Core DNF Plugins distribution
88
90 2020, Red Hat, Licensed under GPLv2+
91
92
93
94
954.0.15 Apr 08, 2020 DNF-POST-TRANSACTION-ACTIONS(8)