1DNF-POST-TRANSACTION-ACTIONS(8)dnf-plugins-coreDNF-POST-TRANSACTION-ACTIONS(8)
2
3
4

NAME

6       dnf-post-transaction-actions - DNF post transaction actions Plugin
7

DESCRIPTION

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

CONFIGURATION

15       The plugin configuration  is  in  /etc/dnf/plugins/post-transaction-ac‐
16       tions.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

ACTION FILE FORMAT

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 applied 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
38in - packages that appeared on the system (downgrade, install,
39                obsolete, reinstall, upgrade)
40
41out  -  packages that disappeared from the system (downgraded,
42                obsoleted, remove, upgraded)
43
44any - 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  re‐
73              moved  and  each command will only be executed once per transac‐
74              tion. The order of execution of the commands follows  the  order
75              in  the  action files, but may differ from the order of packages
76              in the transaction.  In other words, when you define several ac‐
77              tion  lines for the same package_filter these lines will be exe‐
78              cuted in the order they were defined in the action file when the
79              package_filter  matches  a  package  during the trasaction_state
80              state.  However, the order of when a  particular  package_filter
81              is  invoked depends on the position of the corresponding package
82              in the transaction.
83
84   An example action file:
85          # log all packages (state, nevra, repo) in transaction into a file.
86          *:any:echo '${state} ${name}-${epoch}:${ver}-${rel}.${arch} repo ${repoid}' >>/tmp/post-trans-actions-trans.log
87
88          # The same shell command (after variables substitution) is executed only once per transaction.
89          *:any:echo '${repoid}' >>/tmp/post-trans-actions-repos
90          # will write each repo only once to /tmp/post-trans-actions-repos, even if multiple packages from
91          # the same repo were matched
92

AUTHOR

94       See AUTHORS in your Core DNF Plugins distribution
95
97       2023, Red Hat, Licensed under GPLv2+
98
99
100
101
1024.4.3                            Oct 06, 2023  DNF-POST-TRANSACTION-ACTIONS(8)
Impressum