From: Zac Medico <zmedico@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org, Florian Schmaus <flo@geekplace.eu>
Subject: Re: [gentoo-portage-dev] RFC: conf-update.d hook dir for dispatch-conf
Date: Sat, 8 Aug 2020 17:41:40 -0700 [thread overview]
Message-ID: <74d3362d-e1dc-4797-7631-1228c927b086@gentoo.org> (raw)
In-Reply-To: <20200803081400.160146-1-flo@geekplace.eu>
[-- Attachment #1.1: Type: text/plain, Size: 2098 bytes --]
On 8/3/20 1:13 AM, Florian Schmaus wrote:
> Portage's dispatch-conf does historically only support RCS for
> configuration file archival. There are currently two unresolved
> feature requests to extend dispatch-conf support for further
> configuration file management tools:
>
> - bug #260623 git support for dispatch-conf [1]
> - bug #698316 etckeeper support for dispatch-conf [2]
>
> Extending dispatch-conf by a hook directory, which can be used by
> configuration file management tools to receive notifications about
> dispatch-conf updating a configuration file, appears to be flexible
> approach to satisfy those feature requests (or at least lay the
> groundwork for them).
>
> Attached is a patch with a prototypical implementation for
> conf-update.d hooks. I am curious whether or not you deem this useful
> enough to get into dispatch-conf.
Yes, and hooks are a great way to allow for customization.
> If my suggested approach is considered sensible, then I am happy to
continue the work on it.
Yes, it looks good. I wonder if we should support hooks that are only
called once per dispatch-conf session, rather than once per file. I see
that your etckeeper hook does not utilize the file argument, so maybe it
would make more sense to call it at the end of the dispatch-conf session?
If it makes sense to have session hooks, then I suppose we can add a
separate directory for them (kind of like how we have separate
repo.postsync.d and postsync.d hooks).
> For example, I want to write a unit test for this. But I am not sure if
> portage's test framework already provides the necessary functionality
> to create test scenarios for the conf-update.d hooks. Any pointers and
> further feedback would be much appreciated.
In lib/portage/tests/emerge/test_simple.py, we execute emerge,
dispatch-conf, and etc-update inside a mock gentoo prefix environment.
Maybe you can copy that file and modify it to do what you want.
>
> - Florian
>
> 1: https://bugs.gentoo.org/260623
> 2: https://bugs.gentoo.org/698316
--
Thanks,
Zac
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 981 bytes --]
prev parent reply other threads:[~2020-08-09 0:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-03 8:13 [gentoo-portage-dev] RFC: conf-update.d hook dir for dispatch-conf Florian Schmaus
2020-08-03 8:14 ` [gentoo-portage-dev] [PATCH] dispatch-conf: Add support for update-conf.d hook directory Florian Schmaus
2020-08-09 0:41 ` Zac Medico [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=74d3362d-e1dc-4797-7631-1228c927b086@gentoo.org \
--to=zmedico@gentoo.org \
--cc=flo@geekplace.eu \
--cc=gentoo-portage-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox