
\begin{DoxyItemize}
\item infos = Information about the blockresolver plugin is in keys below
\item infos/author = Name \href{mailto:name@libelektra.org}{\tt name@libelektra.\+org}
\item infos/licence = B\+S\+D
\item infos/needs =
\item infos/provides = resolver
\item infos/recommends =
\item infos/placements = rollback getresolver setresolver commit
\item infos/status = maintained conformant compatible coverage specific unittest tested nodep libc configurable preview experimental difficult unfinished concept
\item infos/metadata =
\item infos/description = resolver for parts in a file configuration file
\end{DoxyItemize}

The {\ttfamily blockresolver} can be used to only resolve a tagged block inside a configuration file.

\subsubsection*{Implementation details}

{\ttfamily blockresolver} extracts the requested block from the configurations file and writes it into a temporary file. Afterwards Elektra will only work on the temporary file until kdb\+Set is called. On kdb\+Set the contents of the temporary file will be merged with parts outside of the requested block from the original file.

\subsection*{Usage}

\begin{DoxyVerb}`kdb mount -R blockresolver /path/to/my/file /mountpoint -c identifier="identifier-tag"`
\end{DoxyVerb}


where {\ttfamily identifier} specifies the tag {\ttfamily blockresolver} will search for in the configuration file.

A block consists of 2 parts\+:
\begin{DoxyItemize}
\item beginning\+: the identifier suffixed with {\ttfamily start}
\item end\+: the identifier suffixed with {\ttfamily stop}
\end{DoxyItemize}

\subsection*{Limitations}

Currently the identifier must be unique.

\subsection*{Example}

``` \section*{Backup-\/and-\/\+Restore\+:system/examples/blockresolver}

sudo kdb mount -\/\+R blockresolver /tmp/test.block system/examples/blockresolver -\/c identifier=\char`\"{}$>$$>$$>$ block config\char`\"{} ini \# \section*{create testfile}

\# \$ echo \char`\"{}text\char`\"{} $>$ /tmp/test.block \$ echo \char`\"{}more text\char`\"{} $>$$>$ /tmp/test.block \$ echo \char`\"{}some more text\char`\"{} $>$$>$ /tmp/test.block \$ echo \char`\"{}$>$$>$$>$ block config start\char`\"{} $>$$>$ /tmp/test.block \$ echo \char`\"{}\mbox{[}section1\mbox{]}\char`\"{} $>$$>$ /tmp/test.block \$ echo \char`\"{}key1 = val1\char`\"{} $>$$>$ /tmp/test.block \$ echo \char`\"{}\mbox{[}section2\mbox{]}\char`\"{} $>$$>$ /tmp/test.block \$ echo \char`\"{}key2 = val2\char`\"{} $>$$>$ /tmp/test.block \$ echo \char`\"{}$>$$>$$>$ block config stop\char`\"{} $>$$>$ /tmp/test.block \$ echo \char`\"{}text again\char`\"{} $>$$>$ /tmp/test.block \$ echo \char`\"{}and more text\char`\"{} $>$$>$ /tmp/test.block \$ echo \char`\"{}text\char`\"{} $>$$>$ /tmp/test.block \# \section*{check testfile}

\# \$ cat /tmp/test.block text more text some more text \begin{quote}
\begin{quote}
\begin{quote}
block config start \end{quote}
\end{quote}
\end{quote}
\mbox{[}section1\mbox{]} key1 = val1 \mbox{[}section2\mbox{]} key2 = val2 \begin{quote}
\begin{quote}
\begin{quote}
block config stop \end{quote}
\end{quote}
\end{quote}
text again and more text text \# \section*{only the block between the tags is read!}

\# kdb export system/examples/blockresolver ini \mbox{[}section1\mbox{]} key1 = val1 \mbox{[}section2\mbox{]} key2 = val2 \# \section*{add a new key to the resolved block}

\# kdb set system/examples/blockresolver/section1/key12 val12 \# \$ cat /tmp/test.block text more text some more text \begin{quote}
\begin{quote}
\begin{quote}
block config start \end{quote}
\end{quote}
\end{quote}
\mbox{[}section1\mbox{]} key1 = val1 key12 = val12 \mbox{[}section2\mbox{]} key2 = val2 \begin{quote}
\begin{quote}
\begin{quote}
block config stop \end{quote}
\end{quote}
\end{quote}
text again and more text text \# \section*{cleanup}

\# kdb rm -\/r system/examples/blockresolver sudo kdb umount system/examples/blockresolver ``` 