add install hooks
authorBrian Harring <ferringb@gmail.com>
Wed, 21 Sep 2011 22:50:28 +0000 (15:50 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 22 Sep 2011 00:03:45 +0000 (17:03 -0700)
bin/misc-functions.sh
pym/portage/package/ebuild/doebuild.py

index 30244a74b27f29ac9b7e5a9410793a2d382ad599..7d858a28a75288edd16a2ca8f4887e15844d4ce2 100755 (executable)
@@ -985,6 +985,21 @@ success_hooks() {
        done
 }
 
+install_hooks() {
+       local hooks_dir="${PORTAGE_CONFIG_ROOT}/etc/portage/hooks/install"
+       local fp
+       local ret=0
+       shopt -s nullglob
+       for fp in "${hooks_dir}"/*; do
+               if [ -x "$fp" ]; then
+                       "$fp"
+                       ret=$(( $ret | $? ))
+               fi
+       done
+       shopt +s nullglob
+       return $ret
+}
+
 if [ -n "${MISC_FUNCTIONS_ARGS}" ]; then
        source_all_bashrcs
        [ "$PORTAGE_DEBUG" == "1" ] && set -x
index 427589a6bce4c7419d38719968f752145f77633c..9939e9cc2db7b9a1361835fd8d49597e726213c4 100644 (file)
@@ -1393,7 +1393,8 @@ _post_phase_cmds = {
 
        "install" : [
                "install_qa_check",
-               "install_symlink_html_docs"],
+               "install_symlink_html_docs",
+               "install_hooks"],
 
        "preinst" : [
                "preinst_sfperms",