| 1 |
.\" Man page generated from reStructuredText. |
| 2 |
. |
| 3 |
. |
| 4 |
.nr rst2man-indent-level 0 |
| 5 |
. |
| 6 |
.de1 rstReportMargin |
| 7 |
\\$1 \\n[an-margin] |
| 8 |
level \\n[rst2man-indent-level] |
| 9 |
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 10 |
- |
| 11 |
\\n[rst2man-indent0] |
| 12 |
\\n[rst2man-indent1] |
| 13 |
\\n[rst2man-indent2] |
| 14 |
.. |
| 15 |
.de1 INDENT |
| 16 |
.\" .rstReportMargin pre: |
| 17 |
. RS \\$1 |
| 18 |
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] |
| 19 |
. nr rst2man-indent-level +1 |
| 20 |
.\" .rstReportMargin post: |
| 21 |
.. |
| 22 |
.de UNINDENT |
| 23 |
. RE |
| 24 |
.\" indent \\n[an-margin] |
| 25 |
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 26 |
.nr rst2man-indent-level -1 |
| 27 |
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 28 |
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u |
| 29 |
.. |
| 30 |
.TH "DNF4-POST-TRANSACTION-ACTIONS" "8" "Sep 27, 2025" "4.10.1" "dnf-plugins-core" |
| 31 |
.SH NAME |
| 32 |
dnf4-post-transaction-actions \- DNF post transaction actions Plugin |
| 33 |
.SH DESCRIPTION |
| 34 |
.sp |
| 35 |
The plugin allows to define actions to be executed upon completing an RPM transaction. Each action |
| 36 |
may define a (glob\-like) filtering rule on the package NEVRA or package files, as well as whether |
| 37 |
the package was installed or removed. Actions are defined in action files. |
| 38 |
.SH CONFIGURATION |
| 39 |
.sp |
| 40 |
The plugin configuration is in \fB/etc/dnf/plugins/post\-transaction\-actions.conf\fP\&. All configuration |
| 41 |
options are in the \fB[main]\fP section. |
| 42 |
.INDENT 0.0 |
| 43 |
.TP |
| 44 |
.B \fBenabled\fP |
| 45 |
Whether the plugin is enabled. Default value is \fBTrue\fP\&. |
| 46 |
.TP |
| 47 |
.B \fBactiondir\fP |
| 48 |
Path to the directory with action files. Action files must have the “.action” extension. |
| 49 |
Default value is “/etc/dnf/plugins/post\-transaction\-actions.d/”. |
| 50 |
.UNINDENT |
| 51 |
.SH ACTION FILE FORMAT |
| 52 |
.sp |
| 53 |
Empty lines and lines that start with a ‘#’ character are ignored. |
| 54 |
Each non\-comment line defines an action and consists of three items separated by colons: |
| 55 |
\fBpackage_filter:transaction_state:command\fP\&. |
| 56 |
.INDENT 0.0 |
| 57 |
.TP |
| 58 |
.B \fBpackage_filter\fP |
| 59 |
A (glob\-like) filtering rule applied on the package NEVRA (also in the shortened forms) or |
| 60 |
package files. |
| 61 |
.TP |
| 62 |
.B \fBtransaction_state\fP |
| 63 |
Filters packages according to their state in the transaction. |
| 64 |
.INDENT 7.0 |
| 65 |
.IP \(bu 2 |
| 66 |
\fBin\fP \- packages that appeared on the system (downgrade, install, obsolete, reinstall, upgrade) |
| 67 |
.IP \(bu 2 |
| 68 |
\fBout\fP \- packages that disappeared from the system (downgraded, obsoleted, remove, upgraded) |
| 69 |
.IP \(bu 2 |
| 70 |
\fBany\fP \- all packages |
| 71 |
.UNINDENT |
| 72 |
.TP |
| 73 |
.B \fBcommand\fP |
| 74 |
Any shell command. |
| 75 |
The following variables in the command will be substituted: |
| 76 |
.INDENT 7.0 |
| 77 |
.INDENT 3.5 |
| 78 |
.INDENT 0.0 |
| 79 |
.IP \(bu 2 |
| 80 |
\fB${name}\fP, \fB$name\fP \- package name |
| 81 |
.IP \(bu 2 |
| 82 |
\fB${arch}\fP, \fB$arch\fP \- package arch |
| 83 |
.IP \(bu 2 |
| 84 |
\fB${ver}\fP, \fB$ver\fP \- package version |
| 85 |
.IP \(bu 2 |
| 86 |
\fB${rel}\fP, \fB$rel\fP \- package release |
| 87 |
.IP \(bu 2 |
| 88 |
\fB${epoch}\fP, \fB$epoch\fP \- package epoch |
| 89 |
.IP \(bu 2 |
| 90 |
\fB${repoid}\fP, \fB$repoid\fP \- package repository id |
| 91 |
.IP \(bu 2 |
| 92 |
.INDENT 2.0 |
| 93 |
.TP |
| 94 |
.B \fB${state}\fP, \fB$state\fP \- the change of package state in the transaction: |
| 95 |
“downgrade”, “downgraded”, “install”, “obsolete”, “obsoleted”, “reinstall”, |
| 96 |
“reinstalled”, “remove”, “upgrade”, “upgraded” |
| 97 |
.UNINDENT |
| 98 |
.UNINDENT |
| 99 |
.UNINDENT |
| 100 |
.UNINDENT |
| 101 |
.sp |
| 102 |
The shell command will be evaluated for each package that matched the \fBpackage_filter\fP and |
| 103 |
the \fBtransaction_state\fP\&. However, after variable substitution, any duplicate commands will be |
| 104 |
removed and each command will only be executed once per transaction. The order of execution |
| 105 |
of the commands follows the order in the action files, but may differ from the order of |
| 106 |
packages in the transaction. In other words, when you define several action lines for the |
| 107 |
same \fBpackage_filter\fP these lines will be executed in the order they were defined in the |
| 108 |
action file when the \fBpackage_filter\fP matches a package during the \fBtrasaction_state\fP state. |
| 109 |
However, the order of when a particular \fBpackage_filter\fP is invoked depends on the position |
| 110 |
of the corresponding package in the transaction. |
| 111 |
.UNINDENT |
| 112 |
.SS An example action file: |
| 113 |
.INDENT 0.0 |
| 114 |
.INDENT 3.5 |
| 115 |
.sp |
| 116 |
.EX |
| 117 |
# log all packages (state, nevra, repo) in transaction into a file. |
| 118 |
*:any:echo \(aq${state} ${name}\-${epoch}:${ver}\-${rel}.${arch} repo ${repoid}\(aq >>/tmp/post\-trans\-actions\-trans.log |
| 119 |
|
| 120 |
# The same shell command (after variables substitution) is executed only once per transaction. |
| 121 |
*:any:echo \(aq${repoid}\(aq >>/tmp/post\-trans\-actions\-repos |
| 122 |
# will write each repo only once to /tmp/post\-trans\-actions\-repos, even if multiple packages from |
| 123 |
# the same repo were matched |
| 124 |
.EE |
| 125 |
.UNINDENT |
| 126 |
.UNINDENT |
| 127 |
.SH AUTHOR |
| 128 |
See AUTHORS in your Core DNF Plugins distribution |
| 129 |
.SH COPYRIGHT |
| 130 |
2014, Red Hat, Licensed under GPLv2+ |
| 131 |
.\" Generated by docutils manpage writer. |
| 132 |
. |