FS#53136 - alpm-hooks should allow to restrict a Type=File trigger to certain file types
Attached to Project:
Pacman
Opened by Stefan Majewsky (majewsky) - Wednesday, 01 March 2017, 22:44 GMT
Opened by Stefan Majewsky (majewsky) - Wednesday, 01 March 2017, 22:44 GMT
|
Details
I noticed this with the update to screen-4.5.1-1. It
contains the directory /usr/share/info/, but nothing below
it.
$ pacman -Qql screen | grep info /usr/share/info/ Upon installation, the texinfo-install.hook from texinfo-6.3-1 fires, because its trigger looks like this: $ cat /usr/share/libalpm/hooks/texinfo-install.hook [Trigger] Type = File Operation = Install Operation = Upgrade Target = usr/share/info/* [Action] Description = Updating the info directory file... When = PostTransaction Exec = /bin/sh -c 'while read -r f; do install-info "$f" /usr/share/info/dir 2> /dev/null; done' NeedsTargets The trigger fails because `install-info` expects a file argument, not a directory argument. The error actually occurs for all packages with info files, since they all contain /usr/share/info/, but since there are actual files after that package entry, the error remains unnoticed in this particular instance. I could file a bug against the texinfo package to have a strategic `test -f` added to that Exec= line, or to have the glob changed to Target=usr/share/info/?*, but IMO the problem is with Pacman. It's really surprising that a trigger of Type=File fires for directories as well. There should be trigger types that trigger only for certain file types. At the very least, it seems like one type of trigger for any type of filesystem entry, and another trigger type for non-directories would be useful. |
This task depends upon
Target = usr/share/info/*.info*
Because it matches the expected info file names, rather than blindly matching on the directory. Two [core] packages, in fact, install PNG files in there for some odd reason (gnutls and libidn), and it is wasteful to whatever minor degree, to attempt to run `install-info` on those files.