Gentoo Archives: gentoo-commits

From: "André Erdmann" <dywi@×××××××.de>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/R_overlay:master commit in: doc/html/
Date: Sun, 30 Jun 2013 15:58:19
Message-Id: 1372267741.664ec1f39a920328e3ca4cf7f5f091eaa55d51d0.dywi@gentoo
1 commit: 664ec1f39a920328e3ca4cf7f5f091eaa55d51d0
2 Author: André Erdmann <dywi <AT> mailerd <DOT> de>
3 AuthorDate: Wed Jun 26 17:29:01 2013 +0000
4 Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
5 CommitDate: Wed Jun 26 17:29:01 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=664ec1f3
7
8 doc/html: "run hooks", "distmap"
9
10 ---
11 doc/html/usage.html | 667 +++++++++++++++++++++++++++++++++++++++++++++-------
12 1 file changed, 586 insertions(+), 81 deletions(-)
13
14 diff --git a/doc/html/usage.html b/doc/html/usage.html
15 index 9206894..c4d90fc 100644
16 --- a/doc/html/usage.html
17 +++ b/doc/html/usage.html
18 @@ -361,88 +361,102 @@ ul.auto-toc {
19 <li><a class="reference internal" href="#getting-packages-from-a-repository-that-supports-http-only" id="id24">5.3&nbsp;&nbsp;&nbsp;Getting packages from a repository that supports http only</a></li>
20 <li><a class="reference internal" href="#getting-packages-from-several-remotes-using-http-and-a-package-list" id="id25">5.4&nbsp;&nbsp;&nbsp;Getting packages from several remotes using http and a package list</a></li>
21 <li><a class="reference internal" href="#using-local-directories" id="id26">5.5&nbsp;&nbsp;&nbsp;Using local directories</a></li>
22 +<li><a class="reference internal" href="#distmap" id="id27">5.6&nbsp;&nbsp;&nbsp;distmap</a></li>
23 </ul>
24 </li>
25 -<li><a class="reference internal" href="#additions-directory" id="id27">6&nbsp;&nbsp;&nbsp;Additions Directory</a><ul class="auto-toc">
26 -<li><a class="reference internal" href="#patching-ebuilds" id="id28">6.1&nbsp;&nbsp;&nbsp;Patching ebuilds</a></li>
27 -<li><a class="reference internal" href="#importing-ebuilds" id="id29">6.2&nbsp;&nbsp;&nbsp;Importing ebuilds</a></li>
28 +<li><a class="reference internal" href="#additions-directory" id="id28">6&nbsp;&nbsp;&nbsp;Additions Directory</a><ul class="auto-toc">
29 +<li><a class="reference internal" href="#patching-ebuilds" id="id29">6.1&nbsp;&nbsp;&nbsp;Patching ebuilds</a></li>
30 +<li><a class="reference internal" href="#importing-ebuilds" id="id30">6.2&nbsp;&nbsp;&nbsp;Importing ebuilds</a></li>
31 </ul>
32 </li>
33 -<li><a class="reference internal" href="#dependency-rules" id="id30">7&nbsp;&nbsp;&nbsp;Dependency Rules</a><ul class="auto-toc">
34 -<li><a class="reference internal" href="#simple-dependency-rules" id="id31">7.1&nbsp;&nbsp;&nbsp;Simple Dependency Rules</a><ul class="auto-toc">
35 -<li><a class="reference internal" href="#rule-variants" id="id32">7.1.1&nbsp;&nbsp;&nbsp;Rule Variants</a></li>
36 -<li><a class="reference internal" href="#rule-types" id="id33">7.1.2&nbsp;&nbsp;&nbsp;Rule types</a></li>
37 -<li><a class="reference internal" href="#rule-file-examples" id="id34">7.1.3&nbsp;&nbsp;&nbsp;Rule File Examples</a></li>
38 -<li><a class="reference internal" href="#rule-file-syntax" id="id35">7.1.4&nbsp;&nbsp;&nbsp;Rule File Syntax</a></li>
39 +<li><a class="reference internal" href="#dependency-rules" id="id31">7&nbsp;&nbsp;&nbsp;Dependency Rules</a><ul class="auto-toc">
40 +<li><a class="reference internal" href="#simple-dependency-rules" id="id32">7.1&nbsp;&nbsp;&nbsp;Simple Dependency Rules</a><ul class="auto-toc">
41 +<li><a class="reference internal" href="#rule-variants" id="id33">7.1.1&nbsp;&nbsp;&nbsp;Rule Variants</a></li>
42 +<li><a class="reference internal" href="#rule-types" id="id34">7.1.2&nbsp;&nbsp;&nbsp;Rule types</a></li>
43 +<li><a class="reference internal" href="#rule-file-examples" id="id35">7.1.3&nbsp;&nbsp;&nbsp;Rule File Examples</a></li>
44 +<li><a class="reference internal" href="#rule-file-syntax" id="id36">7.1.4&nbsp;&nbsp;&nbsp;Rule File Syntax</a></li>
45 </ul>
46 </li>
47 </ul>
48 </li>
49 -<li><a class="reference internal" href="#package-rules" id="id36">8&nbsp;&nbsp;&nbsp;Package Rules</a><ul class="auto-toc">
50 -<li><a class="reference internal" href="#package-rule-file-syntax" id="id37">8.1&nbsp;&nbsp;&nbsp;Package Rule File Syntax</a><ul class="auto-toc">
51 -<li><a class="reference internal" href="#match-blocks" id="id38">8.1.1&nbsp;&nbsp;&nbsp;Match Blocks</a><ul class="auto-toc">
52 -<li><a class="reference internal" href="#extended-match-block-syntax" id="id39">8.1.1.1&nbsp;&nbsp;&nbsp;Extended Match Block Syntax</a></li>
53 +<li><a class="reference internal" href="#package-rules" id="id37">8&nbsp;&nbsp;&nbsp;Package Rules</a><ul class="auto-toc">
54 +<li><a class="reference internal" href="#package-rule-file-syntax" id="id38">8.1&nbsp;&nbsp;&nbsp;Package Rule File Syntax</a><ul class="auto-toc">
55 +<li><a class="reference internal" href="#match-blocks" id="id39">8.1.1&nbsp;&nbsp;&nbsp;Match Blocks</a><ul class="auto-toc">
56 +<li><a class="reference internal" href="#extended-match-block-syntax" id="id40">8.1.1.1&nbsp;&nbsp;&nbsp;Extended Match Block Syntax</a></li>
57 </ul>
58 </li>
59 -<li><a class="reference internal" href="#action-blocks" id="id40">8.1.2&nbsp;&nbsp;&nbsp;Action Blocks</a><ul class="auto-toc">
60 -<li><a class="reference internal" href="#extended-action-block-syntax" id="id41">8.1.2.1&nbsp;&nbsp;&nbsp;Extended Action Block Syntax</a></li>
61 +<li><a class="reference internal" href="#action-blocks" id="id41">8.1.2&nbsp;&nbsp;&nbsp;Action Blocks</a><ul class="auto-toc">
62 +<li><a class="reference internal" href="#extended-action-block-syntax" id="id42">8.1.2.1&nbsp;&nbsp;&nbsp;Extended Action Block Syntax</a></li>
63 </ul>
64 </li>
65 -<li><a class="reference internal" href="#package-rule-examples" id="id42">8.1.3&nbsp;&nbsp;&nbsp;Package Rule Examples</a></li>
66 +<li><a class="reference internal" href="#package-rule-examples" id="id43">8.1.3&nbsp;&nbsp;&nbsp;Package Rule Examples</a></li>
67 </ul>
68 </li>
69 </ul>
70 </li>
71 -<li><a class="reference internal" href="#configuration-reference" id="id43">9&nbsp;&nbsp;&nbsp;Configuration Reference</a><ul class="auto-toc">
72 -<li><a class="reference internal" href="#misc-options" id="id44">9.1&nbsp;&nbsp;&nbsp;misc options</a></li>
73 -<li><a class="reference internal" href="#overlay-options" id="id45">9.2&nbsp;&nbsp;&nbsp;overlay options</a></li>
74 -<li><a class="reference internal" href="#other-config-files" id="id46">9.3&nbsp;&nbsp;&nbsp;other config files</a></li>
75 -<li><a class="reference internal" href="#logging" id="id47">9.4&nbsp;&nbsp;&nbsp;logging</a><ul class="auto-toc">
76 -<li><a class="reference internal" href="#console-logging" id="id48">9.4.1&nbsp;&nbsp;&nbsp;console logging</a></li>
77 -<li><a class="reference internal" href="#file-logging" id="id49">9.4.2&nbsp;&nbsp;&nbsp;file logging</a></li>
78 +<li><a class="reference internal" href="#event-hooks" id="id44">9&nbsp;&nbsp;&nbsp;Event Hooks</a><ul class="auto-toc">
79 +<li><a class="reference internal" href="#default-event-script" id="id45">9.1&nbsp;&nbsp;&nbsp;Default event script</a><ul class="auto-toc">
80 +<li><a class="reference internal" href="#activating-a-hook-script" id="id46">9.1.1&nbsp;&nbsp;&nbsp;Activating a hook script</a></li>
81 +<li><a class="reference internal" href="#adding-a-new-hook-script" id="id47">9.1.2&nbsp;&nbsp;&nbsp;Adding a new hook script</a></li>
82 </ul>
83 </li>
84 -<li><a class="reference internal" href="#options-for-debugging-manual-dependency-rule-creation-and-testing" id="id50">9.5&nbsp;&nbsp;&nbsp;options for debugging, manual dependency rule creation and testing</a></li>
85 +<li><a class="reference internal" href="#event-policy" id="id48">9.2&nbsp;&nbsp;&nbsp;Event Policy</a></li>
86 +<li><a class="reference internal" href="#hook-environment" id="id49">9.3&nbsp;&nbsp;&nbsp;Hook Environment</a></li>
87 +<li><a class="reference internal" href="#adding-a-function-file" id="id50">9.4&nbsp;&nbsp;&nbsp;Adding a function file</a></li>
88 +<li><a class="reference internal" href="#adding-a-hook-event" id="id51">9.5&nbsp;&nbsp;&nbsp;Adding a hook event</a></li>
89 </ul>
90 </li>
91 -<li><a class="reference internal" href="#id3" id="id51">10&nbsp;&nbsp;&nbsp;Other config files</a><ul class="auto-toc">
92 -<li><a class="reference internal" href="#use-expand-flag-rename-file" id="id52">10.1&nbsp;&nbsp;&nbsp;USE_EXPAND flag rename file</a></li>
93 -<li><a class="reference internal" href="#field-definition-config" id="id53">10.2&nbsp;&nbsp;&nbsp;Field Definition Config</a><ul class="auto-toc">
94 -<li><a class="reference internal" href="#example-the-default-field-definition-file" id="id54">10.2.1&nbsp;&nbsp;&nbsp;Example: The default field definition file</a></li>
95 +<li><a class="reference internal" href="#configuration-reference" id="id52">10&nbsp;&nbsp;&nbsp;Configuration Reference</a><ul class="auto-toc">
96 +<li><a class="reference internal" href="#misc-options" id="id53">10.1&nbsp;&nbsp;&nbsp;misc options</a></li>
97 +<li><a class="reference internal" href="#overlay-options" id="id54">10.2&nbsp;&nbsp;&nbsp;overlay options</a></li>
98 +<li><a class="reference internal" href="#other-config-files" id="id55">10.3&nbsp;&nbsp;&nbsp;other config files</a></li>
99 +<li><a class="reference internal" href="#shell-environment-hooks" id="id56">10.4&nbsp;&nbsp;&nbsp;shell environment / hooks</a></li>
100 +<li><a class="reference internal" href="#logging" id="id57">10.5&nbsp;&nbsp;&nbsp;logging</a><ul class="auto-toc">
101 +<li><a class="reference internal" href="#console-logging" id="id58">10.5.1&nbsp;&nbsp;&nbsp;console logging</a></li>
102 +<li><a class="reference internal" href="#file-logging" id="id59">10.5.2&nbsp;&nbsp;&nbsp;file logging</a></li>
103 </ul>
104 </li>
105 +<li><a class="reference internal" href="#options-for-debugging-manual-dependency-rule-creation-and-testing" id="id60">10.6&nbsp;&nbsp;&nbsp;options for debugging, manual dependency rule creation and testing</a></li>
106 </ul>
107 </li>
108 -<li><a class="reference internal" href="#dependency-resolution-console" id="id55">11&nbsp;&nbsp;&nbsp;Dependency Resolution Console</a></li>
109 -<li><a class="reference internal" href="#implementation-overview" id="id56">12&nbsp;&nbsp;&nbsp;Implementation Overview</a><ul class="auto-toc">
110 -<li><a class="reference internal" href="#packageinfo" id="id57">12.1&nbsp;&nbsp;&nbsp;PackageInfo</a></li>
111 -<li><a class="reference internal" href="#repository-management" id="id58">12.2&nbsp;&nbsp;&nbsp;Repository Management</a><ul class="auto-toc">
112 -<li><a class="reference internal" href="#repository" id="id59">12.2.1&nbsp;&nbsp;&nbsp;Repository</a><ul class="auto-toc">
113 -<li><a class="reference internal" href="#adding-new-repository-types" id="id60">12.2.1.1&nbsp;&nbsp;&nbsp;Adding new repository types</a></li>
114 +<li><a class="reference internal" href="#id3" id="id61">11&nbsp;&nbsp;&nbsp;Other config files</a><ul class="auto-toc">
115 +<li><a class="reference internal" href="#use-expand-flag-rename-file" id="id62">11.1&nbsp;&nbsp;&nbsp;USE_EXPAND flag rename file</a></li>
116 +<li><a class="reference internal" href="#field-definition-config" id="id63">11.2&nbsp;&nbsp;&nbsp;Field Definition Config</a><ul class="auto-toc">
117 +<li><a class="reference internal" href="#example-the-default-field-definition-file" id="id64">11.2.1&nbsp;&nbsp;&nbsp;Example: The default field definition file</a></li>
118 </ul>
119 </li>
120 </ul>
121 </li>
122 -<li><a class="reference internal" href="#overlay" id="id61">12.3&nbsp;&nbsp;&nbsp;Overlay</a><ul class="auto-toc">
123 -<li><a class="reference internal" href="#metadata-creation" id="id62">12.3.1&nbsp;&nbsp;&nbsp;Metadata Creation</a></li>
124 -<li><a class="reference internal" href="#manifest-creation" id="id63">12.3.2&nbsp;&nbsp;&nbsp;Manifest Creation</a></li>
125 +<li><a class="reference internal" href="#dependency-resolution-console" id="id65">12&nbsp;&nbsp;&nbsp;Dependency Resolution Console</a></li>
126 +<li><a class="reference internal" href="#implementation-overview" id="id66">13&nbsp;&nbsp;&nbsp;Implementation Overview</a><ul class="auto-toc">
127 +<li><a class="reference internal" href="#packageinfo" id="id67">13.1&nbsp;&nbsp;&nbsp;PackageInfo</a></li>
128 +<li><a class="reference internal" href="#repository-management" id="id68">13.2&nbsp;&nbsp;&nbsp;Repository Management</a><ul class="auto-toc">
129 +<li><a class="reference internal" href="#repository" id="id69">13.2.1&nbsp;&nbsp;&nbsp;Repository</a><ul class="auto-toc">
130 +<li><a class="reference internal" href="#adding-new-repository-types" id="id70">13.2.1.1&nbsp;&nbsp;&nbsp;Adding new repository types</a></li>
131 </ul>
132 </li>
133 -<li><a class="reference internal" href="#ebuild-creation" id="id64">12.4&nbsp;&nbsp;&nbsp;Ebuild Creation</a><ul class="auto-toc">
134 -<li><a class="reference internal" href="#ebuild-variables" id="id65">12.4.1&nbsp;&nbsp;&nbsp;Ebuild Variables</a></li>
135 </ul>
136 </li>
137 -<li><a class="reference internal" href="#overlay-creation" id="id66">12.5&nbsp;&nbsp;&nbsp;Overlay Creation</a></li>
138 -<li><a class="reference internal" href="#dependency-resolution" id="id67">12.6&nbsp;&nbsp;&nbsp;Dependency Resolution</a><ul class="auto-toc">
139 -<li><a class="reference internal" href="#dependency-types" id="id68">12.6.1&nbsp;&nbsp;&nbsp;Dependency types</a><ul class="auto-toc">
140 -<li><a class="reference internal" href="#description-file-dependency-fields" id="id69">12.6.1.1&nbsp;&nbsp;&nbsp;DESCRIPTION file dependency fields</a></li>
141 +<li><a class="reference internal" href="#overlay" id="id71">13.3&nbsp;&nbsp;&nbsp;Overlay</a><ul class="auto-toc">
142 +<li><a class="reference internal" href="#metadata-creation" id="id72">13.3.1&nbsp;&nbsp;&nbsp;Metadata Creation</a></li>
143 +<li><a class="reference internal" href="#manifest-creation" id="id73">13.3.2&nbsp;&nbsp;&nbsp;Manifest Creation</a></li>
144 </ul>
145 </li>
146 -<li><a class="reference internal" href="#dependency-environments" id="id70">12.6.2&nbsp;&nbsp;&nbsp;Dependency Environments</a></li>
147 -<li><a class="reference internal" href="#ebuildjob-channel" id="id71">12.6.3&nbsp;&nbsp;&nbsp;EbuildJob Channel</a></li>
148 -<li><a class="reference internal" href="#dependency-rule-pools" id="id72">12.6.4&nbsp;&nbsp;&nbsp;Dependency Rule Pools</a></li>
149 -<li><a class="reference internal" href="#dependency-resolver-modules" id="id73">12.6.5&nbsp;&nbsp;&nbsp;Dependency Resolver Modules</a></li>
150 -<li><a class="reference internal" href="#dependency-resolver" id="id74">12.6.6&nbsp;&nbsp;&nbsp;Dependency Resolver</a></li>
151 +<li><a class="reference internal" href="#ebuild-creation" id="id74">13.4&nbsp;&nbsp;&nbsp;Ebuild Creation</a><ul class="auto-toc">
152 +<li><a class="reference internal" href="#ebuild-variables" id="id75">13.4.1&nbsp;&nbsp;&nbsp;Ebuild Variables</a></li>
153 +</ul>
154 +</li>
155 +<li><a class="reference internal" href="#overlay-creation" id="id76">13.5&nbsp;&nbsp;&nbsp;Overlay Creation</a></li>
156 +<li><a class="reference internal" href="#dependency-resolution" id="id77">13.6&nbsp;&nbsp;&nbsp;Dependency Resolution</a><ul class="auto-toc">
157 +<li><a class="reference internal" href="#dependency-types" id="id78">13.6.1&nbsp;&nbsp;&nbsp;Dependency types</a><ul class="auto-toc">
158 +<li><a class="reference internal" href="#description-file-dependency-fields" id="id79">13.6.1.1&nbsp;&nbsp;&nbsp;DESCRIPTION file dependency fields</a></li>
159 +</ul>
160 +</li>
161 +<li><a class="reference internal" href="#dependency-environments" id="id80">13.6.2&nbsp;&nbsp;&nbsp;Dependency Environments</a></li>
162 +<li><a class="reference internal" href="#ebuildjob-channel" id="id81">13.6.3&nbsp;&nbsp;&nbsp;EbuildJob Channel</a></li>
163 +<li><a class="reference internal" href="#dependency-rule-pools" id="id82">13.6.4&nbsp;&nbsp;&nbsp;Dependency Rule Pools</a></li>
164 +<li><a class="reference internal" href="#dependency-resolver-modules" id="id83">13.6.5&nbsp;&nbsp;&nbsp;Dependency Resolver Modules</a></li>
165 +<li><a class="reference internal" href="#dependency-resolver" id="id84">13.6.6&nbsp;&nbsp;&nbsp;Dependency Resolver</a></li>
166 </ul>
167 </li>
168 </ul>
169 @@ -716,6 +730,11 @@ required.</p>
170 can be used to rename USE_EXPAND flags. This option is not required.</p>
171 <p class="last">Example: USE_EXPAND_RENAME = ~/roverlay/config/useflag_rename</p>
172 </dd>
173 +<dt>CACHEDIR</dt>
174 +<dd><p class="first">Directory for generated files that do not belong to the overlay, e.g.
175 +the <em>distmap</em> file. This option is <strong>required</strong>.</p>
176 +<p class="last">Example: CACHEDIR = ~/roverlay/workdir/cache</p>
177 +</dd>
178 <dt>OVERLAY_ECLASS</dt>
179 <dd><p class="first">This option lists eclass files that should be imported into the overlay
180 (into <em>OVERLAY_DIR</em>/eclass/) and inherited in all ebuilds.
181 @@ -799,6 +818,11 @@ to know in detail what <em>roverlay</em> does before running it.</p>
182 </tr>
183 <tr><td>&nbsp;</td><td>Disable downloading of R packages.</td></tr>
184 <tr><td class="option-group" colspan="2">
185 +<kbd><span class="option">--distmap-verify</span></kbd></td>
186 +</tr>
187 +<tr><td>&nbsp;</td><td>Enforce verification of R packages in the package mirror directory.
188 +This also tries to recreate the distmap.</td></tr>
189 +<tr><td class="option-group" colspan="2">
190 <kbd><span class="option">--no-incremental</span></kbd></td>
191 </tr>
192 <tr><td>&nbsp;</td><td>Force recreation of existing ebuilds</td></tr>
193 @@ -1345,6 +1369,18 @@ consider using one of the <strong>websync</strong> repo types, <a class="referen
194 <a class="reference internal" href="#websync-pkglist">websync_pkglist</a>.</p>
195 </div>
196 </div>
197 +<div class="section" id="distmap">
198 +<h2><a class="toc-backref" href="#contents">5.6&nbsp;&nbsp;&nbsp;distmap</a></h2>
199 +<p><em>roverlay</em> uses a text file to store information about files in the package
200 +mirror directory (<a class="reference internal" href="#overlay-distdir-root">OVERLAY_DISTDIR_ROOT</a>). This is necessary for comparing
201 +package files from repos with files for which an ebuild has already been
202 +created (in previous runs).</p>
203 +<p>With the help of the <em>distmap file</em>, <em>roverlay</em> is able to determine whether
204 +upstream has changed a package file silently and creates a revision-bumped
205 +ebuild for the <em>new</em> package file.</p>
206 +<p>The <em>distmap file</em> can optionally be compressed (bzip2 or gzip), which
207 +reduces its size considerably.</p>
208 +</div>
209 </div>
210 <div class="section" id="additions-directory">
211 <h1><a class="toc-backref" href="#contents">6&nbsp;&nbsp;&nbsp;Additions Directory</a></h1>
212 @@ -2137,8 +2173,392 @@ END;
213 </div>
214 </div>
215 </div>
216 +<div class="section" id="event-hooks">
217 +<h1><a class="toc-backref" href="#contents">9&nbsp;&nbsp;&nbsp;Event Hooks</a></h1>
218 +<p><em>roverlay</em> is able to call a script when certain events occur, e.g. after
219 +successful overlay creation, which can be used to perform additional actions
220 +without touching <em>roverlay's</em> source code.</p>
221 +<p>To realize this, <em>roverlay</em> determines whether a given event is permitted
222 +(<a class="reference internal" href="#event-policy">event policy</a>) and, if so, creates a <a class="reference internal" href="#hook-environment">hook environment</a> and runs the
223 +script. Additionally, shell scripts can load <em>roverlay's</em> <em>$FUNCTIONS</em> file,
224 +which provides extra functionality.</p>
225 +<div class="note">
226 +<p class="first admonition-title">Note</p>
227 +<p class="last"><em>roverlay</em> waits until the script terminates and thus possibly waits
228 +forever.</p>
229 +</div>
230 +<div class="section" id="default-event-script">
231 +<h2><a class="toc-backref" href="#contents">9.1&nbsp;&nbsp;&nbsp;Default event script</a></h2>
232 +<p>The default event script (<tt class="docutils literal">mux.sh</tt>) loads <em>$FUNCTIONS</em> and then runs the
233 +following script files (by sourcing them), in order:</p>
234 +<ol class="arabic simple">
235 +<li>all files from <a class="reference internal" href="#additions-dir">ADDITIONS_DIR</a>/hooks/&lt;event&gt; that end with <em>.sh</em>
236 +(<tt class="docutils literal"><span class="pre">&lt;ADDITIONS_DIR&gt;/hooks/&lt;event&gt;/*.sh</span></tt>)</li>
237 +<li>all files <a class="reference internal" href="#additions-dir">ADDITIONS_DIR</a>/hooks that end with <em>.&lt;event&gt;</em>
238 +(<tt class="docutils literal"><span class="pre">&lt;ADDITIONS_DIR&gt;/hooks/*.&lt;event&gt;</span></tt>)</li>
239 +</ol>
240 +<p>So, there are two naming schemes for <em>hook scripts</em>.
241 +Either one is acceptable, but it is advised to stay consistent.
242 +Having the same script at both locations results in executing it twice.</p>
243 +<div class="note">
244 +<p class="first admonition-title">Note</p>
245 +<p class="last">The default event script enables <em>nounset</em> behavior, which causes the
246 +shell command interpreter to exit abnormally if an unset variable is
247 +accessed.</p>
248 +</div>
249 +<div class="section" id="activating-a-hook-script">
250 +<h3><a class="toc-backref" href="#contents">9.1.1&nbsp;&nbsp;&nbsp;Activating a hook script</a></h3>
251 +<p>Activating a hook script can be done by symlinking it:</p>
252 +<pre class="code text literal-block">
253 +ln -s &lt;real script&gt; ${ADDITIONS_DIR}/hooks/&lt;event&gt;/&lt;name&gt;.sh
254 +# or
255 +ln -s &lt;real script&gt; ${ADDITIONS_DIR}/hooks/&lt;name&gt;.&lt;event&gt;
256 +</pre>
257 +</div>
258 +<div class="section" id="adding-a-new-hook-script">
259 +<h3><a class="toc-backref" href="#contents">9.1.2&nbsp;&nbsp;&nbsp;Adding a new hook script</a></h3>
260 +<p>As hinted before, <em>hook scripts</em> are simple shell scripts. The following
261 +template gives an idea of how to write them:</p>
262 +<pre class="code sh literal-block">
263 +<span class="comment">#!/bin/sh
264 +#set -u
265 +</span>
266 +<span class="comment"># load essential functions
267 +# (not necessary when using the default event script)
268 +</span>. <span class="literal string double">&quot;${FUNCTIONS?}&quot;</span> <span class="operator">||</span> <span class="name builtin">exit</span>
269 +
270 +<span class="comment">## load additional function files, if any
271 +#$lf &lt;name(s)&gt;
272 +</span>
273 +<span class="comment"># script body
274 +#
275 +# when redirecting output to $DEVNULL, use &quot;&gt;&gt;&quot; instead of &quot;&gt;&quot; as
276 +# $DEVNULL could be a file
277 +#ls &gt;&gt;${DEVNULL}
278 +#
279 +# ...
280 +</span>
281 +
282 +<span class="comment"># the script must not exit if everything went well (return is ok)
283 +</span><span class="keyword">return </span>0
284 +</pre>
285 +</div>
286 +</div>
287 +<div class="section" id="event-policy">
288 +<h2><a class="toc-backref" href="#contents">9.2&nbsp;&nbsp;&nbsp;Event Policy</a></h2>
289 +<p>The <em>event policy</em> controls whether a certain event actually triggers a script
290 +call or not.
291 +It is constructed by parsing the <a class="reference internal" href="#event-hook-restrict">EVENT_HOOK_RESTRICT</a> config option:</p>
292 +<ul class="simple">
293 +<li>a word prefixed by <tt class="docutils literal">-</tt> means <em>deny specific event</em> (-&gt; blacklist)</li>
294 +<li>the asterisk char <tt class="docutils literal">*</tt> (or <tt class="docutils literal">+*</tt>) sets the policy to
295 +<em>allow unless denied</em> (blacklist) or <em>allow all</em></li>
296 +<li>a word prefixed by <tt class="docutils literal">+</tt> or without a prefix char means
297 +<em>allow specific event</em> (-&gt; whitelist)</li>
298 +<li>the asterisk char with <tt class="docutils literal">-</tt> as prefix (<tt class="docutils literal"><span class="pre">-*</span></tt>) sets the policy to
299 +<em>deny unless allowed</em> (whitelist) or <em>deny all</em></li>
300 +</ul>
301 +<p>The policy defaults to <em>allow all</em> if <tt class="docutils literal">EVENT_HOOK_RESTRICT</tt> is not set in
302 +the config file. An empty string sets the policy to <em>deny all</em>.</p>
303 +</div>
304 +<div class="section" id="hook-environment">
305 +<h2><a class="toc-backref" href="#contents">9.3&nbsp;&nbsp;&nbsp;Hook Environment</a></h2>
306 +<table border="1" class="docutils">
307 +<caption>environment variables provided by <em>roverlay</em></caption>
308 +<colgroup>
309 +<col width="21%" />
310 +<col width="25%" />
311 +<col width="54%" />
312 +</colgroup>
313 +<thead valign="bottom">
314 +<tr><th class="head">variable</th>
315 +<th class="head">source</th>
316 +<th class="head">notes / description</th>
317 +</tr>
318 +</thead>
319 +<tbody valign="top">
320 +<tr><td>PATH</td>
321 +<td>os.environ</td>
322 +<td>&nbsp;</td>
323 +</tr>
324 +<tr><td>LOGNAME</td>
325 +<td>os.environ</td>
326 +<td>&nbsp;</td>
327 +</tr>
328 +<tr><td>SHLVL</td>
329 +<td>os.environ</td>
330 +<td>&nbsp;</td>
331 +</tr>
332 +<tr><td>TERM</td>
333 +<td>os.environ</td>
334 +<td>&nbsp;</td>
335 +</tr>
336 +<tr><td>HOME</td>
337 +<td>os.environ</td>
338 +<td>&nbsp;</td>
339 +</tr>
340 +<tr><td>ROVERLAY_PHASE</td>
341 +<td>event</td>
342 +<td>event that caused the script to run</td>
343 +</tr>
344 +<tr><td>OVERLAY</td>
345 +<td>config</td>
346 +<td rowspan="3">overlay directory (<a class="reference internal" href="#overlay-dir">OVERLAY_DIR</a>),
347 +initial working directory</td>
348 +</tr>
349 +<tr><td>S</td>
350 +<td><em>$OVERLAY</em></td>
351 +</tr>
352 +<tr><td>PWD</td>
353 +<td><em>$OVERLAY</em></td>
354 +</tr>
355 +<tr><td>DISTROOT</td>
356 +<td>config</td>
357 +<td>package mirror directory
358 +(<a class="reference internal" href="#overlay-distdir-root">OVERLAY_DISTDIR_ROOT</a>)</td>
359 +</tr>
360 +<tr><td>TMPDIR</td>
361 +<td>os.environ,
362 +<em>fallback</em></td>
363 +<td rowspan="2">directory for temporary files</td>
364 +</tr>
365 +<tr><td>T</td>
366 +<td><em>$TMPDIR</em></td>
367 +</tr>
368 +<tr><td>ADDITIONS_DIR</td>
369 +<td>config</td>
370 +<td rowspan="2">directory with supplementary files
371 +(<a class="reference internal" href="#overlay-additions-dir">OVERLAY_ADDITIONS_DIR</a>)</td>
372 +</tr>
373 +<tr><td>FILESDIR</td>
374 +<td><em>$ADDITIONS_DIR</em></td>
375 +</tr>
376 +<tr><td>SHLIB</td>
377 +<td><em>$ADDITIONS_DIR</em>,
378 +<em>installed?</em></td>
379 +<td>A list of directories with shell
380 +function files
381 +(optional, only set if any dir exists)</td>
382 +</tr>
383 +<tr><td>FUNCTIONS</td>
384 +<td><em>$ADDITIONS_DIR</em>,
385 +<em>installed?</em></td>
386 +<td>file with essential shell functions
387 +(optional, only set if it exists)</td>
388 +</tr>
389 +<tr><td>DEBUG</td>
390 +<td>log level</td>
391 +<td><em>shbool</em> (<tt class="docutils literal">y</tt> or <tt class="docutils literal">n</tt>) that
392 +indicates whether debug messages should
393 +be printed</td>
394 +</tr>
395 +<tr><td>VERBOSE</td>
396 +<td>log level</td>
397 +<td><em>shbool</em></td>
398 +</tr>
399 +<tr><td>QUIET</td>
400 +<td>log level</td>
401 +<td><em>shbool</em> that indicates whether scripts
402 +should be quiet</td>
403 +</tr>
404 +<tr><td>NO_COLOR</td>
405 +<td><em>n/a</em></td>
406 +<td><em>shbool</em>. Always set to <em>y</em> since
407 +colored output should not be produced</td>
408 +</tr>
409 +<tr><td>NOSYNC</td>
410 +<td>config</td>
411 +<td><em>shbool</em> that indicates whether data
412 +transfers from/to remote machines is
413 +allowed (<a class="reference internal" href="#nosync">NOSYNC</a>)</td>
414 +</tr>
415 +<tr><td>EBUILD</td>
416 +<td>config</td>
417 +<td>the <em>ebuild</em> executable</td>
418 +</tr>
419 +<tr><td>GIT_EDITOR</td>
420 +<td><em>n/a</em></td>
421 +<td rowspan="2">set to <em>/bin/false</em></td>
422 +</tr>
423 +<tr><td>GIT_ASKPASS</td>
424 +<td><em>n/a</em></td>
425 +</tr>
426 +</tbody>
427 +</table>
428 +<p>The default <em>essential shell functions</em> file (<em>$FUNCTIONS</em>) makes,
429 +when included in the hook script, most of the enviroment variables readonly.</p>
430 +<table border="1" class="docutils">
431 +<caption>variables provided by <em>$FUNCTIONS</em></caption>
432 +<colgroup>
433 +<col width="24%" />
434 +<col width="76%" />
435 +</colgroup>
436 +<thead valign="bottom">
437 +<tr><th class="head">variable</th>
438 +<th class="head">description</th>
439 +</tr>
440 +</thead>
441 +<tbody valign="top">
442 +<tr><td>IFS_DEFAULT</td>
443 +<td>default <em>internal field separator</em></td>
444 +</tr>
445 +<tr><td>IFS_NEWLINE</td>
446 +<td><em>IFS</em> for iterating over text lines</td>
447 +</tr>
448 +<tr><td>DEVNULL</td>
449 +<td><em>/dev/null</em> target (could also be a file)</td>
450 +</tr>
451 +<tr><td>EX_ERR</td>
452 +<td>default error exit code</td>
453 +</tr>
454 +<tr><td>EX_ARG_ERR</td>
455 +<td>default exit code for arg errors</td>
456 +</tr>
457 +<tr><td>SCRIPT_FILENAME</td>
458 +<td>file name of the hook script</td>
459 +</tr>
460 +<tr><td>SCRIPT_NAME</td>
461 +<td>name of the hook script (without file extension)</td>
462 +</tr>
463 +<tr><td>lf</td>
464 +<td>reference to a function that loads additional shell
465 +function files</td>
466 +</tr>
467 +</tbody>
468 +</table>
469 +<p><em>$FUNCTIONS</em> also provides a number of shell functions:</p>
470 +<pre class="code sh literal-block">
471 +<span class="comment"># --- message ---
472 +#
473 +# void veinfo ( message )
474 +# Prints a message to stdout if $DEBUG is set to 'y'.
475 +#
476 +# void einfo ( message )
477 +# Prints a message to stdout if $VERBOSE is set to 'y'.
478 +#
479 +# void ewarn ( message )
480 +# Prints a message to stderr unless $QUIET is set to 'y'.
481 +#
482 +# void eerror ( message )
483 +# Prints a message to stderr.
484 +#
485 +#
486 +# --- core ---
487 +#
488 +# &#64;noreturn die ( [message], [exit_code] ), raises exit()
489 +# Lets the script die with the given message/exit code.
490 +#
491 +# &#64;noreturn OUT_OF_BOUNDS(), raises die()
492 +# Lets the script die due to insufficient arg count.
493 +#
494 +# int run_command ( *cmdv )
495 +# Logs a command and runs it afterwards.
496 +#
497 +# int run_command_logged ( *cmdv )
498 +# Logs a command, runs it and logs the result.
499 +#
500 +# void autodie ( *cmdv ), raises die()
501 +# Runs a command. Lets the script die if the command fails.
502 +#
503 +#
504 +# void load_functions ( *filenames, **SHLIB ), raises die()
505 +# Loads additional shell functions file(s) from $SHLIB.
506 +# (Referenced by $lf.)
507 +#
508 +# void dont_run_as_root(), raises die()
509 +# Lets the script die if it is run as root.
510 +#
511 +# int list_has ( word, *list_items )
512 +# Returns 0 if $word is in the given list, else 1.
513 +#
514 +# int qwhich ( *command )
515 +# Returns 0 if all listed commands are found by &quot;which&quot;, else 1.
516 +#
517 +#
518 +# --- fs ---
519 +#
520 +# int dodir ( *dir )
521 +# Ensures that zero or more directories exist by creating them if
522 +# necessary. Returns the number of directories that could not be created.
523 +#
524 +#
525 +# --- str ---
526 +#
527 +# int yesno ( word, **YESNO_YES=0, **YESNO_NO=1, **YESNO_EMPTY=2 )
528 +# Returns $YESNO_YES if $word means &quot;yes&quot;, $YESNO_EMPTY if $word is empty
529 +# and $YESNO_NO otherwise (if $word probably means &quot;no&quot;).
530 +#
531 +# ~int str_trim ( *args )
532 +# Removes whitespace at the beginning and end of a string and replaces
533 +# any whitespace sequence within the string with a single space char.
534 +# Passes the return value of the underlying sed command.
535 +#
536 +# ~int str_upper ( *args )
537 +# Echoes the uppercase variant of stdin or *args.
538 +# Passes tr's return value.
539 +#
540 +# ~int str_lower ( *args )
541 +# Echoes the lowercase variant of stdin or *args.
542 +# Passes tr's return value.
543 +#
544 +# ~int str_field ( fieldspec, *args, **FIELD_SEPARATOR=' ' )
545 +# Echoes the requested fields of stdin or *args.
546 +# Passes cut's return value.
547 +#
548 +#
549 +# --- int ---
550 +#
551 +# int is_int ( word )
552 +# Returns 0 if $word is an integer, else 1.
553 +#
554 +# int is_natural ( word )
555 +# Returns 0 if $word is an integer &gt;= 0, else 1.
556 +#
557 +# int is_positive ( word )
558 +# Returns 0 if $word is an integer &gt;= 1, else 1.
559 +#
560 +# int is_negative ( word )
561 +# Returns 0 if $word is an integer &lt; 0, else 1.
562 +#</span>
563 +</pre>
564 +</div>
565 +<div class="section" id="adding-a-function-file">
566 +<h2><a class="toc-backref" href="#contents">9.4&nbsp;&nbsp;&nbsp;Adding a function file</a></h2>
567 +<p>Function files are shell script files that provide functions and variables.
568 +They should, however, not execute any code directly.</p>
569 +<p>The template below illustrates how to write function files:</p>
570 +<pre class="code sh literal-block">
571 +<span class="comment"># protect against repeated inclusion of this file
572 +# (replace &lt;name&gt; with a unique identifier)
573 +</span><span class="keyword">if</span> <span class="operator">[</span> -z <span class="literal string double">&quot;${__HAVE_&lt;name&gt;__-}&quot;</span> <span class="operator">]</span>; <span class="keyword">then
574 +</span><span class="name builtin">readonly </span>__HAVE_&lt;name&gt;__<span class="operator">=</span>y
575 +
576 +<span class="comment"># function file body
577 +# ...
578 +</span>
579 +<span class="keyword">fi</span>
580 +</pre>
581 +<p>Shell function files should be put into <tt class="docutils literal"><span class="pre">&lt;ADDITIONS_DIR&gt;/shlib</span></tt>.</p>
582 +</div>
583 +<div class="section" id="adding-a-hook-event">
584 +<h2><a class="toc-backref" href="#contents">9.5&nbsp;&nbsp;&nbsp;Adding a hook event</a></h2>
585 +<p>Adding a new event has to be done in <em>roverlay's</em> source code and is a rather
586 +trivial task. The <tt class="docutils literal">roverlay.hook</tt> module implements a function for running
587 +the event script:</p>
588 +<pre class="code python literal-block">
589 +<span class="comment"># import hook module</span>
590 +<span class="keyword namespace">import</span> <span class="name namespace">roverlay.hook</span>
591 +
592 +<span class="comment"># ...</span>
593 +<span class="comment"># then, somewhere in the code</span>
594 +<span class="name">roverlay</span><span class="operator">.</span><span class="name">hook</span><span class="operator">.</span><span class="name">run</span> <span class="punctuation">(</span> <span class="literal string">&quot;&lt;event&gt;&quot;</span> <span class="punctuation">)</span>
595 +<span class="comment"># ...</span>
596 +<span class="name">roverlay</span><span class="operator">.</span><span class="name">hook</span><span class="operator">.</span><span class="name">run</span> <span class="punctuation">(</span> <span class="literal string">&quot;&lt;another event&gt;&quot;</span> <span class="punctuation">)</span>
597 +</pre>
598 +</div>
599 +</div>
600 <div class="section" id="configuration-reference">
601 -<h1><a class="toc-backref" href="#contents">9&nbsp;&nbsp;&nbsp;Configuration Reference</a></h1>
602 +<h1><a class="toc-backref" href="#contents">10&nbsp;&nbsp;&nbsp;Configuration Reference</a></h1>
603 <p>The main config file uses '&lt;option&gt; = &lt;value&gt;' syntax, comment lines start
604 with <strong>#</strong>. Variable substitution (&quot;${X}&quot;) is not supported. Quotes around
605 the value are optional and allow to span long values over multiple lines.
606 @@ -2191,7 +2611,15 @@ restrictions. Commenting it out is safe.</dd>
607 </dl>
608 <p>The following sections will list all config entries.</p>
609 <div class="section" id="misc-options">
610 -<h2><a class="toc-backref" href="#contents">9.1&nbsp;&nbsp;&nbsp;misc options</a></h2>
611 +<h2><a class="toc-backref" href="#contents">10.1&nbsp;&nbsp;&nbsp;misc options</a></h2>
612 +<dl class="docutils" id="cachedir">
613 +<dt>CACHEDIR</dt>
614 +<dd><p class="first">Directory for persistent files that don't belong to the overlay, e.g.
615 +the distmap file.</p>
616 +<p>This option is <strong>required</strong>.</p>
617 +<p class="last">&lt;&lt;TODO: default value!&gt;&gt;</p>
618 +</dd>
619 +</dl>
620 <dl class="docutils" id="distfiles">
621 <dt>DISTFILES</dt>
622 <dd>Alias to <a class="reference internal" href="#distfiles-root">DISTFILES_ROOT</a>.</dd>
623 @@ -2217,6 +2645,13 @@ set.</p>
624 <p class="last">Defaults to <em>ebuild</em>, which should be fine in most cases.</p>
625 </dd>
626 </dl>
627 +<dl class="docutils" id="nosync">
628 +<dt>NOSYNC</dt>
629 +<dd><p class="first">A <em>bool</em> that controls whether <em>syncing</em>, i.e. data transfers from/to
630 +remote machines, is allowed or forbidden.</p>
631 +<p class="last">Defaults to <em>no</em>.</p>
632 +</dd>
633 +</dl>
634 <dl class="docutils" id="rsync-bwlimit">
635 <dt>RSYNC_BWLIMIT</dt>
636 <dd><p class="first">Set a max. average bandwidth usage in kilobytes per second.
637 @@ -2226,7 +2661,7 @@ This will pass '--bwlimit=&lt;value&gt;' to all rsync commands.</p>
638 </dl>
639 </div>
640 <div class="section" id="overlay-options">
641 -<h2><a class="toc-backref" href="#contents">9.2&nbsp;&nbsp;&nbsp;overlay options</a></h2>
642 +<h2><a class="toc-backref" href="#contents">10.2&nbsp;&nbsp;&nbsp;overlay options</a></h2>
643 <dl class="docutils" id="additions-dir">
644 <dt>ADDITIONS_DIR:</dt>
645 <dd>Alias to <a class="reference internal" href="#overlay-additions-dir">OVERLAY_ADDITIONS_DIR</a>.</dd>
646 @@ -2247,6 +2682,18 @@ This will pass '--bwlimit=&lt;value&gt;' to all rsync commands.</p>
647 <dt>DISTDIR_STRATEGY</dt>
648 <dd>Alias to <a class="reference internal" href="#overlay-distdir-strategy">OVERLAY_DISTDIR_STRATEGY</a>.</dd>
649 </dl>
650 +<dl class="docutils" id="distdir-verify">
651 +<dt>DISTDIR_VERIFY</dt>
652 +<dd>Alias to <a class="reference internal" href="#overlay-distdir-verify">OVERLAY_DISTDIR_VERIFY</a>.</dd>
653 +</dl>
654 +<dl class="docutils" id="distmap-compression">
655 +<dt>DISTMAP_COMPRESSION</dt>
656 +<dd>Alias to <a class="reference internal" href="#overlay-distmap-compression">OVERLAY_DISTMAP_COMPRESSION</a>.</dd>
657 +</dl>
658 +<dl class="docutils" id="distmap-file">
659 +<dt>DISTMAP_FILE</dt>
660 +<dd>Alias to <a class="reference internal" href="#overlay-distmap-file">OVERLAY_DISTMAP_FILE</a>.</dd>
661 +</dl>
662 <dl class="docutils" id="ebuild-use-expand-name">
663 <dt>EBUILD_USE_EXPAND_NAME</dt>
664 <dd>Name of the R_SUGGESTS USE_EXPAND variable. Defaults to <em>R_SUGGESTS</em>.</dd>
665 @@ -2349,6 +2796,27 @@ This method is not compatible with any of the above.</td>
666 config file, &quot;hardlink symlink&quot;.</p>
667 </dd>
668 </dl>
669 +<dl class="docutils" id="overlay-distdir-verify">
670 +<dt>OVERLAY_DISTDIR_VERIFY</dt>
671 +<dd><p class="first">A <em>bool</em> that controls whether file integrity of <em>OVERLAY_DISTDIR_ROOT</em>
672 +should be checked on startup. This is an expensive operation since each
673 +file have to be read once.</p>
674 +<p class="last">Defaults to <em>no</em> as the verification is normally not needed.</p>
675 +</dd>
676 +</dl>
677 +<dl class="docutils" id="overlay-distmap-compression">
678 +<dt>OVERLAY_DISTMAP_COMPRESSION</dt>
679 +<dd><p class="first">Compression format for the distmap file. Choices are none, gzip/gz and
680 +bzip2/bz2.</p>
681 +<p class="last">Defaults to bzip2.</p>
682 +</dd>
683 +</dl>
684 +<dl class="docutils" id="overlay-distmap-file">
685 +<dt>OVERLAY_DISTMAP_FILE:</dt>
686 +<dd><p class="first">File path to the distmap file.</p>
687 +<p class="last">Defaults to &lt;not set&gt;, which results in <a class="reference internal" href="#cachedir">CACHEDIR</a>/distmap.db.</p>
688 +</dd>
689 +</dl>
690 <dl class="docutils" id="overlay-eclass">
691 <dt>OVERLAY_ECLASS</dt>
692 <dd><p class="first">A list of eclass files that will be imported into the overlay and inherited
693 @@ -2398,7 +2866,7 @@ writing.</p>
694 </dl>
695 </div>
696 <div class="section" id="other-config-files">
697 -<h2><a class="toc-backref" href="#contents">9.3&nbsp;&nbsp;&nbsp;other config files</a></h2>
698 +<h2><a class="toc-backref" href="#contents">10.3&nbsp;&nbsp;&nbsp;other config files</a></h2>
699 <p>Some config config options are split from the main config file for various
700 reasons:</p>
701 <ul class="simple">
702 @@ -2476,8 +2944,45 @@ much without dependency resolution.</p>
703 <dd>Alias to <a class="reference internal" href="#ebuild-use-expand-rename">EBUILD_USE_EXPAND_RENAME</a>.</dd>
704 </dl>
705 </div>
706 +<div class="section" id="shell-environment-hooks">
707 +<h2><a class="toc-backref" href="#contents">10.4&nbsp;&nbsp;&nbsp;shell environment / hooks</a></h2>
708 +<dl class="docutils" id="event-hook">
709 +<dt>EVENT_HOOK</dt>
710 +<dd><p class="first">A script that is called for handling <em>events</em> (see <a class="reference internal" href="#event-hooks">Event Hooks</a>).</p>
711 +<p class="last">Defaults to &lt;libexec dir&gt;/hooks/mux.sh if roverlay has been installed
712 +and <a class="reference internal" href="#additions-dir">ADDITIONS_DIR</a>/hooks/mux.sh otherwise.</p>
713 +</dd>
714 +</dl>
715 +<dl class="docutils" id="event-hook-restrict">
716 +<dt>EVENT_HOOK_RESTRICT</dt>
717 +<dd><p class="first">A list of <em>events</em> that are allowed (<tt class="docutils literal">&lt;event&gt;</tt>, <tt class="docutils literal">+&lt;event&gt;</tt>) or
718 +forbidden (<tt class="docutils literal"><span class="pre">-&lt;event&gt;</span></tt>). The asterisk wildcard character can be used to
719 +set the default policy to <em>allow unless forbidden</em> (<tt class="docutils literal">*</tt>) or
720 +<em>deny unless allowed</em> (<tt class="docutils literal"><span class="pre">-*</span></tt>).</p>
721 +<p>Defaults to &lt;not set&gt;, which is equivalent to <em>deny all</em>.</p>
722 +<p class="last"><tt class="docutils literal"><span class="pre">EVENT_HOOK_RESTRICT=&quot;overlay_success&quot;</span></tt> would allow the <tt class="docutils literal">overlay_success</tt>
723 +event only, whereas <tt class="docutils literal"><span class="pre">EVENT_HOOK_RESTRICT=&quot;*</span> <span class="pre">-overlay_success&quot;</span></tt> would
724 +allow any event except for <tt class="docutils literal">overlay_success</tt>. Also see <a class="reference internal" href="#event-policy">event policy</a>.</p>
725 +</dd>
726 +</dl>
727 +<dl class="docutils" id="filter-shell-env">
728 +<dt>FILTER_SHELL_ENV</dt>
729 +<dd><p class="first">A <em>bool</em> that controls whether the hook environment should be filtered
730 +or not.</p>
731 +<p class="last">Defaults to <em>true</em>.</p>
732 +</dd>
733 +</dl>
734 +<dl class="docutils" id="hook">
735 +<dt>HOOK</dt>
736 +<dd>Alias to <a class="reference internal" href="#event-hook">EVENT_HOOK</a>.</dd>
737 +</dl>
738 +<dl class="docutils" id="hook-restrict">
739 +<dt>HOOK_RESTRICT</dt>
740 +<dd>Alias to <a class="reference internal" href="#event-hook-restrict">EVENT_HOOK_RESTRICT</a>.</dd>
741 +</dl>
742 +</div>
743 <div class="section" id="logging">
744 -<h2><a class="toc-backref" href="#contents">9.4&nbsp;&nbsp;&nbsp;logging</a></h2>
745 +<h2><a class="toc-backref" href="#contents">10.5&nbsp;&nbsp;&nbsp;logging</a></h2>
746 <dl class="docutils" id="log-date-format">
747 <dt>LOG_DATE_FORMAT</dt>
748 <dd><p class="first">The date format (ISO8601) used in log messages.</p>
749 @@ -2502,7 +3007,7 @@ have their own log level.</p>
750 </dd>
751 </dl>
752 <div class="section" id="console-logging">
753 -<h3><a class="toc-backref" href="#contents">9.4.1&nbsp;&nbsp;&nbsp;console logging</a></h3>
754 +<h3><a class="toc-backref" href="#contents">10.5.1&nbsp;&nbsp;&nbsp;console logging</a></h3>
755 <dl class="docutils" id="log-console">
756 <dt>LOG_CONSOLE</dt>
757 <dd><p class="first">Enables/Disables logging to console. The value has to be a <em>bool</em>.</p>
758 @@ -2523,7 +3028,7 @@ have their own log level.</p>
759 </dl>
760 </div>
761 <div class="section" id="file-logging">
762 -<h3><a class="toc-backref" href="#contents">9.4.2&nbsp;&nbsp;&nbsp;file logging</a></h3>
763 +<h3><a class="toc-backref" href="#contents">10.5.2&nbsp;&nbsp;&nbsp;file logging</a></h3>
764 <dl class="docutils" id="log-file">
765 <dt>LOG_FILE</dt>
766 <dd><p class="first">Sets the log file. File logging will be disabled if this option does not
767 @@ -2582,7 +3087,7 @@ files will be kept.</p>
768 </div>
769 </div>
770 <div class="section" id="options-for-debugging-manual-dependency-rule-creation-and-testing">
771 -<h2><a class="toc-backref" href="#contents">9.5&nbsp;&nbsp;&nbsp;options for debugging, manual dependency rule creation and testing</a></h2>
772 +<h2><a class="toc-backref" href="#contents">10.6&nbsp;&nbsp;&nbsp;options for debugging, manual dependency rule creation and testing</a></h2>
773 <dl class="docutils" id="description-dir">
774 <dt>DESCRIPTION_DIR</dt>
775 <dd><p class="first">A directory where all description data read from an R package will be
776 @@ -2601,9 +3106,9 @@ on <em>roverlay</em> exit. Primarily useful for creating new rules.</p>
777 </div>
778 </div>
779 <div class="section" id="id3">
780 -<h1><a class="toc-backref" href="#contents">10&nbsp;&nbsp;&nbsp;Other config files</a></h1>
781 +<h1><a class="toc-backref" href="#contents">11&nbsp;&nbsp;&nbsp;Other config files</a></h1>
782 <div class="section" id="use-expand-flag-rename-file">
783 -<h2><a class="toc-backref" href="#contents">10.1&nbsp;&nbsp;&nbsp;USE_EXPAND flag rename file</a></h2>
784 +<h2><a class="toc-backref" href="#contents">11.1&nbsp;&nbsp;&nbsp;USE_EXPAND flag rename file</a></h2>
785 <p>The <a class="reference internal" href="#use-expand-rename">USE_EXPAND_RENAME</a> file contains dictionary-like entries that assign
786 <em>effective</em> flag names to flag names generated at runtime.</p>
787 <p>The syntax is as follows:</p>
788 @@ -2637,7 +3142,7 @@ unpredictable results.</p>
789 </div>
790 </div>
791 <div class="section" id="field-definition-config">
792 -<span id="id4"></span><h2><a class="toc-backref" href="#contents">10.2&nbsp;&nbsp;&nbsp;Field Definition Config</a></h2>
793 +<span id="id4"></span><h2><a class="toc-backref" href="#contents">11.2&nbsp;&nbsp;&nbsp;Field Definition Config</a></h2>
794 <p>The field definition file uses <a class="reference external" href="http://docs.python.org/library/configparser.html">ConfigParser</a> syntax and defines
795 how an R package's DESCRIPTION file is read.
796 See the next section, <a class="reference internal" href="#default-field-definition-file">default field definition file</a>, for an example.</p>
797 @@ -2719,7 +3224,7 @@ such a field is found.</dd>
798 <p class="last">It is not checked whether a flag is known or not.</p>
799 </div>
800 <div class="section" id="example-the-default-field-definition-file">
801 -<span id="default-field-definition-file"></span><h3><a class="toc-backref" href="#contents">10.2.1&nbsp;&nbsp;&nbsp;Example: The default field definition file</a></h3>
802 +<span id="default-field-definition-file"></span><h3><a class="toc-backref" href="#contents">11.2.1&nbsp;&nbsp;&nbsp;Example: The default field definition file</a></h3>
803 <p>This is the default field definition file (without any ignored fields):</p>
804 <pre class="code ini literal-block">
805 <span class="keyword">[Description]</span>
806 @@ -2756,7 +3261,7 @@ such a field is found.</dd>
807 </div>
808 </div>
809 <div class="section" id="dependency-resolution-console">
810 -<span id="depres-console"></span><h1><a class="toc-backref" href="#contents">11&nbsp;&nbsp;&nbsp;Dependency Resolution Console</a></h1>
811 +<span id="depres-console"></span><h1><a class="toc-backref" href="#contents">12&nbsp;&nbsp;&nbsp;Dependency Resolution Console</a></h1>
812 <p>As previously stated, the <em>DepRes Console</em> is only meant for <strong>testing</strong>.
813 It is an interactive console with the following features:</p>
814 <ul class="simple">
815 @@ -2914,13 +3419,13 @@ cmd % exit
816 </dl>
817 </div>
818 <div class="section" id="implementation-overview">
819 -<h1><a class="toc-backref" href="#contents">12&nbsp;&nbsp;&nbsp;Implementation Overview</a></h1>
820 +<h1><a class="toc-backref" href="#contents">13&nbsp;&nbsp;&nbsp;Implementation Overview</a></h1>
821 <p>This chapter gives an in-depth overview of how roverlay works.
822 Code documentation is also available and html pages for it can be created
823 with <tt class="docutils literal">make pydoc</tt> in the <em>R Overlay src directory</em> or by using pydoc
824 directly.</p>
825 <div class="section" id="packageinfo">
826 -<h2><a class="toc-backref" href="#contents">12.1&nbsp;&nbsp;&nbsp;PackageInfo</a></h2>
827 +<h2><a class="toc-backref" href="#contents">13.1&nbsp;&nbsp;&nbsp;PackageInfo</a></h2>
828 <p><em>PackageInfo</em> is the data object that contains all information about an
829 R package and is created by the owning repository.</p>
830 <p>After initialization it contains data like</p>
831 @@ -2941,7 +3446,7 @@ for it. Otherwise, <em>p</em> is now part of the overlay and has to pass
832 <em>ebuild creation</em>.</p>
833 </div>
834 <div class="section" id="repository-management">
835 -<h2><a class="toc-backref" href="#contents">12.2&nbsp;&nbsp;&nbsp;Repository Management</a></h2>
836 +<h2><a class="toc-backref" href="#contents">13.2&nbsp;&nbsp;&nbsp;Repository Management</a></h2>
837 <p>Repositories are managed in a list-like object, <em>RepoList</em>. Its task is to
838 provide R package input for overlay creation and implements the following
839 functionality:</p>
840 @@ -2952,7 +3457,7 @@ functionality:</p>
841 <li>create <em>PackageInfo</em> instances for R packages from all repositories</li>
842 </ul>
843 <div class="section" id="repository">
844 -<h3><a class="toc-backref" href="#contents">12.2.1&nbsp;&nbsp;&nbsp;Repository</a></h3>
845 +<h3><a class="toc-backref" href="#contents">13.2.1&nbsp;&nbsp;&nbsp;Repository</a></h3>
846 <p>The functionality described above is an abstraction layer that calls the
847 respective function for each repository and collects the result.
848 So, while the <em>RepoList</em> object knows <em>what</em> to do for all repositories,
849 @@ -2993,7 +3498,7 @@ subclass-specifc <em>_sync()</em>/<em>_nosync()</em> functions if available.
850 repository types, <em>rsync</em>, <em>websync_repo</em> and <em>websync_pkglist</em> derive from
851 <em>BasicRepo</em>.</p>
852 <div class="section" id="adding-new-repository-types">
853 -<h4><a class="toc-backref" href="#contents">12.2.1.1&nbsp;&nbsp;&nbsp;Adding new repository types</a></h4>
854 +<h4><a class="toc-backref" href="#contents">13.2.1.1&nbsp;&nbsp;&nbsp;Adding new repository types</a></h4>
855 <p>Adding new repository types is best done by creating a new repo class
856 that inherits <em>BasicRepo</em>. The table below shows <em>BasicRepo</em>'s subclass
857 awareness concerning <em>sync()</em> and what may be changed if required.
858 @@ -3080,7 +3585,7 @@ to be accessible.</p>
859 </div>
860 </div>
861 <div class="section" id="overlay">
862 -<h2><a class="toc-backref" href="#contents">12.3&nbsp;&nbsp;&nbsp;Overlay</a></h2>
863 +<h2><a class="toc-backref" href="#contents">13.3&nbsp;&nbsp;&nbsp;Overlay</a></h2>
864 <p>The <em>overlay</em> is roverlay's central data structure that represents a <em>portage
865 overlay</em>. It is organized in a tree structure (overlay root, categories,
866 package directories) and implements all overlay-related functionality:</p>
867 @@ -3111,7 +3616,7 @@ level</p>
868 </li>
869 </ul>
870 <div class="section" id="metadata-creation">
871 -<h3><a class="toc-backref" href="#contents">12.3.1&nbsp;&nbsp;&nbsp;Metadata Creation</a></h3>
872 +<h3><a class="toc-backref" href="#contents">13.3.1&nbsp;&nbsp;&nbsp;Metadata Creation</a></h3>
873 <p><em>metadata.xml</em> files are created with a tree structure that contains <em>metadata
874 nodes</em>, e.g. '&lt;pkgmetadata&gt;...&lt;/pkgmetadata&gt;' and '&lt;use&gt;...&lt;/use&gt;' are <em>nodes</em>.
875 The current implementation writes the R package's full description
876 @@ -3120,7 +3625,7 @@ Metadata creation uses the latest package, i.e. highest version,
877 for which an ebuild has been created.</p>
878 </div>
879 <div class="section" id="manifest-creation">
880 -<h3><a class="toc-backref" href="#contents">12.3.2&nbsp;&nbsp;&nbsp;Manifest Creation</a></h3>
881 +<h3><a class="toc-backref" href="#contents">13.3.2&nbsp;&nbsp;&nbsp;Manifest Creation</a></h3>
882 <p>Manifest files are created by calling the <em>ebuild</em> executable for each
883 package directory in a filtered environment where FETCHCOMMAND and
884 RESUMECOMMAND are set to no-operation. The directories that contain the R
885 @@ -3129,7 +3634,7 @@ is set to <a class="reference internal" href="#distfiles-root">DISTFILES_ROOT</a
886 </div>
887 </div>
888 <div class="section" id="ebuild-creation">
889 -<h2><a class="toc-backref" href="#contents">12.4&nbsp;&nbsp;&nbsp;Ebuild Creation</a></h2>
890 +<h2><a class="toc-backref" href="#contents">13.4&nbsp;&nbsp;&nbsp;Ebuild Creation</a></h2>
891 <p>Ebuild creation is the process centered around one <em>PackageInfo</em> instance <em>p</em>
892 that tries to create an ebuild for it.</p>
893 <p>It does the following steps:</p>
894 @@ -3148,7 +3653,7 @@ order to save memory etc.</li>
895 as <em>ebuild successfully created</em></li>
896 </ol>
897 <div class="section" id="ebuild-variables">
898 -<h3><a class="toc-backref" href="#contents">12.4.1&nbsp;&nbsp;&nbsp;Ebuild Variables</a></h3>
899 +<h3><a class="toc-backref" href="#contents">13.4.1&nbsp;&nbsp;&nbsp;Ebuild Variables</a></h3>
900 <p>Each ebuild variable is an object whose class is derived from the <em>EbuildVar</em>
901 class. An <em>EbuildVar</em> defines its position in the ebuild and how its text
902 output should look like. Ebuild text is created by adding ebuild variables
903 @@ -3156,7 +3661,7 @@ to an <em>Ebuilder</em> that automatically sorts them and creates the ebuild.</p
904 </div>
905 </div>
906 <div class="section" id="overlay-creation">
907 -<h2><a class="toc-backref" href="#contents">12.5&nbsp;&nbsp;&nbsp;Overlay Creation</a></h2>
908 +<h2><a class="toc-backref" href="#contents">13.5&nbsp;&nbsp;&nbsp;Overlay Creation</a></h2>
909 <p>Overlay creation is the process of creating an overlay for many R packages
910 and <em>roverlay</em>'s main task. More specifically, <em>OverlayCreation</em> is an
911 <em>R packages -&gt; Overlay (-&gt; overlay in filesystem)</em> interface.
912 @@ -3170,7 +3675,7 @@ instead the event is logged. Running more than one <em>OverlayWorker</em> in par
913 is possible.</p>
914 </div>
915 <div class="section" id="dependency-resolution">
916 -<h2><a class="toc-backref" href="#contents">12.6&nbsp;&nbsp;&nbsp;Dependency Resolution</a></h2>
917 +<h2><a class="toc-backref" href="#contents">13.6&nbsp;&nbsp;&nbsp;Dependency Resolution</a></h2>
918 <p>Each ebuild creation process has access to the <em>dependency resolver</em> that
919 accepts <em>dependency strings</em>, tries to resolve them and returns the result,
920 either &quot;unresolvable&quot; or the resolving <em>dependency</em> as
921 @@ -3192,7 +3697,7 @@ all <em>required dependencies</em>. No ebuild can be created in that case.</li>
922 <p>Details about dependency resolution like how <em>channels</em> work can be found
923 in the following subsections.</p>
924 <div class="section" id="dependency-types">
925 -<h3><a class="toc-backref" href="#contents">12.6.1&nbsp;&nbsp;&nbsp;Dependency types</a></h3>
926 +<h3><a class="toc-backref" href="#contents">13.6.1&nbsp;&nbsp;&nbsp;Dependency types</a></h3>
927 <p>Every <em>dependency string</em> has a <em>dependency type</em> that declares how a
928 dependency should be resolved. It has one or more of these properties:</p>
929 <dl class="docutils">
930 @@ -3221,7 +3726,7 @@ The <em>Suggests</em> field, for example, gets the
931 <em>&quot;package dependency only and optional&quot;</em> type, whereas the <em>SystemRequirements</em>
932 gets <em>&quot;system dependency, but try others, and mandatory&quot;</em>.</p>
933 <div class="section" id="description-file-dependency-fields">
934 -<h4><a class="toc-backref" href="#contents">12.6.1.1&nbsp;&nbsp;&nbsp;DESCRIPTION file dependency fields</a></h4>
935 +<h4><a class="toc-backref" href="#contents">13.6.1.1&nbsp;&nbsp;&nbsp;DESCRIPTION file dependency fields</a></h4>
936 <p>The DESCRIPTION file of an R package contains several fields that list
937 dependencies on R packages or other software like scientific libraries.
938 This section describes which <em>dependency fields</em> are used and how.</p>
939 @@ -3280,7 +3785,7 @@ but optional dependencies during the <em>pkg_postinst()</em> ebuild phase.</p>
940 </div>
941 </div>
942 <div class="section" id="dependency-environments">
943 -<h3><a class="toc-backref" href="#contents">12.6.2&nbsp;&nbsp;&nbsp;Dependency Environments</a></h3>
944 +<h3><a class="toc-backref" href="#contents">13.6.2&nbsp;&nbsp;&nbsp;Dependency Environments</a></h3>
945 <p>A <em>dependency environment</em> is an object that reflects the whole dependency
946 resolution process of a single <em>dependency string</em>. It usually contains
947 the <em>dependency string</em>, its <em>dependency type</em>, information about its
948 @@ -3290,7 +3795,7 @@ resolving resolving <em>dependency</em>, if any.</p>
949 <em>dependency resolver</em>.</p>
950 </div>
951 <div class="section" id="ebuildjob-channel">
952 -<h3><a class="toc-backref" href="#contents">12.6.3&nbsp;&nbsp;&nbsp;EbuildJob Channel</a></h3>
953 +<h3><a class="toc-backref" href="#contents">13.6.3&nbsp;&nbsp;&nbsp;EbuildJob Channel</a></h3>
954 <p>The <em>EbuildJob Channel</em> is used by the ebuild creation to communicate with
955 the <em>dependency resolver</em>. It is initialized by an ebuild creation process and
956 realizes a greedy <em>string to string</em> dependency resolution.</p>
957 @@ -3327,7 +3832,7 @@ dependencies are unresolvable.</li>
958 </ol>
959 </div>
960 <div class="section" id="dependency-rule-pools">
961 -<h3><a class="toc-backref" href="#contents">12.6.4&nbsp;&nbsp;&nbsp;Dependency Rule Pools</a></h3>
962 +<h3><a class="toc-backref" href="#contents">13.6.4&nbsp;&nbsp;&nbsp;Dependency Rule Pools</a></h3>
963 <p>The <em>dependency resolver</em> does not know <em>how</em> to resolve a <em>dependency string</em>.
964 Instead, it searches through a list of <em>dependency rule pools</em> that may be
965 able to do this.</p>
966 @@ -3350,7 +3855,7 @@ R package dependencies.
967 By convention, it will never resolve any system dependencies.</p>
968 </div>
969 <div class="section" id="dependency-resolver-modules">
970 -<h3><a class="toc-backref" href="#contents">12.6.5&nbsp;&nbsp;&nbsp;Dependency Resolver Modules</a></h3>
971 +<h3><a class="toc-backref" href="#contents">13.6.5&nbsp;&nbsp;&nbsp;Dependency Resolver Modules</a></h3>
972 <p>The dependency resolver can be extended by modules. Two base types are
973 available, <em>channels</em> and <em>listeners</em>.</p>
974 <dl class="docutils">
975 @@ -3370,7 +3875,7 @@ resolution, wait for results, and send them to the other end.</p>
976 </dl>
977 </div>
978 <div class="section" id="dependency-resolver">
979 -<h3><a class="toc-backref" href="#contents">12.6.6&nbsp;&nbsp;&nbsp;Dependency Resolver</a></h3>
980 +<h3><a class="toc-backref" href="#contents">13.6.6&nbsp;&nbsp;&nbsp;Dependency Resolver</a></h3>
981 <p>The dependency resolver puts all parts of dependency resolution together,
982 <em>rule pools</em>, <em>listeners</em> and <em>channels</em>. Its main task is a loop that
983 processes all queued <em>dependency environments</em> and sends the result back to
984 @@ -3428,7 +3933,7 @@ becomes &quot;loop until resolver closes&quot;.</p>
985 </div>
986 <div class="footer">
987 <hr class="footer" />
988 -Generated on: 2013-06-18.
989 +Generated on: 2013-06-26.
990
991 </div>
992 </body>