Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 296716 | Differences between
and this patch

Collapse All | Expand All

(-)a/eapi-differences.tex (-1 / +4 lines)
Lines 188-194 Use dependencies & \compactfeatureref{use-deps} & No & No & Link Here
188
    \parbox[t]{1in}{\t{pkg\_nofetch}, \t{src\_unpack}, \t{src\_prepare}, \t{src\_configure}, \t{src\_compile}, \t{src\_test}} &
188
    \parbox[t]{1in}{\t{pkg\_nofetch}, \t{src\_unpack}, \t{src\_prepare}, \t{src\_configure}, \t{src\_compile}, \t{src\_test}} &
189
    \parbox[t]{1in}{\t{pkg\_nofetch}, \t{src\_unpack}, \t{src\_prepare}, \t{src\_configure}, \t{src\_compile}, \t{src\_test}} &
189
    \parbox[t]{1in}{\t{pkg\_nofetch}, \t{src\_unpack}, \t{src\_prepare}, \t{src\_configure}, \t{src\_compile}, \t{src\_test}} &
190
    \parbox[t]{1in}{\t{pkg\_nofetch}, \t{src\_unpack}, \t{src\_prepare}, \t{src\_configure},
190
    \parbox[t]{1in}{\t{pkg\_nofetch}, \t{src\_unpack}, \t{src\_prepare}, \t{src\_configure},
191
        \t{src\_compile}, \t{src\_install}, \t{src\_test}} \\
191
        \t{src\_compile}, \t{src\_install}, \t{src\_test},
192
        \t{EPREFIX}, \t{ED}, \t{EROOT}} \\
192
193
193
\t{AA} & \compactfeatureref{aa} & Yes & Yes &
194
\t{AA} & \compactfeatureref{aa} & Yes & Yes &
194
    \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{Yes} &}{} Yes & Yes & No \\
195
    \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{Yes} &}{} Yes & Yes & No \\
Lines 356-361 EAPI 4 is EAPI 3 with the following changes: Link Here
356
\item \t{RDEPEND=DEPEND} no longer done, \featureref{rdepend-depend}.
357
\item \t{RDEPEND=DEPEND} no longer done, \featureref{rdepend-depend}.
357
\item Utilities now die on failure, \featureref{die-on-failure}, unless called under \t{nonfatal},
358
\item Utilities now die on failure, \featureref{die-on-failure}, unless called under \t{nonfatal},
358
    \featureref{nonfatal}
359
    \featureref{nonfatal}
360
\item offset-prefix support by definition of \t{EPREFIX}, \t{ED} and
361
\t{EROOT}, \featureref{offset-prefix-vars}
359
\end{compactitem}
362
\end{compactitem}
360
363
361
% vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en :
364
% vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en :
(-)a/ebuild-env-vars.tex (-1 / +50 lines)
Lines 13-19 variable. Link Here
13
13
14
\begin{landscape}
14
\begin{landscape}
15
\begin{longtable}{l p{0.15\textwidth} l p{0.5\textwidth}}
15
\begin{longtable}{l p{0.15\textwidth} l p{0.5\textwidth}}
16
\caption{Defined variables}\\
16
\caption{Defined variables\label{tab:defined_vars}}\\
17
\toprule
17
\toprule
18
\multicolumn{1}{c}{\b{Variable}} &
18
\multicolumn{1}{c}{\b{Variable}} &
19
\multicolumn{1}{c}{\b{Legal in}} &
19
\multicolumn{1}{c}{\b{Legal in}} &
Lines 104-109 variable. Link Here
104
   \t{ROOT}\@. Also of note is that in a cross-compiling environment, binaries inside of \t{ROOT}
104
   \t{ROOT}\@. Also of note is that in a cross-compiling environment, binaries inside of \t{ROOT}
105
   will not be executable on the build machine, so ebuilds must not call them. \t{ROOT} must be
105
   will not be executable on the build machine, so ebuilds must not call them. \t{ROOT} must be
106
   non-empty and end in a trailing slash. \\
106
   non-empty and end in a trailing slash. \\
107
\t{EROOT} &
108
    \t{pkg\_*} &
109
	No &
110
	Like \t{ROOT}, but with \t{EPREFIX} appended.  This is a convenience
111
	variable.  See also the \t{EPREFIX} variable. \\
107
\t{T} &
112
\t{T} &
108
    All &
113
    All &
109
    Partially\footnote{Consistent and preserved across a single connected sequence of install or
114
    Partially\footnote{Consistent and preserved across a single connected sequence of install or
Lines 120-125 variable. Link Here
120
    Ditto &
125
    Ditto &
121
    The full path to an appropriate temporary directory for use by any programs invoked by the
126
    The full path to an appropriate temporary directory for use by any programs invoked by the
122
    ebuild that may read or modify the home directory. \\
127
    ebuild that may read or modify the home directory. \\
128
\t{EPREFIX} &
129
    All &
130
	Yes &
131
	The normalised offset-prefix path of an offset installation.  When
132
	\t{EPREFIX} is not set in the calling environment, \t{EPREFIX}
133
	defaults to the built in offset-prefix that was set during
134
	installation of the package manager.  When a different \t{EPREFIX}
135
	value than the built in value is set in the environment, a
136
	cross-prefix build is performed where using the existing utilities,
137
	a package is build for the given \t{EPREFIX}, akin to \t{ROOT}.  See
138
	also~\ref{sec:offset-vars}. \\
123
\t{D} &
139
\t{D} &
124
    \t{src\_install} &
140
    \t{src\_install} &
125
    No &
141
    No &
Lines 130-135 variable. Link Here
130
    Yes &
146
    Yes &
131
    Contains the full path to the image that is about to be or has just been merged. Must be
147
    Contains the full path to the image that is about to be or has just been merged. Must be
132
    non-empty and end in a trailing slash. \\
148
    non-empty and end in a trailing slash. \\
149
\t{ED} &
150
    \t{src\_install} &
151
	See \t{D} &
152
	Like \t{D}, but with \t{EPREFIX} appended.  This is a convenience
153
	variable.  See also the \t{EPREFIX} variable. \\
133
\t{IMAGE}\footnote{Deprecated in favour of \t{D}.} &
154
\t{IMAGE}\footnote{Deprecated in favour of \t{D}.} &
134
    \t{pkg\_preinst}, \t{pkg\_postinst} &
155
    \t{pkg\_preinst}, \t{pkg\_postinst} &
135
    Yes &
156
    Yes &
Lines 218-223 variable. Link Here
218
}
239
}
219
\end{centertable}
240
\end{centertable}
220
241
242
\begin{centertable}{EAPIs supporting offset-prefix env variables} \label{tab:offset-env-vars-table}
243
\begin{tabular}{ l l l l }
244
	\toprule
245
	\multicolumn{1}{c}{\textbf{EAPI}} &
246
	\multicolumn{1}{c}{\textbf{\t{EPREFIX}?}} &
247
	\multicolumn{1}{c}{\textbf{\t{EROOT}?}} &
248
	\multicolumn{1}{c}{\textbf{\t{ED}?}} \\
249
	\midrule
250
\t{0} & No & No & No \\
251
\t{1} & No & No & No \\
252
\t{2} & No & No & No \\
253
\t{3} & Yes & Yes & Yes \\
254
\bottomrule
255
\end{tabular}
256
\end{centertable}
257
221
Except where otherwise noted, all variables set in the active profiles' \t{make.defaults} files must
258
Except where otherwise noted, all variables set in the active profiles' \t{make.defaults} files must
222
be exported to the ebuild environment. \t{CHOST}, \t{CBUILD} and \t{CTARGET}, if not set by
259
be exported to the ebuild environment. \t{CHOST}, \t{CBUILD} and \t{CTARGET}, if not set by
223
profiles, must contain either an appropriate machine tuple (the definition of appropriate is beyond
260
profiles, must contain either an appropriate machine tuple (the definition of appropriate is beyond
Lines 311-316 installing \t{foo-2:2} to replace \t{foo-2:1} and \t{foo-3:2}. Link Here
311
In EAPIs listed in table~\ref{tab:env-vars-table} as supporting it, the \t{REPLACED\_BY} variable
348
In EAPIs listed in table~\ref{tab:env-vars-table} as supporting it, the \t{REPLACED\_BY} variable
312
shall be defined in \t{pkg\_prerm} and \t{pkg\_postrm}. It shall contain at most one value.
349
shall be defined in \t{pkg\_prerm} and \t{pkg\_postrm}. It shall contain at most one value.
313
350
351
\subsection{Offset-prefix variables \t{EPREFIX}, \t{EROOT} and \t{ED}}
352
\label{sec:offset-vars}
353
354
\featurelabel{offset-prefix-vars} In EAPI 3, three variables related to
355
offset-prefix installations were added.  Two of these, \t{EROOT} and
356
\t{ED}, are convenience variables using the variable \t{EPREFIX}.  In
357
EAPIs prior to 3, the installation offset is hardwired to \t{/usr}.
358
Using the variable \t{EPREFIX}, in EAPI 3 this installation offset can
359
be set as \t{\$\{EPREFIX\}/usr}.  This way, \t{EPREFIX} set to the empty
360
string makes the behaviour identical to EAPIs prior to 3, but adds two
361
extra variables.
362
314
% vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en :
363
% vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en :
315
364
316
%%% Local Variables:
365
%%% Local Variables:
(-)a/pkg-mgr-commands.tex (-20 / +47 lines)
Lines 173-184 has returned. Link Here
173
173
174
    \featurelabel{econf-options}
174
    \featurelabel{econf-options}
175
    \begin{itemize}
175
    \begin{itemize}
176
    \item -{}-prefix must default to \t{/usr} unless overridden by \t{econf}'s caller.
176
    \item -{}-prefix must default to \t{\$EPREFIX/usr} unless overridden by \t{econf}'s caller.
177
    \item -{}-mandir must be \t{/usr/share/man}
177
    \item -{}-mandir must be \t{\$EPREFIX/usr/share/man}
178
    \item -{}-infodir must be \t{/usr/share/info}
178
    \item -{}-infodir must be \t{\$EPREFIX/usr/share/info}
179
    \item -{}-datadir must be \t{/usr/share}
179
    \item -{}-datadir must be \t{\$EPREFIX/usr/share}
180
    \item -{}-sysconfdir must be \t{/etc}
180
    \item -{}-sysconfdir must be \t{\$EPREFIX/etc}
181
    \item -{}-localstatedir must be \t{/var/lib}
181
    \item -{}-localstatedir must be \t{\$EPREFIX/var/lib}
182
    \item -{}-host must be the value of the \t{CHOST} environment variable.
182
    \item -{}-host must be the value of the \t{CHOST} environment variable.
183
    \item -{}-libdir must be set according to Algorithm~\ref{alg:econf-libdir}.
183
    \item -{}-libdir must be set according to Algorithm~\ref{alg:econf-libdir}.
184
    \item -{}-disable-dependency-tracking, if the EAPI is listed in
184
    \item -{}-disable-dependency-tracking, if the EAPI is listed in
Lines 217-222 has returned. Link Here
217
    }
217
    }
218
    \end{centertable}
218
    \end{centertable}
219
219
220
	Note that the \t{\$EPREFIX} component represents the same
221
	offset-prefix as described in Table~\ref{tab:defined_vars}.  It
222
	facilitates offset-prefix installations for which support was added
223
	in EAPI 3.  When no offset-prefix installation is in effect,
224
	\t{EPREFIX} becomes the empty string, making the behaviour of econf
225
	equal to EAPIs prior to EAPI 3.
226
220
    \t{econf} must be implemented internally---that is, as a bash function and not an external
227
    \t{econf} must be implemented internally---that is, as a bash function and not an external
221
    script. Should any portion of it fail, it must abort the build using \t{die}, unless run using
228
    script. Should any portion of it fail, it must abort the build using \t{die}, unless run using
222
    \t{nonfatal}, in which case it must return non-zero exit status.
229
    \t{nonfatal}, in which case it must return non-zero exit status.
Lines 224-230 has returned. Link Here
224
\begin{algorithm}
231
\begin{algorithm}
225
\caption{econf -{}-libdir logic} \label{alg:econf-libdir}
232
\caption{econf -{}-libdir logic} \label{alg:econf-libdir}
226
\begin{algorithmic}[1]
233
\begin{algorithmic}[1]
227
\STATE let prefix=/usr
234
\STATE let prefix=\$EPREFIX/usr
228
\IF{the caller specified -{}-prefix=\$p}
235
\IF{the caller specified -{}-prefix=\$p}
229
    \STATE let prefix=\$p
236
    \STATE let prefix=\$p
230
\ENDIF
237
\ENDIF
Lines 251-264 has returned. Link Here
251
    to \t{einstall} are passed verbatim to \t{emake}, as shown. Failure behaviour is EAPI dependent
258
    to \t{einstall} are passed verbatim to \t{emake}, as shown. Failure behaviour is EAPI dependent
252
    as per section~\ref{sec:failure-behaviour}.
259
    as per section~\ref{sec:failure-behaviour}.
253
260
261
	The variable \t{ED} is defined as in Table~\ref{tab:defined_vars}
262
	and depends on the use of an offset-prefix.  When such offset-prefix
263
	is absent, \t{ED} is equivalent to \t{D}.  \t{ED} was introduced in
264
	EAPI 3, hence in prior EAPIs, \t{D} should be used instead of \t{ED}
265
	in the command given in Listing~\ref{lst:einstall}.
254
\begin{listing}[H]
266
\begin{listing}[H]
255
  \caption{einstall command}\label{lst:einstall}
267
  \caption{einstall command}\label{lst:einstall}
256
  \begin{verbatim}
268
  \begin{verbatim}
257
emake \
269
emake \
258
   prefix="${D}"/usr \
270
   prefix="${ED}"/usr \
259
   mandir="${D}"/usr/share/man \
271
   mandir="${ED}"/usr/share/man \
260
   infodir="${D}"/usr/share/info \
272
   infodir="${ED}"/usr/share/info \
261
   libdir="${D}"/usr/$(get_libdir) \
273
   libdir="${ED}"/usr/$(get_libdir) \
262
   "$@" \
274
   "$@" \
263
   install
275
   install
264
  \end{verbatim}
276
  \end{verbatim}
Lines 269-275 emake \ Link Here
269
\subsubsection{Installation commands}
281
\subsubsection{Installation commands}
270
These commands are used to install files into the staging area, in cases where the package's \t{make
282
These commands are used to install files into the staging area, in cases where the package's \t{make
271
install} target cannot be used or does not install all needed files. Except where otherwise stated,
283
install} target cannot be used or does not install all needed files. Except where otherwise stated,
272
all filenames created or modified are relative to the staging directory, given by \t{D}. These
284
all filenames created or modified are relative to the staging directory,
285
given by \t{ED} for EAPI 3, and \t{D} for EAPIs prior to EAPI 3.  These
273
commands must all be external programs and not bash functions or aliases---that is, they must be
286
commands must all be external programs and not bash functions or aliases---that is, they must be
274
callable from \t{xargs}. Ebuilds must not run any of these commands once the current phase function
287
callable from \t{xargs}. Ebuilds must not run any of these commands once the current phase function
275
has returned.
288
has returned.
Lines 278-283 has returned. Link Here
278
\item[dobin] Installs the given files into \t{DESTTREE/bin}, where \t{DESTTREE} defaults to
291
\item[dobin] Installs the given files into \t{DESTTREE/bin}, where \t{DESTTREE} defaults to
279
    \t{/usr}. Gives the files mode \t{0755} and ownership \t{root:root}. Failure behaviour is EAPI
292
    \t{/usr}. Gives the files mode \t{0755} and ownership \t{root:root}. Failure behaviour is EAPI
280
    dependent as per section~\ref{sec:failure-behaviour}.
293
    dependent as per section~\ref{sec:failure-behaviour}.
294
% todo: Portage does not behave like this, and Prefix relies on that
295
%       root:root -> 0:0 (for systems where root name/group are different)
296
%       PORTAGE_INST_UID:PORTAGE_INST_GID <- Prefix sets that to user ids
281
297
282
\item[doconfd] Installs the given config files into \t{/etc/conf.d/}, by default with file mode
298
\item[doconfd] Installs the given config files into \t{/etc/conf.d/}, by default with file mode
283
    \t{0644}. This can be overridden by setting \t{INSOPTIONS} with the \t{insopts} function.
299
    \t{0644}. This can be overridden by setting \t{INSOPTIONS} with the \t{insopts} function.
Lines 323-329 that can be passed to \t{dohtml} are as follows: Link Here
323
    \item{\t{-f}} --- list of files that are able to be installed.
339
    \item{\t{-f}} --- list of files that are able to be installed.
324
    \item{\t{-x}} --- list of directories that files will not be installed from (only used in
340
    \item{\t{-x}} --- list of directories that files will not be installed from (only used in
325
    conjunction with \t{-r}).
341
    conjunction with \t{-r}).
326
    \item{\t{-p}} --- sets a document prefix for installed files.
342
    \item{\t{-p}} --- sets a document prefix for installed files, not to
343
	be confused with the global offset-prefix.
327
    \end{description}
344
    \end{description}
328
345
329
    Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}.
346
    Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}.
Lines 569-575 that can be passed to \t{dohtml} are as follows: Link Here
569
}
586
}
570
587
571
\subsubsection{Commands affecting install destinations}
588
\subsubsection{Commands affecting install destinations}
572
The following commands are used to set the various destination trees, all relative to \t{\$\{D\}},
589
The following commands are used to set the various destination trees,
590
all relative to \t{\$\{ED\}} in EAPI 3 and relative to \t{\$\{D\}} in
591
prior EAPIs,
573
used by the above installation commands. They must be shell functions or aliases, due to the need to
592
used by the above installation commands. They must be shell functions or aliases, due to the need to
574
set variables read by the above commands. Ebuilds must not run any of these commands once the
593
set variables read by the above commands. Ebuilds must not run any of these commands once the
575
current phase function has returned.
594
current phase function has returned.
Lines 577-583 current phase function has returned. Link Here
577
\begin{description}
596
\begin{description}
578
597
579
\item[into] Sets the value of \t{DESTTREE} for future invocations of the above utilities.  Creates
598
\item[into] Sets the value of \t{DESTTREE} for future invocations of the above utilities.  Creates
580
the directory under \t{\$\{D\}}, using \t{install -d} with no additional options, if it does not
599
the directory under \t{\$\{ED\}} for EAPI 3 or \t{\$\{D\}} for prior
600
EAPIs, using \t{install -d} with no additional options, if it does not
581
already exist. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}.
601
already exist. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}.
582
602
583
\item[insinto] Sets the value of \t{INSDESTTREE} for future invocations of the above utilities. May
603
\item[insinto] Sets the value of \t{INSDESTTREE} for future invocations of the above utilities. May
Lines 603-609 already exist. Failure behaviour is EAPI dependent as per section~\ref{sec:failu Link Here
603
623
604
\featurelabel{controllable-compress} In EAPIs listed in table~\ref{tab:compression-table} as
624
\featurelabel{controllable-compress} In EAPIs listed in table~\ref{tab:compression-table} as
605
supporting controllable compression, the package manager may optionally compress a subset of the
625
supporting controllable compression, the package manager may optionally compress a subset of the
606
files under the \t{D} directory. To control which directories may or may not be compressed, the
626
files under the \t{ED} for EAPI 3 and \t{D} for prior EAPIs directory. To control which directories may or may not be compressed, the
607
package manager shall maintain two lists:
627
package manager shall maintain two lists:
608
628
609
\begin{compactitem}
629
\begin{compactitem}
Lines 614-620 package manager shall maintain two lists: Link Here
614
634
615
The optional compression shall be carried out after \t{src\_install} has completed, and before the
635
The optional compression shall be carried out after \t{src\_install} has completed, and before the
616
execution of any subsequent phase function. For each item in the inclusion list, pretend it has the
636
execution of any subsequent phase function. For each item in the inclusion list, pretend it has the
617
value of the \t{D} variable prepended, then:
637
value of the \t{ED} variable in EAPI 3 or the \t{D} variable in prior
638
EAPIs prepended, then:
618
639
619
\begin{compactitem}
640
\begin{compactitem}
620
\item If it is a directory, act as if every file or directory immediately under this directory
641
\item If it is a directory, act as if every file or directory immediately under this directory
Lines 624-630 value of the \t{D} variable prepended, then: Link Here
624
\end{compactitem}
645
\end{compactitem}
625
646
626
Whether an item is to be excluded is determined as follows: For each item in the exclusion list,
647
Whether an item is to be excluded is determined as follows: For each item in the exclusion list,
627
pretend it has the value of the \t{D} variable prepended, then:
648
pretend it has the value of the \t{ED} variable in EAPI 3 or the \t{D}
649
variable in prior EAPIs prepended, then:
628
650
629
\begin{compactitem}
651
\begin{compactitem}
630
\item If it is a directory, act as if every file or directory immediately under this directory
652
\item If it is a directory, act as if every file or directory immediately under this directory
Lines 753-761 has returned. Link Here
753
775
754
\begin{description}
776
\begin{description}
755
\item[dosed] Takes any number of arguments, which can be files or \t{sed} expressions. For each
777
\item[dosed] Takes any number of arguments, which can be files or \t{sed} expressions. For each
756
    argument, if it names, relative to \t{D} a file which exists, then \t{sed} is run with the
778
    argument, if it names, relative to \t{ED} (EAPI 3) or \t{D} (EAPIs
779
	prior to 3) a file which exists, then \t{sed} is run with the
757
    current expression on that file. Otherwise, the current expression is set to the text of the
780
    current expression on that file. Otherwise, the current expression is set to the text of the
758
    argument. The initial value of the expression is \t{s:\$\{D\}::g}. In EAPIs listed in
781
    argument. The initial value of the expression is \t{s:\$\{ED\}::g}
782
	in EAPI 3 and \t{s:\$\{D\}::g} in prior EAPIs. In EAPIs listed in
759
    table~\ref{tab:banned-commands-table}, this command is banned as per
783
    table~\ref{tab:banned-commands-table}, this command is banned as per
760
    section~\ref{sec:banned-commands}. Failure behaviour is EAPI dependent as per
784
    section~\ref{sec:banned-commands}. Failure behaviour is EAPI dependent as per
761
    section~\ref{sec:failure-behaviour}.
785
    section~\ref{sec:failure-behaviour}.
Lines 788-793 has returned. Link Here
788
    \item LHA archives (\t{*.LHA, *.LHa, *.lha, *.lhz}). Ebuilds must ensure that the lha program is
812
    \item LHA archives (\t{*.LHA, *.LHa, *.lha, *.lhz}). Ebuilds must ensure that the lha program is
789
    installed.
813
    installed.
790
    \item ar archives (\t{*.a, *.deb}). Ebuilds must ensure that GNU binutils is installed.
814
    \item ar archives (\t{*.a, *.deb}). Ebuilds must ensure that GNU binutils is installed.
815
% todo: Portage's implementation is different and required for Prefix
816
%       these files are unpacked with deb2targz if available, else it
817
%       falls back to "ar", which cannot be required to be GNU binutils
791
    \item lzma-compressed files (\t{*.lzma}). Ebuilds must ensure that LZMA Utils is installed.
818
    \item lzma-compressed files (\t{*.lzma}). Ebuilds must ensure that LZMA Utils is installed.
792
    \item lzma-compressed tar files (\t{*.tar.lzma}). Ebuilds must ensure that LZMA Utils and
819
    \item lzma-compressed tar files (\t{*.tar.lzma}). Ebuilds must ensure that LZMA Utils and
793
        GNU tar are installed.
820
        GNU tar are installed.

Return to bug 296716