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
signature.asc
Description: OpenPGP digital signature