FreeBSD Manual Pages
PKG-TRIGGERS(5) File Formats Manual PKG-TRIGGERS(5) NAME triggers -- trigger file format DESCRIPTION Package triggers define commands to be executed at the end of a pkg(8) transaction when particular files are installed, modified, or removed. Triggers can be used, for example, to update a database or index of files based on files installed by other packages. Triggers are always executed at the end of the transaction, after all changes to files have been committed to disk. They are only executed once even if they have been triggered multiple times. Triggers are searched for in the list of directories configured by the PKG_TRIGGERS_DIR configuration option. By default, this includes /usr/share/pkg/triggers and <localbase>/share/pkg/triggers. Triggers are in UCL format and should have a .ucl extension. The format is the following: path An array of strings containing exact paths. Each time a package installs a file or directory whose name is equal to one of the strings, the trigger will be executed at the end of the transaction. path_glob An array of strings containing shell-style glob patterns. Each time a package installs a file or directory whose name matches one of the patterns, the trigger will be exe- cuted at the end of the transaction. path_regexp An array of strings containing regular expressions. Each time a package installs a file or directory whose name matches one of the regular expressions, the trigger will be executed at the end of the transaction. cleanup An object which represent the script to execute in case the transaction results in removal of the trigger from the installation. The object requires the following fields: type The type of the script to be executed. The only supported type is Lua, indicated by the value "lua" (see pkg-lua-script(5)). script The script itself. trigger An object which represents the script to execute at the end of the transaction if a pattern has been matched. This object requires the following fields: type The type of the script to be executed. The only supported type is Lua, indicated by the value "lua" (see pkg-lua-script(5)). script The script itself. It will receive as arguments the list of paths that matched the patterns during the transaction. SEE ALSO pkg_create(3), pkg_printf(3), pkg_repo_create(3), pkg_repos(3), pkg-keywords(5), pkg-lua-script(5), pkg-repository(5), pkg-script(5), pkg.conf(5), pkg(8), pkg-add(8), pkg-alias(8), pkg-annotate(8), pkg-audit(8), pkg-autoremove(8), pkg-check(8), pkg-clean(8), pkg-config(8), pkg-create(8), pkg-delete(8), pkg-fetch(8), pkg-info(8), pkg-install(8), pkg-key(8), pkg-lock(8), pkg-query(8), pkg-register(8), pkg-repo(8), pkg-repositories(8), pkg-rquery(8), pkg-search(8), pkg-set(8), pkg-shell(8), pkg-shlib(8), pkg-ssh(8), pkg-stats(8), pkg-update(8), pkg-updating(8), pkg-upgrade(8), pkg-version(8), pkg-which(8) FreeBSD ports 15.quarterly October 30, 2025 PKG-TRIGGERS(5)
NAME | DESCRIPTION | SEE ALSO
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=pkg-triggers&sektion=5&manpath=FreeBSD+Ports+15.0.quarterly>
