Summary: | etckeeper support for dispatch-conf | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Florian Schmaus <flow> |
Component: | Enhancement/Feature Requests | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | PATCH |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=260623 https://github.com/gentoo/portage/pull/689 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | 0001-dispatch-conf-Add-support-for-update-conf.d-hook-dir.patch |
Description
Florian Schmaus
2019-10-23 07:13:23 UTC
Created attachment 652750 [details, diff] 0001-dispatch-conf-Add-support-for-update-conf.d-hook-dir.patch This is a PoC implementation of update-conf.d hooks that can be used to hook etckeeper into dispatch-conf. See also https://archives.gentoo.org/gentoo-portage-dev/message/f493fa2e9ccb58709ffae481f943423d The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=6e86186244d048e3edd5c11c18cfb4eee98a0d56 commit 6e86186244d048e3edd5c11c18cfb4eee98a0d56 Author: Florian Schmaus <flo@geekplace.eu> AuthorDate: 2021-03-28 12:55:04 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2021-08-22 15:32:07 +0000 dispatch-conf: Add support for conf-update.d hook directory Those hooks can be used by tools that manage /etc to get notified about updated configuration files. For example, etckeeper could hook this mechanism like the following: /etc/portage/conf-update.d/etckeeper case "${1}" in pre-update) etckeeper pre-install ;; post-update) etckeeper post-install ;; esac Currently conf-update.d hooks are called with 4 different events: - pre-session - post-session - pre-update - post-update The *-session events are emitted prior starting a new configuration update sesssion, and when it is finished. That is, the pre-session event is emitted just before dispatch-conf displays the first configuration file, and right before it exists. The *-update events are emitted before and after a configuration file has been updated. The path of the configuration file is provided as second hook argument. Signed-off-by: Florian Schmaus <flo@geekplace.eu> Closes: https://bugs.gentoo.org/698316 Bug: https://bugs.gentoo.org/260623 Closes: https://github.com/gentoo/portage/pull/689 Signed-off-by: Michał Górny <mgorny@gentoo.org> bin/dispatch-conf | 13 ++++++++++++- lib/portage/dispatch_conf.py | 14 ++++++++++++++ lib/portage/util/hooks.py | 12 ++++++++++++ man/dispatch-conf.1 | 5 +++++ 4 files changed, 43 insertions(+), 1 deletion(-) |