Talk:DeveloperWiki:Pacman Hooks

From ArchWiki
Revision as of 10:59, 24 April 2016 by Grawity (talk | contribs) (fontconfig font cache)
Jump to navigation Jump to search

glib-compile-schemas

Used by 222 packages

Proposed Hook (glib-compile-schemas)

[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Operation = Remove
Target = usr/share/glib-2.0/schemas/*.gschema.xml
Target = usr/share/glib-2.0/schemas/*.gschema.override

[Action]
Description = Compile GSettings XML schema files...
When = PostTransaction
Exec = /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas

--City-busz (talk) 08:06, 23 April 2016 (UTC)

Thanks, I think that will work. --Heftig (talk) 08:22, 23 April 2016 (UTC)

hook script location

libalpm doesn't place any restrictions on where we store custom scripts for hooks, but I think we should store them all in the same place for the sake of consistency. I suggest '/usr/share/libalpm/hooks.bin/' in order to keep them near the hooks themselves. Apg (talk) 11:47, 23 April 2016 (UTC)

systemd-sysusers and systemd-tmpfiles

systemd-tmpfiles

Used by 52 packages

Proposed hook (systemd):

[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Target = usr/lib/tmpfiles.d/*.conf

[Action]
Description = Updating systemd-tmpfiles…
When = PostTransaction
Exec = /bin/sh -c 'while read -r f; do /usr/bin/systemd-tmpfiles --create "$f" ; done'
NeedsTargets

systemd-sysusers

Used by 29 packages

Proposed hook (systemd):

[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Target = usr/lib/sysusers.d/*.conf

[Action]
Description = Updating systemd-sysusers…
When = PostTransaction
Exec = /bin/sh -c 'while read -r f; do /usr/bin/systemd-sysusers "$f" ; done'
NeedsTargets

--AsamK (talk) 14:13, 23 April 2016 (UTC)

while read

Suggested alternative (conveniently, texinfo already depends on findutils):

Exec = /usr/bin/xargs -i /usr/bin/install-info {} /usr/share/info/dir
NeedsTargets

--grawity (talk) 14:49, 23 April 2016 (UTC)

texinfo only depends on find due to its install scriptlet which is being replaced by these hooks. Allan (talk) 00:35, 24 April 2016 (UTC)

systemctl daemon-reload?

Not sure if this is ever called during the update process anywhere. If so I imagine it would be called often. -- Rdeckard (talk), ArchWiki Maintainer 00:07, 24 April 2016 (UTC)

texlive file database update

Used in 27 packages with calls to either mktexlsr or texhash (one symlinks to the other).

Proposed hook (texlive-texmf):

[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Operation = Remove
Target = usr/share/texmf/*
Target = usr/share/texmf-dist/*
 
[Action]
Description = Updating texlive filename database...
When = PostTransaction
Exec = /usr/bin/mktexlsr

--abdo (talk) 09:49, 24 April 2016 (UTC)

I think you can put multiple Targets under one [Trigger], can't you? --grawity (talk) 10:08, 24 April 2016 (UTC)
Oh yes! I just tested it. Thanks!

gconf

[Trigger]
Type = file
Operation = Install
Operation = Upgrade
Target = usr/share/gconf/schemas/*.schemas

[Action]
Description = Installing GConf schemas...
When = PostTransaction
Exec = /bin/bash -c 'while read -r f; do f=${f##*/}; f=${f%.schemas}; /usr/bin/gconfpkg --install $f; done'
NeedsTargets
[Trigger]
Type = file
Operation = Remove
Target = usr/share/gconf/schemas/*.schemas

[Action]
Description = Removing GConf schemas...
When = PreTransaction
Exec = /bin/bash -c 'while read -r f; do f=${f##*/}; f=${f%.schemas}; /usr/bin/gconfpkg --uninstall $f; done'
NeedsTargets

(As a side note, gconf's own .install scriptlet is a bit weird)

--grawity (talk) 10:24, 24 April 2016 (UTC)

glib2: gio-querymodules

[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Operation = Remove
Target = usr/lib/gio/modules/*.so

[Action]
Description = Updating GLib GIO module cache...
When = PostTransaction
Exec = /usr/bin/gio-querymodules /usr/lib/gio/modules

--grawity (talk) 10:25, 24 April 2016 (UTC)

fontconfig font cache

Used in 53 packages.

Proposed hook (fontconfig-cache):

[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Operation = Remove
Target = usr/share/fonts/*

[Action]
Description = Updating fontconfig font cache...
When = PostTransaction
Exec = /usr/bin/fc-cache -s -f

--abdo (talk) 10:29, 24 April 2016 (UTC)

The -f is unnecessary most of the time; existing packages have been removing it from their scripts. --grawity (talk) 10:59, 24 April 2016 (UTC)