Re: [gentoo-portage-dev] [ferri...@lark.gentoo.org: r2267 - main/trunk/bin] (pre/post hooks)

2005-11-09 Thread Alec Warner

Jason Stubbs wrote:

On Thursday 10 November 2005 05:08, Brian Harring wrote:


If people are after having the commit mail dumped in their mbox,
please contact either jstubbs, genone, or myself.



Or if you're a dev, just add yourself. ;)

--
Jason Stubbs


Can someone add me? ( [EMAIL PROTECTED] )
--
gentoo-portage-dev@gentoo.org mailing list



Re: [gentoo-portage-dev] [ferri...@lark.gentoo.org: r2267 - main/trunk/bin] (pre/post hooks)

2005-11-09 Thread Jason Stubbs
On Thursday 10 November 2005 05:08, Brian Harring wrote:
> If people are after having the commit mail dumped in their mbox,
> please contact either jstubbs, genone, or myself.

Or if you're a dev, just add yourself. ;)

--
Jason Stubbs
-- 
gentoo-portage-dev@gentoo.org mailing list



[gentoo-portage-dev] [ferri...@lark.gentoo.org: r2267 - main/trunk/bin] (pre/post hooks)

2005-11-09 Thread Brian Harring
Just forwarding this to the ml; commited it to svn earlier today.

If people are after having the commit mail dumped in their mbox, 
please contact either jstubbs, genone, or myself.

~harring

- Forwarded message from Brian Harring <[EMAIL PROTECTED]> -

Date: Wed,  9 Nov 2005 20:06:12 +
To: [EMAIL PROTECTED]
From: Brian Harring <[EMAIL PROTECTED]>
Subject: r2267 - main/trunk/bin

Author: ferringb
Date: 2005-11-09 20:06:11 + (Wed, 09 Nov 2005)
New Revision: 2267

Modified:
   main/trunk/bin/ebuild.sh
Log:
pre/post hooks originally from 2.1, quick rewrite by axxo for 2.0
Not to be used by ebuilds/eclasses (with the sole exception of java eclass var 
reset till ebd is stabled), this is user hooks.


Modified: main/trunk/bin/ebuild.sh
===
--- main/trunk/bin/ebuild.sh2005-11-09 12:56:10 UTC (rev 2266)
+++ main/trunk/bin/ebuild.sh2005-11-09 20:06:11 UTC (rev 2267)
@@ -634,11 +634,14 @@
 
 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
@@ -665,6 +668,7 @@
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
@@ -676,6 +680,9 @@
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
 }
 
@@ -857,6 +864,9 @@
 
 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
@@ -895,6 +905,7 @@
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
@@ -951,6 +962,9 @@
if hasq nostrip $FEATURES $RESTRICT; then
touch DEBUGBUILD
fi
+
+   [ "$(type -t post_src_compile)" == "function" ] && post_src_compile
+
trap SIGINT SIGQUIT
 }
 
@@ -975,8 +989,10 @@
 
 
 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
@@ -995,6 +1011,7 @@
 
cd "${BUILDDIR}"
touch .tested || die "Failed to 'touch .tested' in ${BUILDDIR}"
+   [ "$(type -t post_src_test)" == "function" ] && post_src_test
trap SIGINT SIGQUIT
 }

@@ -1004,6 +1021,7 @@
 
 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
@@ -1207,6 +1225,7 @@
echo ">>> Completed installing ${PF} into ${D}"
echo
cd ${BUILDDIR}
+   [ "$(type -t post_src_install)" == "function" ] && post_src_install
trap SIGINT SIGQUIT
 }
 
@@ -1214,6 +1233,8 @@
# 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
 
@@ -1322,6 +1343,9 @@
echo "!!! Unable to set SELinux security labels"
fi
fi
+
+   [ "$(type -t post_pkg_preinst)" == "function" ] && post_pkg_preinst
+
trap SIGINT SIGQUIT
 }
 
@@ -1848,11 +1872,15 @@
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}