Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/andrewgregory/pachooks

Example hooks for pacman/libalpm
https://github.com/andrewgregory/pachooks

Last synced: about 1 month ago
JSON representation

Example hooks for pacman/libalpm

Lists

README

        

=head1 NAME

pachooks - sample hooks for libalpm/pacman

=head1 DESCRIPTION

=over

=item check-boot - check that /boot is mounted before trying to modify it

=item check-suid - print post-install warnings for suid/getcap binaries

=item fc-cache - rebuild system font information cache

=item hooktest - test the hook execution environment

=item info-install, info-remove - update info file database

=item inhibit - inhibit shutdown during transactions

=item mkfontscale-otf, mkfontscale-ttf - update X11 scalable font name files

=item mkfontdir-otf, mkfontscale-ttf - update X11 bitmap font name files

=item snapshot-pre-snapper, snapshot-post-snapper - take filesystem snapshots

=item sync - sync storage caches to reduce the risk of file system corruption

=item update-desktop-database - update cache database for F<.desktop> files

=item update-mime-database - update shared MIME info database

=back

=head1 FILES

=over

=item F - executables to be used by hooks

=item F - inactive hooks for users to enable

=back

=head1 NOTES

=head2 Hooks vs Install Scripts

Hooks and scripts each fill a different packaging niche. Install scripts are
included directly in the package that runs them and are run immediately prior
to installation or removal of the package. Hooks may be provided by any
package, not necessarily the one(s) that trigger it, or the user and are run
before or after the transaction. Hooks are generally preferable for any tasks
that need to be repeated for a number of packages. Any essential tasks (e.g.
rebuilding the initramfs after a kernel update) should either be run in
a C hook or continue to use an install script due to the risk
of post-transaction hooks not running if the transaction is interrupted.

=head2 Running hooks in the background

Running hooks in the background is generally discouraged; it prevents alpm from
capturing their output and subsequent hooks cannot be sure previous hooks have
finished. For long-running processes that produce no output and only modify
files/directories that are considered volatile anyway, however, this may be
acceptable. In order to run a process in the background, its C,
C, and C file descriptors must be closed or redirected and it
must be run inside a forked environment. Using a POSIX-compatible shell, this
can be accomplished with:

Exec = /bin/sh -c ' <&- >&- 2>&1 &'

For example:

Exec = /bin/sh -c 'mkdir -p /var/cache/man; mandb --quiet <&- >&- 2>&- &'

=head1 COPYRIGHT AND LICENSE

Copyright 2015-2016 Andrew Gregory

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

=head1 SEE ALSO

L