blob: 4bc80c77d902f69421620307ef6aae71ec7c63df (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
\section{The state of variables between functions}
\label{sec:ebuild-env-state}
Exported and default scope variables are saved between functions. A non-local variable set in a
function earlier in the call sequence must have its value preserved for later functions, including
functions executed as part of a later uninstall.
\note \t{pkg\_pretend} is \e{not} part of the normal call sequence, and does not take part in
environment saving.
Variables that were exported must remain exported in later functions; variables with default
visibility may retain default visibility or be exported.
Variables with special meanings to the package manager are excluded from this rule.
Global variables must only contain invariant values (see~\ref{sec:metadata-invariance}). If a global
variable's value is invariant, it may have the value that would be generated at any given point
in the build sequence.
This is demonstrated by code listing~\ref{lst:env-saving}.
\begin{listing}
\caption{Environment state between functions}\label{lst:env-saving}
\verbatiminput{env-saving.listing}
\end{listing}
% vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en :
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pms"
%%% LaTeX-indent-level: 4
%%% LaTeX-item-indent: 0
%%% TeX-brace-indent-level: 4
%%% fill-column: 100
%%% End:
|