From ef9be7c2a696a476514de29e2f88df82f37f2ceb Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Thu, 22 Feb 2024 18:19:40 +0100 Subject: ebuild-env-vars.tex: EBUILD_PHASE{,_FUNC} are valid only in phases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Portage didn't ever set (or unset) these variables to a special value when sourcing the ebuild, so obviously ebuilds cannot rely on this. Restrict their validity to actual phases and make global scope behaviour unspecified. The previous wording was introduced with commit 58d3bc0. Bug: https://bugs.gentoo.org/908552 Signed-off-by: Ulrich Müller --- ebuild-env-vars.tex | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ebuild-env-vars.tex b/ebuild-env-vars.tex index aae5413..0dcfd24 100644 --- a/ebuild-env-vars.tex +++ b/ebuild-env-vars.tex @@ -224,23 +224,23 @@ inconsistent variable. A whitespace-delimited list of all active USE flags for this ebuild. See section~\ref{sec:use-iuse-handling} for details. \\ \t{EBUILD_PHASE} & - All & + \t{src_*}, \t{pkg_*} & No & Takes one of the values \t{config}, \t{setup}, \t{nofetch}, \t{unpack}, \t{prepare}, \t{configure}, \t{compile}, \t{test}, \t{install}, \t{preinst}, \t{postinst}, \t{prerm}, \t{postrm}, \t{info}, \t{pretend} according to the top level ebuild function that was executed - by the package manager. May be unset or any single word that is not any of the above when the - ebuild is being sourced for other (e.\,g.\ metadata or QA) purposes. \\ + by the package manager. Behaviour is unspecified when the ebuild is being sourced for other + (e.\,g.\ metadata or QA) purposes. \\ \t{EBUILD_PHASE_FUNC} & - All & + \t{src_*}, \t{pkg_*} & No & \featurelabel{ebuild-phase-func} Takes one of the values \t{pkg_config}, \t{pkg_setup}, \t{pkg_nofetch}, \t{src_unpack}, \t{src_prepare}, \t{src_configure}, \t{src_compile}, \t{src_test}, \t{src_install}, \t{pkg_preinst}, \t{pkg_postinst}, \t{pkg_prerm}, \t{pkg_postrm}, \t{pkg_info}, \t{pkg_pretend} according to the top level ebuild function that - was executed by the package manager. May be unset or any single word that is not any of the - above when the ebuild is being sourced for other (e.\,g.\ metadata or QA) purposes. Only for - EAPIs listed in table~\ref{tab:added-env-vars-table} as supporting \t{EBUILD_PHASE_FUNC}. \\ + was executed by the package manager. Behaviour is unspecified when the ebuild is being sourced + for other (e.\,g.\ metadata or QA) purposes. Only for EAPIs listed in + table~\ref{tab:added-env-vars-table} as supporting \t{EBUILD_PHASE_FUNC}. \\ \t{KV} & All & Yes & -- cgit v1.2.3-65-gdbad