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

# The same shell command (after variables substitution) is executed only once per transaction.
*:any:echo \(aq${repoid}\(aq >>/tmp/post\-trans\-actions\-repos
# will write each repo only once to /tmp/post\-trans\-actions\-repos, even if multiple packages from
# the same repo were matched
.ft P
.fi
.UNINDENT
.UNINDENT
.SH AUTHOR
See AUTHORS in your Core DNF Plugins distribution
.SH COPYRIGHT
2023, Red Hat, Licensed under GPLv2+
.\" Generated by docutils manpage writer.
.