Skip to content

Commit

Permalink
Improve metadata section
Browse files Browse the repository at this point in the history
  • Loading branch information
raphink committed Jun 6, 2012
1 parent 9b106b2 commit 8ef5046
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 19 deletions.
48 changes: 29 additions & 19 deletions en/chapters/metadata.tex
Expand Up @@ -6,7 +6,7 @@ \chapter{Augeas metadata}

We have seen earlier that the \nolinkurl{/augeas} top node exposes Augeas metadata which can be parsed and modified in the same fashion as the \nolinkurl{/files} data. This chapter will focus on documenting the various parts of the \nolinkurl{/augeas} tree and their functions.

\section{The root node}
\section{The \texttt{/augeas/root} node}

\index{Metadata!\slash{}augeas\slash{}root} \index{augtool!options!--root} \index{Environment variables!\textsc{augeas\_root}}

Expand All @@ -20,15 +20,15 @@ \section{The root node}
\consolecode|$ augtool --root fakeroot|
\augtoolshcode|augtool> print /augeas/root|
\augtoolshcode|/augeas/root = "fakeroot/"|
\caption{Inspecting /augeas/root}
\caption{Inspecting \nolinkurl{/augeas/root}}
\label{lst:metadata_root}
\end{listing}
\begin{quote}
\info{As of Augeas 0.8.0, this node is purely informative: changing its value has no effect on the way Augeas works.}
\end{quote}
\section{The version tree}
\section{The \texttt{/augeas/version} tree}
\index{Metadata!\slash{}augeas\slash{}version}
Expand All @@ -40,37 +40,47 @@ \section{The version tree}
\item
The \verb!save! node contains \verb!mode! nodes which list the known saving modes for this version of Augeas;
\item
The \verb!defvar! node contains \textbf{what exactly??}.
The presence of the \verb!defvar! node indicates whether \verb!defvar! and \verb!defnode! are supported;
\item
The \verb!pathx! tree indicates which XPath functions\footnote{\seeref{sec:xpath_functions}.} are supported.
\end{itemize}
\index{Commands!print}
\begin{listing}
\begin{augtoolsh}[]
augtool> print /augeas/version/
/augeas/version = "0.8.0"
/augeas/version = "0.10.0"
/augeas/version/save
/augeas/version/save/mode[1] = "backup"
/augeas/version/save/mode[2] = "newfile"
/augeas/version/save/mode[3] = "noop"
/augeas/version/save/mode[4] = "overwrite"
/augeas/version/defvar
/augeas/version/defvar/expr
/augeas/version/pathx
/augeas/version/pathx/functions
/augeas/version/pathx/functions/count
/augeas/version/pathx/functions/glob
/augeas/version/pathx/functions/label
/augeas/version/pathx/functions/last
/augeas/version/pathx/functions/position
/augeas/version/pathx/functions/regexp
\end{augtoolsh}
\caption{Inspecting /augeas/version}
\caption{Inspecting \nolinkurl{/augeas/version}}
\label{lst:metadata_version}
\end{listing}
\section{The save node}
\section{The \texttt{/augeas/save node}}
\label{sec:save_node} \index{Metadata!\slash{}augeas\slash{}save}
The \nolinkurl{/augeas/save} node contains the saving mode used by Augeas for the session. The value of this node must be one of the values listed in the \nolinkurl{/augeas/version/save/mode} nodes.
If this node is modified during the session, it will affect the behaviour of the \verb!save! call whenever it is executed.
\section{The load tree}
\section{The \texttt{/augeas/load} tree}
\index{Metadata!\slash{}augeas\slash{}load}
Expand Down Expand Up @@ -121,7 +131,7 @@ \subsection{Using only one lens}
\consolecode|$ augtool --noautoload|
\augtoolshcode|augtool> print /augeas/load|
\augtoolshcode|/augeas/load|
\caption{The effect of --noautoload on /augeas/load}
\caption{The effect of \texttt{--noautoload} on \nolinkurl{/augeas/load}}
\label{lst:metadata_noautoload}
\end{listing}

Expand All @@ -146,7 +156,7 @@ \subsection{Using only one lens}
/augeas/load/Fstab/lens = "Fstab.lns"
/augeas/load/Fstab/incl = "/etc/fstab"
\end{augtoolsh}
\caption{Setting the Fstab lens manually in /augeas/load}
\caption{Setting the Fstab lens manually in \nolinkurl{/augeas/load}}
\label{lst:metadata_setting_lens_manually}
\end{listing}

Expand Down Expand Up @@ -192,27 +202,27 @@ \subsection{Parsing a specific file}
\info{This technique can be combined with the above to load only the \texttt{Json} module}
\end{quote}
\section{The files tree}
\section{The \texttt{/augeas/files} tree}
\index{Metadata!\slash{}augeas\slash{}files|(}
The \nolinkurl{/augeas/files} provides metadata about the files parsed by Augeas. The paths in this tree mirror thoses of the \nolinkurl{/files} tree.
For each file, the following nodes may be present.
\subsection{The path node}
\subsection{The \texttt{path} node}
\verb!path! is the path to the file data in the \nolinkurl{/files} tree.
\subsection{The mtime node}
\subsection{The \texttt{mtime} node}
\verb!mtime! is the last modification time of the file when it was read. Augeas uses this information internaly to speed up loading of files. Only the files whose modification time has changed are read again when \verb!aug_load! is called.
\subsection{The lens tree}
\subsection{The \texttt{lens} tree}
The \verb!lens! tree indicates the lens used to parse this file, as specified in the \nolinkurl{/augeas/load} tree (see above). The \verb!lens/info! node gives the path to the lens module (physically), as well as the position of the lens declaration in the file.
\subsection{The error tree}
\subsection{The \texttt{error} tree}
When Augeas fails to parse a file, the parsing error is listed here.
Expand Down Expand Up @@ -264,7 +274,7 @@ \subsection{Example}
\index{Metadata!\slash{}augeas\slash{}files|)}
\section{The variables tree}
\section{The \texttt{/augeas/variables} tree}
\index{Metadata!\slash{}augeas\slash{}variables} \index{Path expressions!variables!defvar}
Expand All @@ -281,15 +291,15 @@ \section{The variables tree}
/augeas/variables
/augeas/variables/l = "/augeas/files/etc/ldap.conf"
\end{augtoolsh}
\caption{Defined variables are listed in /augeas/variables}
\caption{Defined variables are listed in \nolinkurl{/augeas/variables}}
\label{lst:metadata_defvar}
\end{listing}
\begin{quote}
\info{As of Augeas 0.8.0, this node is purely informative: changing its value has no effect on the way Augeas works.}
\info{As of Augeas 0.10.0, this node is purely informative: changing its value has no effect on the way Augeas works.}
\end{quote}
\section{The span node}
\section{The \texttt{/augeas/span} node}
\label{sec:span_node} \index{Metadata!\slash{}augeas\slash{}span} \index{augtool!options!--span} \index{Flags!\textsc{aug\_enable\_span}}
Expand Down
2 changes: 2 additions & 0 deletions en/chapters/path_expressions.tex
Expand Up @@ -75,6 +75,8 @@ \section{Union of paths}

\section{Functions}

\label{sec:xpath_functions}

\index{Path expressions!functions|(}

To enrich the filtering you can achieve with conditionals, Augeas provides a set of functions which can be used in conditional context.
Expand Down

0 comments on commit 8ef5046

Please sign in to comment.