[pacman-dev] package file hooks
I was recently considering to implement package file hooks. Quote from TODO.aaron : -------------------------------------------------------------------------------------------------------------- * feature for 3.1: package file hooks * I've been planning on this one for some time. Here's a simple rundown: in /etc/pacman.d/hooks: Hook /usr/include/* : /usr/bin/ctags -R /usr/include/*.h -f /usr/include/systags This will allow us to make "global hooks" to simplify a lot of repetitive install files (scrollkeeper, depmod, etc). This also allows us to move ldconfig out of pacman entirely. possible: /etc/pacman.hooks/* files for hooks, so packages can add them too -------------------------------------------------------------------------------------------------------------- It would allow cleaning up a number of repetitive tasks in scriptlets, and could be a nicer alternative to the function libraries idea (http://bugs.archlinux.org/task/10375). Though I didn't think much about it. But today I felt on this : http://www.linux.com/feature/144666 And this looks great, this feature might not even need to be implemented in pacman. But well, I don't know how well it would work in practice. It is just an idea to discuss about.
Xavier wrote:
I was recently considering to implement package file hooks. <snip>
But today I felt on this : http://www.linux.com/feature/144666 And this looks great, this feature might not even need to be implemented in pacman. But well, I don't know how well it would work in practice. It is just an idea to discuss about
This is actually quite awesome... Just adding this command to the incron table: /usr/share/info IN_CLOSE_WRITE /home/allan/hook/infoadd.sh $@/$# calls my infoadd "hook" script: #!/bin/bash install-info $1 /usr/share/info/dir and any time I install a package with info pages they get added to the info index! Of course you would also need to add remove "hooks" too. However, the BIG, BIG downside of this is that packages that want to use these hooks would require the user is running the incron daemon which I am very much against. For this reason, I think it would be much better to implement this in pacman. Also, consider e.g. adding fonts. You don't want to update the font cache once per install and not for every file added. So I think a more general hooks mechanism in pacman is the way to go here. Allan
Allan McRae wrote:
Xavier wrote:
I was recently considering to implement package file hooks. <snip>
But today I felt on this : http://www.linux.com/feature/144666 And this looks great, this feature might not even need to be implemented in pacman. But well, I don't know how well it would work in practice. It is just an idea to discuss about
This is actually quite awesome... Just adding this command to the incron table:
/usr/share/info IN_CLOSE_WRITE /home/allan/hook/infoadd.sh $@/$#
calls my infoadd "hook" script:
#!/bin/bash install-info $1 /usr/share/info/dir
and any time I install a package with info pages they get added to the info index! Of course you would also need to add remove "hooks" too.
However, the BIG, BIG downside of this is that packages that want to use these hooks would require the user is running the incron daemon which I am very much against. For this reason, I think it would be much better to implement this in pacman. Also, consider e.g. adding fonts. You don't want to update the font cache once per install and not for every file added.
That sentence makes no sense... Attempt two: You don't want to update the font cache for each installed font file but rather once at the end of the pacman transaction.
So I think a more general hooks mechanism in pacman is the way to go here.
Allan
participants (2)
-
Allan McRae
-
Xavier