Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 101944 Details for
Bug 155161
[feature request] debug ebuilds with 'ebuildshell' feature
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
add 'call-ebuildshell()' to bin/ebuild.sh
ebuildshell.patch (text/plain), 7.16 KB, created by
Michael Haubenwallner (RETIRED)
on 2006-11-14 12:44:27 UTC
(
hide
)
Description:
add 'call-ebuildshell()' to bin/ebuild.sh
Filename:
MIME Type:
Creator:
Michael Haubenwallner (RETIRED)
Created:
2006-11-14 12:44:27 UTC
Size:
7.16 KB
patch
obsolete
>--- bin/ebuild.sh.orig 2006-11-14 17:29:11.000000000 +0100 >+++ bin/ebuild.sh 2006-11-14 17:29:47.000000000 +0100 >@@ -661,14 +661,14 @@ > } > > dyn_setup() { >- [ "$(type -t pre_pkg_setup)" == "function" ] && pre_pkg_setup >- pkg_setup >- [ "$(type -t post_pkg_setup)" == "function" ] && post_pkg_setup >+ [ "$(type -t pre_pkg_setup)" == "function" ] && call-ebuildshell pre_pkg_setup >+ call-ebuildshell pkg_setup >+ [ "$(type -t post_pkg_setup)" == "function" ] && call-ebuildshell post_pkg_setup > } > > dyn_unpack() { > trap "abort_unpack" SIGINT SIGQUIT >- [ "$(type -t pre_src_unpack)" == "function" ] && pre_src_unpack >+ [ "$(type -t pre_src_unpack)" == "function" ] && call-ebuildshell pre_src_unpack > local newstuff="no" > if [ -e "${WORKDIR}" ]; then > local x >@@ -695,7 +695,7 @@ > if [ -e "${WORKDIR}" ]; then > if [ "$newstuff" == "no" ]; then > vecho ">>> WORKDIR is up-to-date, keeping..." >- [ "$(type -t post_src_unpack)" == "function" ] && post_src_unpack >+ [ "$(type -t post_src_unpack)" == "function" ] && call-ebuildshell post_src_unpack > return 0 > fi > fi >@@ -705,12 +705,12 @@ > fi > cd "${WORKDIR}" || die "Directory change failed: \`cd '${WORKDIR}'\`" > vecho ">>> Unpacking source..." >- src_unpack >+ call-ebuildshell src_unpack > touch "${PORTAGE_BUILDDIR}/.unpacked" || die "IO Failure -- Failed 'touch .unpacked' in ${PORTAGE_BUILDDIR}" > vecho ">>> Source unpacked." > cd "${PORTAGE_BUILDDIR}" > >- [ "$(type -t post_src_unpack)" == "function" ] && post_src_unpack >+ [ "$(type -t post_src_unpack)" == "function" ] && call-ebuildshell post_src_unpack > > trap SIGINT SIGQUIT > } >@@ -872,7 +872,7 @@ > dyn_compile() { > trap "abort_compile" SIGINT SIGQUIT > >- [ "$(type -t pre_src_compile)" == "function" ] && pre_src_compile >+ [ "$(type -t pre_src_compile)" == "function" ] && call-ebuildshell pre_src_compile > > [ "${CFLAGS-unset}" != "unset" ] && export CFLAGS > [ "${CXXFLAGS-unset}" != "unset" ] && export CXXFLAGS >@@ -920,7 +920,7 @@ > vecho ">>> It appears that '${PF}' is already compiled; skipping." > vecho ">>> Remove '${PORTAGE_BUILDDIR}/.compiled' to force install." > trap SIGINT SIGQUIT >- [ "$(type -t post_src_compile)" == "function" ] && post_src_compile >+ [ "$(type -t post_src_compile)" == "function" ] && call-ebuildshell post_src_compile > return > fi > if [ -d "${S}" ]; then >@@ -934,7 +934,7 @@ > #our libtool to create problematic .la files > export PWORKDIR="$WORKDIR" > vecho ">>> Compiling source in ${srcdir} ..." >- src_compile >+ call-ebuildshell src_compile > vecho ">>> Source compiled." > #|| abort_compile "fail" > cd "${PORTAGE_BUILDDIR}" >@@ -960,16 +960,16 @@ > touch DEBUGBUILD > fi > >- [ "$(type -t post_src_compile)" == "function" ] && post_src_compile >+ [ "$(type -t post_src_compile)" == "function" ] && call-ebuildshell post_src_compile > > trap SIGINT SIGQUIT > } > > dyn_test() { >- [ "$(type -t pre_src_test)" == "function" ] && pre_src_test >+ [ "$(type -t pre_src_test)" == "function" ] && call-ebuildshell pre_src_test > if [ "${PORTAGE_BUILDDIR}/.tested" -nt "${WORKDIR}" ]; then > vecho ">>> It appears that ${PN} has already been tested; skipping." >- [ "$(type -t post_src_test)" == "function" ] && post_src_test >+ [ "$(type -t post_src_test)" == "function" ] && call-ebuildshell post_src_test > return > fi > trap "abort_test" SIGINT SIGQUIT >@@ -983,13 +983,13 @@ > vecho ">>> Test phase [explicitly disabled]: ${CATEGORY}/${PF}" > else > addpredict / >- src_test >+ call-ebuildshell src_test > SANDBOX_PREDICT="${SANDBOX_PREDICT%:/}" > fi > > cd "${PORTAGE_BUILDDIR}" > touch .tested || die "Failed to 'touch .tested' in ${PORTAGE_BUILDDIR}" >- [ "$(type -t post_src_test)" == "function" ] && post_src_test >+ [ "$(type -t post_src_test)" == "function" ] && call-ebuildshell post_src_test > trap SIGINT SIGQUIT > } > >@@ -1003,7 +1003,7 @@ > return 0 > fi > trap "abort_install" SIGINT SIGQUIT >- [ "$(type -t pre_src_install)" == "function" ] && pre_src_install >+ [ "$(type -t pre_src_install)" == "function" ] && call-ebuildshell pre_src_install > rm -rf "${PORTAGE_BUILDDIR}/image" > mkdir "${PORTAGE_BUILDDIR}/image" > if [ -d "${S}" ]; then >@@ -1017,12 +1017,12 @@ > #some packages uses an alternative to $S to build in, cause > #our libtool to create problematic .la files > export PWORKDIR="$WORKDIR" >- src_install >+ call-ebuildshell src_install > touch "${PORTAGE_BUILDDIR}/.installed" > vecho ">>> Completed installing ${PF} into ${D}" > vecho > cd ${PORTAGE_BUILDDIR} >- [ "$(type -t post_src_install)" == "function" ] && post_src_install >+ [ "$(type -t post_src_install)" == "function" ] && call-ebuildshell post_src_install > trap SIGINT SIGQUIT > } > >@@ -1032,12 +1032,44 @@ > return 1 > fi > >- [ "$(type -t pre_pkg_preinst)" == "function" ] && pre_pkg_preinst >+ [ "$(type -t pre_pkg_preinst)" == "function" ] && call-ebuildshell pre_pkg_preinst > > declare -r D=${IMAGE} >- pkg_preinst >+ call-ebuildshell pkg_preinst > >- [ "$(type -t post_pkg_preinst)" == "function" ] && post_pkg_preinst >+ [ "$(type -t post_pkg_preinst)" == "function" ] && call-ebuildshell post_pkg_preinst >+} >+ >+call-ebuildshell() { >+ if ! hasq ebuildshell ${FEATURES}; then >+ $1 >+ return $? >+ fi >+ >+ ( >+ umask 002 >+ ( echo 'unset ENV' >+ set | egrep -v '^(BASH_VERSINFO|EUID|PPID|SHELLOPTS|UID)=' >+ export -p | grep -v 'declare -rx' >+ shopt -p >+ echo "export PS1='EBUILD ${PN} $1 \$ '" >+ echo 'unset ENV' >+ # 'declare -x VAR=val' does not work when called within bash function, >+ # it needs to be 'export VAR=val'. >+ # is this a bash-bug or intentional ? >+ echo "trap 'umask 002; ( set ; export -p | sed -e \"s:declare -x:export:\" ) > ${T}/ebuildshell-environment-outcome' 0" >+ ) > ${T}/ebuildshell-environment >+ chown portage:portage "${T}/ebuildshell-environment" &>/dev/null >+ chmod g+w "${T}/ebuildshell-environment" &>/dev/null >+ ) >+ >+ rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null >+ >+ ${BASH} --rcfile "${T}/ebuildshell-environment" -s || die >+ >+ chown portage:portage "${T}/ebuildshell-environment-outcome" &>/dev/null >+ chown g+w "${T}/ebuildshell-environment-outcome" &>/dev/null >+ source "${T}/ebuildshell-environment-outcome" &>/dev/null > } > > dyn_help() { >@@ -1517,21 +1549,21 @@ > for myarg in $*; do > case $myarg in > nofetch) >- pkg_nofetch >+ call-ebuildshell pkg_nofetch > exit 1 > ;; > 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} >+ [ "$(type -t pre_pkg_${myarg})" == "function" ] && call-ebuildshell pre_pkg_${myarg} >+ call-ebuildshell pkg_${myarg} >+ [ "$(type -t post_pkg_${myarg})" == "function" ] && call-ebuildshell 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} >+ [ "$(type -t pre_pkg_${myarg})" == "function" ] && call-ebuildshell pre_pkg_${myarg} >+ call-ebuildshell pkg_${myarg} >+ [ "$(type -t post_pkg_${myarg})" == "function" ] && call-ebuildshell post_pkg_${myarg} > #Allow non-zero return codes since they can be caused by && > set +x > fi
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 155161
:
101944
|
102194
|
113966
|
157409
|
198919
|
325990
|
326048
|
326182
|
374152
|
374154
|
432114
|
432256
|
432966
|
433098
|
434176
|
496448
|
534066