commit:     93450a9dc3fb1fcc1ec90e3364b60673084c0199
Author:     Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
AuthorDate: Fri Nov  8 16:08:40 2019 +0000
Commit:     Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
CommitDate: Tue Nov 12 17:14:58 2019 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=93450a9d

ebuild-writing/functions: mention pkg_pretend as part of the phase sequence

Acked-by: Michael Orlitzky <mjo <AT> gentoo.org>
Signed-off-by: Göktürk Yüksek <gokturk <AT> gentoo.org>
Closes: https://github.com/gentoo/devmanual.gentoo.org/pull/117

 ebuild-writing/functions/text.xml | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/ebuild-writing/functions/text.xml 
b/ebuild-writing/functions/text.xml
index 325a9b4..a6deb0a 100644
--- a/ebuild-writing/functions/text.xml
+++ b/ebuild-writing/functions/text.xml
@@ -5,18 +5,29 @@
 
 <body>
 <p>
-When installing packages from source, the function call order is 
<c>pkg_setup</c>,
+When installing packages from source, the function call order is
+<c>pkg_pretend</c> (for EAPI=4 and later), <c>pkg_setup</c>,
 <c>src_unpack</c>, <c>src_prepare</c>, <c>src_configure</c>, 
<c>src_compile</c>,
 <c>src_test</c> (optional, <c>FEATURES="test"</c>),
 <c>src_install</c>, <c>pkg_preinst</c>, <c>pkg_postinst</c>. When installing 
packages
-from a binary, the function call order is <c>pkg_setup</c>, <c>pkg_preinst</c>,
-<c>pkg_postinst</c>.
+from a binary, the function call order is <c>pkg_pretend</c>,
+<c>pkg_setup</c>, <c>pkg_preinst</c>, <c>pkg_postinst</c>.
 As some phases haven't been introduced from the beginning, you can have a look 
at
 <uri link="::ebuild-writing/eapi"/> for an overview, what have been introduced 
in which EAPI.
 </p>
 
 <figure short="How the ebuild functions are processed" link="diagram.png"/>
 
+<p>
+The <c>pkg_pretend</c> function is to be used for performing various
+early sanity checks, such as ensuring that certain kernel options are
+enabled. It is important to keep in mind that <c>pkg_pretend</c> runs
+separately from the rest of the phase function sequence. Consequently,
+there is no environment saving or propagation to the next
+phase. Moreover, ebuild dependencies are not guaranteed to be
+satisfied at this phase.
+</p>
+
 <p>
 The <c>pkg_prerm</c> and <c>pkg_postrm</c> functions are called when 
uninstalling a
 package. The <c>pkg_config</c> function is used for any special package

Reply via email to