FS#76826 - [etckeeper][pacman] Hooks don't trigger on files changed by post install scripts
Attached to Project:
Community Packages
Opened by Arvid Norlander (VorpalGun) - Wednesday, 14 December 2022, 13:52 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:05 GMT
Opened by Arvid Norlander (VorpalGun) - Wednesday, 14 December 2022, 13:52 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:05 GMT
|
Details
Description:
etckeeper has a hook of the type: Type = Path Target = etc/* (see /usr/share/libalpm/hooks/zz-etckeeper-post-install.hook) This runs etckeeper when anything in /etc was changed by a package. However, when etc is only changed by a post install script (for example: archlinux-keyring does this), etckeeper is not triggered to run. I'm not sure if it is a bug in pacman or in etckeeper's hook. Is it even fixable? The goal is that etckeeper commits any changes in /etc before and after a pacman operation. If the hook on etc/* is not reliable, how should this be done properly? Additional info: * package version(s): pacman-6.0.2-5, etckeeper-1.18.18-1 * link to upstream bug report, if any: None yet, as I don't know if it is a pacman or etckeeper bug. Once that is figured out I will report to the appropriate upstream. Steps to reproduce: * Install etckeeper: pacman -S etckeeper git * Set up etckeeper (cd /etc; etckeeper init; etckeeper commit "Initial import") * Install/upgrade a package that doesn't touch /etc directly, but does change things in /etc in it's post install script (such as an upgrade of archlinux-keyring) Observe that etckeeper was not triggered and did not commit the changes in /etc. |
This task depends upon
Closed by Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:05 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/etckeeper/issues/1
Saturday, 25 November 2023, 20:05 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/etckeeper/issues/1
Type = Path
Target = etc/*
Changing this to something like...
Type = Package
Target = *
... would bring the behavior you expect.
Perhaps it could even be considered the rename the existing and adding a new hook. A hook 05-etckeeper-post-install.hook could cache all changes caused by package updates, zz-etckeeper-post-install.hook with the changes mentioned above could catch everything changed by other hooks.
I've considered to send these changes upstream myself earlier, but did not yet. Do you want to give it a try?
I'll open an upstream "bug" about this.
https://etckeeper.branchable.com/todo/__91__BUG__93___Arch_Linux:_hooks_don__39__t_trigger_when___47__etc_is_only_modified_by_post-install_scripts./
I'm trying this now, I did a quick & dirty modification in place as you suggested.
Did you have some patch floating around for this that you wanted to submit upstream? Or should I do that? I don't want to steal your credit.