aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-13 14:22:24 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-13 14:22:24 +0000
commitc040a6630ad3013f9edaa50fdc792a711b9fb10d (patch)
tree4f04484a9ec73f5084301ef645955c7817cfb52e
parent326664dfc0b65ce8b36de1a758225ed41e8a49e5 (diff)
downloadpaludis-c040a6630ad3013f9edaa50fdc792a711b9fb10d.tar.gz
paludis-c040a6630ad3013f9edaa50fdc792a711b9fb10d.tar.xz
Hooks doc update
-rw-r--r--doc/hooks.html.skel69
1 files changed, 68 insertions, 1 deletions
diff --git a/doc/hooks.html.skel b/doc/hooks.html.skel
index 19228d4..e85cedc 100644
--- a/doc/hooks.html.skel
+++ b/doc/hooks.html.skel
@@ -17,7 +17,7 @@
<p>This document describes the Paludis hooks interface. A hook is a piece of code
that is executed when a particular well defined action occurs.</p>
-<p>There are currently three categories of hook:</p>
+<p>There are currently four categories of hook:</p>
<ul>
<li>General hooks. These have access to a limited environment.</li>
@@ -28,6 +28,9 @@ that is executed when a particular well defined action occurs.</p>
<li>Ebuild message hooks. These are special hooks that are called for
<code>einfo</code>, <code>ewarn</code> etc.</li>
+
+ <li>Merger / Unmerger hooks. These are used when installing and uninstalling
+ content to the live filesystem.</li>
</ul>
<h3>Available Hooks</h3>
@@ -146,6 +149,70 @@ being called, and the <code>MESSAGE</code> environment variable will contain
the message being passed to the function. The <code>PALUDIS_CMDLINE</code>
variables described below are also available.</p>
+<h4>Merger / Unmerger Hooks</h4>
+
+<p>The merger runs in two stages, for safety. First it checks that it can
+probably install safely, then it does the actual install. Note that calculating
+the md5, timestamp etc for VDB CONTENTS is done <em>after</em> the install_post
+hooks are called.</p>
+
+<p>The following merger check hooks are available:</p>
+
+<ul>
+ <li>merger_check_file_pre</li>
+ <li>merger_check_file_post</li>
+ <li>merger_check_sym_pre</li>
+ <li>merger_check_sym_post</li>
+ <li>merger_check_dir_pre</li>
+ <li>merger_check_dir_post</li>
+</ul>
+
+<p>The <code>INSTALL_SOURCE</code> and <code>INSTALL_DESTINATION</code>
+environment variables contain the target source and destination. The
+<code>ROOT</code> variable contains the filesystem root. The <code>IMAGE</code>
+variable contains the image root.</p>
+
+<p>The following merger hooks are available:</p>
+
+<ul>
+ <li>merger_install_file_pre</li>
+ <li>merger_install_file_post</li>
+ <li>merger_install_sym_pre</li>
+ <li>merger_install_sym_post</li>
+ <li>merger_install_dir_pre</li>
+ <li>merger_install_dir_post</li>
+ <li>merger_unlink_file_pre</li>
+ <li>merger_unlink_file_post</li>
+ <li>merger_unlink_dir_pre</li>
+ <li>merger_unlink_dir_post</li>
+ <li>merger_unlink_sym_pre</li>
+ <li>merger_unlink_sym_post</li>
+ <li>merger_unlink_misc_pre</li>
+ <li>merger_unlink_misc_post</li>
+</ul>
+
+<p>Again, <code>ROOT</code> and <code>IMAGE</code> are available. For
+install hooks, <code>INSTALL_SOURCE</code>, <code>INSTALL_DESTINATION</code> are
+set, and for uninstall hooks, <code>UNLINK_TARGET</code>.</p>
+
+<p>The unmerger hooks are used for uninstalling a package, but not when existing
+things have to be removed for an install (the merger does that). The following
+unmerger hooks are available:</p>
+
+<ul>
+ <li>unmerger_unlink_file_pre</li>
+ <li>unmerger_unlink_file_post</li>
+ <li>unmerger_unlink_dir_pre</li>
+ <li>unmerger_unlink_dir_post</li>
+ <li>unmerger_unlink_sym_pre</li>
+ <li>unmerger_unlink_sym_post</li>
+ <li>unmerger_unlink_misc_pre</li>
+ <li>unmerger_unlink_misc_post</li>
+</ul>
+
+<p>The <code>UNLINK_TARGET</code> environment variable specifies the file about
+to be unlinked, and <code>ROOT</code> is the filesystem root.</p>
+
<h3>User Defined Hooks</h3>
<p>User defined hooks should be executable (<code>chmod a+x</code>) scripts named