From c71763bf2d4683b1d621479eb52047306796944e Mon Sep 17 00:00:00 2001 From: Ulrich Mueller Date: Thu, 9 Dec 2010 23:00:03 +0100 Subject: [PATCH 2/2] New pkg_required_use function in EAPI 4, bug 347353. --- dependencies.tex | 3 ++- eapi-differences.tex | 3 +++ ebuild-env-vars.tex | 6 +++--- ebuild-functions.tex | 25 +++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/dependencies.tex b/dependencies.tex index 2e98d05..e5d2e42 100644 --- a/dependencies.tex +++ b/dependencies.tex @@ -281,7 +281,8 @@ flags to be valid for this ebuild. In order to be matched, a \t{USE} flag in a t must be enabled (or disabled if it has an exclamation mark prefix). If the package manager encounters a package version where \t{REQUIRED\_USE} assertions are not met, -it must treat this package version as if it was masked. No phase functions must be called. +it must treat this package version as if it was masked. \t{pkg\_required\_use} is run in this case. +No other phase functions must be called. It is an error for a flag to be used if it is not included in \t{IUSE\_EFFECTIVE}. diff --git a/eapi-differences.tex b/eapi-differences.tex index cb9d41d..471ce86 100644 --- a/eapi-differences.tex +++ b/eapi-differences.tex @@ -90,6 +90,9 @@ Use dependencies & \compactfeatureref{use-deps} & \t{pkg\_info} & \compactfeatureref{pkg-info} & Installed & Installed & Installed & Installed & Both \\ +\t{pkg\_required\_use} & \compactfeatureref{pkg-required-use} & + No & No & No & No & Yes \\ + \t{default\_} phase functions & \compactfeatureref{default-phase-funcs} & None & None & \parbox[t]{1in}{\t{pkg\_nofetch}, \t{src\_unpack}, \t{src\_prepare}, \t{src\_configure}, \t{src\_compile}, \t{src\_test}} & diff --git a/ebuild-env-vars.tex b/ebuild-env-vars.tex index 8bb5ee6..a864bb6 100644 --- a/ebuild-env-vars.tex +++ b/ebuild-env-vars.tex @@ -166,9 +166,9 @@ variable. 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. \\ + \t{postrm}, \t{info}, \t{pretend}, \t{required\_use} 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. \\ \t{WORKDIR} & \t{src\_*} & Yes & diff --git a/ebuild-functions.tex b/ebuild-functions.tex index 36df355..0adcb17 100644 --- a/ebuild-functions.tex +++ b/ebuild-functions.tex @@ -395,6 +395,31 @@ source files from their respective locations, with notes concerning licensing if \t{pkg\_nofetch} must require no write access to any part of the filesystem. +\subsection{pkg\_required\_use} +\label{sec:pkg-required-use-function} + +\featurelabel{pkg-required-use} For EAPIs listed in table~\ref{tab:pkg-required-use-table} as +supporting it, the \t{pkg\_required\_use} function may be called when at least one assertion of the +\t{REQUIRED\_USE} variable is not met. The function should output an appropriate explanation why +these assertions failed. It may also suggest \t{USE} flags to be adjusted by the user. + +\t{pkg\_required\_use} must not write to the filesystem. + +\begin{centertable}{EAPIs supporting \t{pkg\_required\_use}} \label{tab:pkg-required-use-table} + \begin{tabular}{ l l } + \toprule + \multicolumn{1}{c}{\textbf{EAPI}} & + \multicolumn{1}{c}{\textbf{Supports \t{pkg\_required\_use}?}} \\ + \midrule + \t{0} & No \\ + \t{1} & No \\ + \t{2} & No \\ + \t{3} & No \\ + \t{4} & Yes \\ + \bottomrule + \end{tabular} +\end{centertable} + \subsection{\t{default\_} Phase Functions} \label{sec:default-phase-funcs} -- 1.7.3.2