chmod 0755 "$1"
}
+ebuild_phase() {
+ [ "$(type -t ${1})" == "function" ] && qa_call ${1}
+}
+
+ebuild_phase_with_hooks() {
+ local x phase_name=${1}
+ for x in {pre_,,post_}${phase_name} ; do
+ ebuild_phase ${x}
+ done
+}
+
dyn_setup() {
- [ "$(type -t pre_pkg_setup)" == "function" ] && qa_call pre_pkg_setup
- qa_call pkg_setup
- [ "$(type -t post_pkg_setup)" == "function" ] && qa_call post_pkg_setup
+ ebuild_phase_with_hooks pkg_setup
}
dyn_unpack() {
fi
cd "${WORKDIR}" || die "Directory change failed: \`cd '${WORKDIR}'\`"
vecho ">>> Unpacking source..."
- qa_call src_unpack
+ ebuild_phase src_unpack
touch "${PORTAGE_BUILDDIR}/.unpacked" || die "IO Failure -- Failed 'touch .unpacked' in ${PORTAGE_BUILDDIR}"
vecho ">>> Source unpacked."
cd "${PORTAGE_BUILDDIR}"
#our libtool to create problematic .la files
export PWORKDIR="$WORKDIR"
vecho ">>> Compiling source in ${srcdir} ..."
- qa_call src_compile
+ ebuild_phase src_compile
vecho ">>> Source compiled."
#|| abort_compile "fail"
cd "${PORTAGE_BUILDDIR}"
vecho ">>> Test phase [explicitly disabled]: ${CATEGORY}/${PF}"
else
addpredict /
- qa_call src_test
+ ebuild_phase src_test
SANDBOX_PREDICT="${SANDBOX_PREDICT%:/}"
fi
#some packages uses an alternative to $S to build in, cause
#our libtool to create problematic .la files
export PWORKDIR="$WORKDIR"
- qa_call src_install
+ ebuild_phase src_install
touch "${PORTAGE_BUILDDIR}/.installed"
vecho ">>> Completed installing ${PF} into ${D}"
vecho
eerror "${FUNCNAME}: D is unset"
return 1
fi
-
- [ "$(type -t pre_pkg_preinst)" == "function" ] && qa_call pre_pkg_preinst
-
- pkg_preinst
-
- [ "$(type -t post_pkg_preinst)" == "function" ] && qa_call post_pkg_preinst
+ ebuild_phase_with_hooks pkg_preinst
}
dyn_help() {
debug-print-section inherit EXPORT_FUNCTIONS newdepend newrdepend \
newpdepend do_newdepend remove_path_entry killparent \
save_ebuild_env filter_readonly_variables preprocess_ebuild_env \
- source_all_bashrcs
+ source_all_bashrcs ebuild_phase ebuild_phase_with_hooks
# portage config variables and variables set directly by portage
unset ACCEPT_KEYWORDS AUTOCLEAN BAD BRACKET BUILD_PREFIX CLEAN_DELAY \
if [ -n "${EBUILD_SH_ARGS}" ] ; then
case ${EBUILD_SH_ARGS} in
nofetch)
- qa_call pkg_nofetch
+ ebuild_phase_with_hooks pkg_nofetch
exit 1
;;
prerm|postrm|postinst|config|info)
fi
export SANDBOX_ON="0"
if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then
- [ "$(type -t pre_pkg_${EBUILD_SH_ARGS})" == "function" ] && \
- qa_call pre_pkg_${EBUILD_SH_ARGS}
- qa_call pkg_${EBUILD_SH_ARGS}
- [ "$(type -t post_pkg_${EBUILD_SH_ARGS})" == "function" ] && \
- qa_call post_pkg_${EBUILD_SH_ARGS}
+ ebuild_phase_with_hooks pkg_${EBUILD_SH_ARGS}
else
set -x
- [ "$(type -t pre_pkg_${EBUILD_SH_ARGS})" == "function" ] && \
- qa_call pre_pkg_${EBUILD_SH_ARGS}
- qa_call pkg_${EBUILD_SH_ARGS}
- [ "$(type -t post_pkg_${EBUILD_SH_ARGS})" == "function" ] && \
- qa_call post_pkg_${EBUILD_SH_ARGS}
+ ebuild_phase_with_hooks pkg_${EBUILD_SH_ARGS}
set +x
fi
;;