commit: 0ef26e79892567f73359629f0cc0c00df3651dd1 Author: Amit Dor-Shifer <amitds <AT> oversi <DOT> com> AuthorDate: Mon Oct 19 07:37:22 2009 +0000 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> CommitDate: Sun Jun 5 21:01:41 2022 +0000 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=0ef26e79
general-concepts/config-protect: Add example for env.d Closes: https://bugs.gentoo.org/289565 [Make the XML validate. Small tweaks to example and wording.] Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> general-concepts/config-protect/text.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/general-concepts/config-protect/text.xml b/general-concepts/config-protect/text.xml index ec74a86..cca1457 100644 --- a/general-concepts/config-protect/text.xml +++ b/general-concepts/config-protect/text.xml @@ -25,6 +25,21 @@ similar. If you need a file renamed, removed or changed in a particular way, you should display a message informing the user. </p> + +<p> +An ebuild can append to the <c>CONFIG_PROTECT_MASK</c> variable by using +Portage's <uri link="::tasks-reference/environment/"/> mechanism. The ebuild +has to generate an <c>env.d</c> file, then install it using <c>doenvd</c> or +<c>newenvd</c>. <c>emerge</c> shall call <c>env-update</c> and generate the +proper environment for proceeding with its merge. The following snippet (from +<c>src_install</c>) shall cause <c>/etc/test.cfg</c> to be auto-merged without +needing to call <c>etc-update</c> after the package is merged: +</p> + +<codesample lang="ebuild"> + newenvd - 99my-pkg <<< "CONFIG_PROTECT_MASK=\"/etc/test.cfg\"" +</codesample> + </body> </chapter> </guide>
