Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 698316 - etckeeper support for dispatch-conf
Summary: etckeeper support for dispatch-conf
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-10-23 07:13 UTC by Florian Schmaus
Modified: 2021-08-22 15:32 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
0001-dispatch-conf-Add-support-for-update-conf.d-hook-dir.patch (0001-dispatch-conf-Add-support-for-update-conf.d-hook-dir.patch,3.48 KB, patch)
2020-08-03 16:04 UTC, Florian Schmaus
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Schmaus gentoo-dev 2019-10-23 07:13:23 UTC
Currently dispatch-conf only supports rcs. It would be desirable if dispatch-conf gained also support for etckeeper (sys-apps/etckeeper). This is akin to bug #260623 ("git support for dispatch-conf").

Reproducible: Always
Comment 1 Florian Schmaus gentoo-dev 2020-08-03 16:04:59 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
Comment 2 Larry the Git Cow gentoo-dev 2021-08-22 15:32:25 UTC
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(-)