dyn_setup()
{
+ [ "$(type -t pre_pkg_setup)" == "function" ] && pre_pkg_setup
pkg_setup
+ [ "$(type -t post_pkg_setup)" == "function" ] && post_pkg_setup
}
dyn_unpack() {
trap "abort_unpack" SIGINT SIGQUIT
+ [ "$(type -t pre_src_unpack)" == "function" ] && pre_src_unpack
local newstuff="no"
if [ -e "${WORKDIR}" ]; then
local x
if [ -e "${WORKDIR}" ]; then
if [ "$newstuff" == "no" ]; then
echo ">>> WORKDIR is up-to-date, keeping..."
+ [ "$(type -t post_src_unpack)" == "function" ] && post_src_unpack
return 0
fi
fi
touch "${BUILDDIR}/.unpacked" || die "IO Failure -- Failed 'touch .unpacked' in BUILDIR"
echo ">>> Source unpacked."
cd "$BUILDDIR"
+
+ [ "$(type -t post_src_unpack)" == "function" ] && post_src_unpack
+
trap SIGINT SIGQUIT
}
dyn_compile() {
trap "abort_compile" SIGINT SIGQUIT
+
+ [ "$(type -t pre_src_compile)" == "function" ] && pre_src_compile
+
[ "${CFLAGS-unset}" != "unset" ] && export CFLAGS
[ "${CXXFLAGS-unset}" != "unset" ] && export CXXFLAGS
[ "${LIBCFLAGS-unset}" != "unset" ] && export LIBCFLAGS
echo ">>> It appears that ${PN} is already compiled; skipping."
echo ">>> (clean to force compilation)"
trap SIGINT SIGQUIT
+ [ "$(type -t post_src_compile)" == "function" ] && post_src_compile
return
fi
if [ -d "${S}" ]; then
if hasq nostrip $FEATURES $RESTRICT; then
touch DEBUGBUILD
fi
+
+ [ "$(type -t post_src_compile)" == "function" ] && post_src_compile
+
trap SIGINT SIGQUIT
}
dyn_test() {
+ [ "$(type -t pre_src_test)" == "function" ] && pre_src_test
if [ ${BUILDDIR}/.tested -nt "${WORKDIR}" ]; then
echo ">>> It appears that ${PN} has already been tested; skipping."
+ [ "$(type -t post_src_test)" == "function" ] && post_src_test
return
fi
trap "abort_test" SIGINT SIGQUIT
cd "${BUILDDIR}"
touch .tested || die "Failed to 'touch .tested' in ${BUILDDIR}"
+ [ "$(type -t post_src_test)" == "function" ] && post_src_test
trap SIGINT SIGQUIT
}
dyn_install() {
trap "abort_install" SIGINT SIGQUIT
+ [ "$(type -t pre_src_install)" == "function" ] && pre_src_install
rm -rf "${BUILDDIR}/image"
mkdir "${BUILDDIR}/image"
if [ -d "${S}" ]; then
echo ">>> Completed installing ${PF} into ${D}"
echo
cd ${BUILDDIR}
+ [ "$(type -t post_src_install)" == "function" ] && post_src_install
trap SIGINT SIGQUIT
}
# set IMAGE depending if this is a binary or compile merge
[ "${EMERGE_FROM}" == "binary" ] && IMAGE=${PKG_TMPDIR}/${PF}/bin \
|| IMAGE=${D}
+
+ [ "$(type -t pre_pkg_preinst)" == "function" ] && pre_pkg_preinst
D=${IMAGE} pkg_preinst
echo "!!! Unable to set SELinux security labels"
fi
fi
+
+ [ "$(type -t post_pkg_preinst)" == "function" ] && post_pkg_preinst
+
trap SIGINT SIGQUIT
}
prerm|postrm|postinst|config)
export SANDBOX_ON="0"
if [ "$PORTAGE_DEBUG" != "1" ]; then
+ [ "$(type -t pre_pkg_${myarg})" == "function" ] && pre_pkg_${myarg}
pkg_${myarg}
+ [ "$(type -t post_pkg_${myarg})" == "function" ] && post_pkg_${myarg}
#Allow non-zero return codes since they can be caused by &&
else
set -x
+ [ "$(type -t pre_pkg_${myarg})" == "function" ] && pre_pkg_${myarg}
pkg_${myarg}
+ [ "$(type -t post_pkg_${myarg})" == "function" ] && post_pkg_${myarg}
#Allow non-zero return codes since they can be caused by &&
set +x
fi