1ALPM-HOOKS(5)                    Pacman Manual                   ALPM-HOOKS(5)
2
3
4

NAME

6       alpm-hooks - alpm hook file format
7

SYNOPSIS

9       [Trigger] (Required, Repeatable)
10       Operation = Install|Upgrade|Remove (Required, Repeatable)
11       Type = File|Package (Required)
12       Target = <Path|PkgName> (Required, Repeatable)
13
14       [Action] (Required)
15       Description = ... (Optional)
16       When = PreTransaction|PostTransaction (Required)
17       Exec = <Command> (Required)
18       Depends = <PkgName> (Optional)
19       AbortOnFail (Optional, PreTransaction only)
20       NeedsTargets (Optional)
21

DESCRIPTION

23       libalpm provides the ability to specify hooks to run before or after
24       transactions based on the packages and/or files being modified. Hooks
25       consist of a single [Action] section describing the action to be run
26       and one or more [Trigger] section describing which transactions it
27       should be run for. Hook file names are required to have the suffix
28       ".hook". Hooks are run in alphabetical order of their file name.
29

TRIGGERS

31       Hooks must contain at least one [Trigger] section that determines which
32       transactions will cause the hook to run. If multiple trigger sections
33       are defined the hook will run if the transaction matches any of the
34       triggers.
35
36       Operation = Install|Upgrade|Remove
37           Select the type of operation to match targets against. May be
38           specified multiple times. Installations are considered an upgrade
39           if the package or file is already present on the system regardless
40           of whether the new package version is actually greater than the
41           currently installed version. For File triggers, this is true even
42           if the file changes ownership from one package to another.
43           Required.
44
45       Type = File|Package
46           Select whether targets are matched against transaction packages or
47           files. See CAVEATS for special notes regarding File triggers.
48           Required.
49
50       Target = <path|package>
51           The file path or package name to match against the active
52           transaction. File paths refer to the files in the package archive;
53           the installation root should not be included in the path.
54           Shell-style glob patterns are allowed. It is possible to invert
55           matches by prepending a file with an exclamation mark. May be
56           specified multiple times. Required.
57

ACTIONS

59       Description = ...
60           An optional description that describes the action being taken by
61           the hook for use in front-end output.
62
63       Exec = <command>
64           Command to run. Command arguments are split on whitespace. Values
65           containing whitespace should be enclosed in quotes. Required.
66
67       When = PreTransaction|PostTransaction
68           When to run the hook. Required.
69
70       Depends = <package>
71           Packages that must be installed for the hook to run. May be
72           specified multiple times.
73
74       AbortOnFail
75           Causes the transaction to be aborted if the hook exits non-zero.
76           Only applies to PreTransaction hooks.
77
78       NeedsTargets
79           Causes the list of matched trigger targets to be passed to the
80           running hook on stdin.
81

OVERRIDING HOOKS

83       Hooks may be overridden by placing a file with the same name in a
84       higher priority hook directory. Hooks may be disabled by overriding
85       them with a symlink to /dev/null.
86

EXAMPLES

88           # Force disks to sync to reduce the risk of data corruption
89
90           [Trigger]
91           Operation = Install
92           Operation = Upgrade
93           Operation = Remove
94           Type = Package
95           Target = *
96
97           [Action]
98           Depends = coreutils
99           When = PostTransaction
100           Exec = /usr/bin/sync
101

CAVEATS

103       There are situations when file triggers may act in unexpected ways.
104       Hooks are triggered using the file list of the installed, upgraded, or
105       removed package. When installing or upgrading a file that is extracted
106       with a .pacnew extension, the original file name is used in triggering
107       the hook. When removing a package, all files owned by that package can
108       trigger a hook whether or not they were actually present on the file
109       system before package removal.
110
111       PostTransaction hooks will not run if the transaction fails to complete
112       for any reason.
113
114       See the pacman website at https://www.archlinux.org/pacman/ for current
115       information on pacman and its related tools.
116

BUGS

118       Bugs? You must be kidding; there are no bugs in this software. But if
119       we happen to be wrong, send us an email with as much detail as possible
120       to pacman-dev@archlinux.org.
121

AUTHORS

123       Current maintainers:
124
125       ·   Allan McRae <allan@archlinux.org>
126
127       ·   Andrew Gregory <andrew.gregory.8@gmail.com>
128
129       ·   Dan McGee <dan@archlinux.org>
130
131       ·   Dave Reisner <dreisner@archlinux.org>
132
133       Past major contributors:
134
135       ·   Judd Vinet <jvinet@zeroflux.org>
136
137       ·   Aurelien Foret <aurelien@archlinux.org>
138
139       ·   Aaron Griffin <aaron@archlinux.org>
140
141       ·   Xavier Chantry <shiningxc@gmail.com>
142
143       ·   Nagy Gabor <ngaba@bibl.u-szeged.hu>
144
145       For additional contributors, use git shortlog -s on the pacman.git
146       repository.
147
148
149
150Pacman 5.0.2                      2019-07-26                     ALPM-HOOKS(5)
Impressum