--- Makefile | 4 +--- appendices.tex | 12 ++++++++++-- ebuild-env-state.tex | 32 ++++++++++++++++++++++++++++++-- eclasses.tex | 6 +++--- env-saving.listing | 27 --------------------------- if-else-use.listing | 7 ------- pkg-mgr-commands.tex | 7 ++++--- 7 files changed, 48 insertions(+), 47 deletions(-) delete mode 100644 env-saving.listing delete mode 100644 if-else-use.listing diff --git a/Makefile b/Makefile index a20f5ec..83a6f51 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,7 @@ clean : maintainer-clean: clean rm -f vc.tex -LATEXFILES := $(filter-out vc.tex,$(wildcard *.tex)) pms.cls -LISTINGFILES := $(wildcard *.listing) -SOURCEFILES = $(LATEXFILES) $(LISTINGFILES) +SOURCEFILES := $(filter-out vc.tex,$(wildcard *.tex)) pms.cls pms.pdf: $(SOURCEFILES) pms.bbl vc.tex eapi-cheatsheet.pdf @# latex chokes on aux files produced by tex4ht, so remove them diff --git a/appendices.tex b/appendices.tex index eb51dc9..0e64bc5 100644 --- a/appendices.tex +++ b/appendices.tex @@ -39,8 +39,16 @@ was met, and the block after the colon would be taken if the condition was not m This feature was deprecated and removed from the tree long before the introduction of \t{EAPI}. \begin{listing} - \caption{If-else use blocks}\label{lst:if-else-use-listing} - \verbatiminput{if-else-use.listing} +\caption{If-else use blocks} \label{lst:if-else-use-listing} +\begin{verbatim} +DEPEND=" + flag? ( + taken/if-true + ) : ( + taken/if-false + ) + " +\end{verbatim} \end{listing} \section{cvs Versions} diff --git a/ebuild-env-state.tex b/ebuild-env-state.tex index 4bc80c7..3ddd1ab 100644 --- a/ebuild-env-state.tex +++ b/ebuild-env-state.tex @@ -20,8 +20,36 @@ 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} +\caption{Environment state between functions} \label{lst:env-saving} +\begin{verbatim} +GLOBAL_VARIABLE="a" + +src_compile() +{ + GLOBAL_VARIABLE="b" + DEFAULT_VARIABLE="c" + export EXPORTED_VARIABLE="d" + local LOCAL_VARIABLE="e" +} + +src_install(){ + [[ ${GLOBAL_VARIABLE} == "a" ]] \ + || [[ ${GLOBAL_VARIABLE} == "b" ]] \ + || die "broken env saving for globals" + + [[ ${DEFAULT_VARIABLE} == "c" ]] \ + || die "broken env saving for default" + + [[ ${EXPORTED_VARIABLE} == "d" ]] \ + || die "broken env saving for exported" + + [[ $(printenv EXPORTED_VARIABLE ) == "d" ]] \ + || die "broken env saving for exported" + + [[ -z ${LOCAL_VARIABLE} ]] \ + || die "broken env saving for locals" +} +\end{verbatim} \end{listing} % vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en : diff --git a/eclasses.tex b/eclasses.tex index 24ff77f..0f172f7 100644 --- a/eclasses.tex +++ b/eclasses.tex @@ -49,8 +49,8 @@ call the eclass-defined version from it. The use of it is best illustrated by an given in listing~\ref{lst:export-functions} and is a snippet from a hypothetical \t{foo.eclass}. \begin{listing} - \caption{EXPORT\_FUNCTIONS example: foo.eclass}\label{lst:export-functions} - \begin{verbatim} +\caption{EXPORT\_FUNCTIONS example: foo.eclass} \label{lst:export-functions} +\begin{verbatim} foo_src_compile() { econf --enable-gerbil \ @@ -60,7 +60,7 @@ foo_src_compile() } EXPORT_FUNCTIONS src_compile - \end{verbatim} +\end{verbatim} \end{listing} This example defines an eclass \t{src\_compile} function and uses \t{EXPORT\_FUNCTIONS} to alias diff --git a/env-saving.listing b/env-saving.listing deleted file mode 100644 index 1650aa7..0000000 --- a/env-saving.listing +++ /dev/null @@ -1,27 +0,0 @@ -GLOBAL_VARIABLE="a" - -src_compile() -{ - GLOBAL_VARIABLE="b" - DEFAULT_VARIABLE="c" - export EXPORTED_VARIABLE="d" - local LOCAL_VARIABLE="e" -} - -src_install(){ - [[ ${GLOBAL_VARIABLE} == "a" ]] \ - || [[ ${GLOBAL_VARIABLE} == "b" ]] \ - || die "broken env saving for globals" - - [[ ${DEFAULT_VARIABLE} == "c" ]] \ - || die "broken env saving for default" - - [[ ${EXPORTED_VARIABLE} == "d" ]] \ - || die "broken env saving for exported" - - [[ $(printenv EXPORTED_VARIABLE ) == "d" ]] \ - || die "broken env saving for exported" - - [[ -z ${LOCAL_VARIABLE} ]] \ - || die "broken env saving for locals" -} diff --git a/if-else-use.listing b/if-else-use.listing deleted file mode 100644 index 83a2ae8..0000000 --- a/if-else-use.listing +++ /dev/null @@ -1,7 +0,0 @@ -DEPEND=" - flag? ( - taken/if-true - ) : ( - taken/if-false - ) - " diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex index 83fbd68..d7347fe 100644 --- a/pkg-mgr-commands.tex +++ b/pkg-mgr-commands.tex @@ -224,9 +224,10 @@ current phase function has returned. \t{D} instead of \t{ED} in the command given in Listing~\ref{lst:einstall}. Variable \t{libdir} is an auxiliary local variable whose value is determined by Algorithm~\ref{alg:ebuild-libdir}. + \begin{listing}[H] - \caption{einstall command}\label{lst:einstall} - \begin{verbatim} +\caption{einstall command} \label{lst:einstall} +\begin{verbatim} emake \ prefix="${ED}"/usr \ datadir="${ED}"/usr/share \ @@ -238,7 +239,7 @@ emake \ -j1 \ "$@" \ install - \end{verbatim} +\end{verbatim} \end{listing} \end{description} -- 2.6.2