summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-10-18 03:55:38 +0000
committerZac Medico <zmedico@gentoo.org>2009-10-18 03:55:38 +0000
commit3c94b33a3d81d1642707040e2cbec34262ff34c1 (patch)
tree218bbf90c56b11ea0328c9512cda49e1adf5389a /bin
parentBug #287869 - Add a --selective[=n] option (inverse of --oneshot). This is (diff)
downloadportage-multirepo-3c94b33a3d81d1642707040e2cbec34262ff34c1.tar.gz
portage-multirepo-3c94b33a3d81d1642707040e2cbec34262ff34c1.tar.bz2
portage-multirepo-3c94b33a3d81d1642707040e2cbec34262ff34c1.zip
Bug #273648 - EAPI 3 - the following condtions must be met:
1. The A variable contains no items. 2. The phase function in question is not in DEFINED_PHASES. 3. None of the phase functions unpack, prepare, configure, compile or install, if supported by the EAPI in question and occurring prior to the phase about to be executed, are in DEFINED_PHASES. Thanks to Jonathan Callen <abcd@g.o> for this patch. (trunk r14616) svn path=/main/branches/2.1.7/; revision=14644
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild.sh62
1 files changed, 49 insertions, 13 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index b1ddd63c..6f0c3f17 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -905,13 +905,17 @@ dyn_prepare() {
return 0
fi
- local srcdir
if [[ -d $S ]] ; then
- srcdir=$S
+ cd "${S}"
+ elif hasq $EAPI 0 1 2; then
+ cd "${WORKDIR}"
+ elif [[ -z ${A} ]] && \
+ ! hasq unpack ${DEFINED_PHASES} && \
+ ! hasq prepare ${DEFINED_PHASES} ; then
+ cd "${WORKDIR}"
else
- srcdir=$WORKDIR
+ die "The source directory '${S}' doesn't exist"
fi
- cd "$srcdir"
trap abort_prepare SIGINT SIGQUIT
@@ -934,6 +938,19 @@ dyn_configure() {
return 0
fi
+ if [[ -d $S ]] ; then
+ cd "${S}"
+ elif hasq $EAPI 0 1 2; then
+ cd "${WORKDIR}"
+ elif [[ -z ${A} ]] && \
+ ! hasq unpack ${DEFINED_PHASES} && \
+ ! hasq prepare ${DEFINED_PHASES} && \
+ ! hasq configure ${DEFINED_PHASES} ; then
+ cd "${WORKDIR}"
+ else
+ die "The source directory '${S}' doesn't exist"
+ fi
+
trap abort_configure SIGINT SIGQUIT
[ -n "$EBUILD_PHASE" ] && rm -f "$T/logging/$EBUILD_PHASE"
@@ -957,6 +974,20 @@ dyn_compile() {
return 0
fi
+ if [[ -d $S ]] ; then
+ cd "${S}"
+ elif hasq $EAPI 0 1 2; then
+ cd "${WORKDIR}"
+ elif [[ -z ${A} ]] && \
+ ! hasq unpack ${DEFINED_PHASES} && \
+ ! hasq prepare ${DEFINED_PHASES} && \
+ ! hasq configure ${DEFINED_PHASES} && \
+ ! hasq compile ${DEFINED_PHASES} ; then
+ cd "${WORKDIR}"
+ else
+ die "The source directory '${S}' doesn't exist"
+ fi
+
trap abort_compile SIGINT SIGQUIT
[ -n "$EBUILD_PHASE" ] && rm -f "$T/logging/$EBUILD_PHASE"
@@ -989,6 +1020,7 @@ dyn_test() {
else
cd "${WORKDIR}"
fi
+
if ! hasq test $FEATURES && [ "${EBUILD_FORCE_TEST}" != "1" ]; then
vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}"
elif hasq test $RESTRICT; then
@@ -1023,11 +1055,22 @@ dyn_install() {
ebuild_phase pre_src_install
rm -rf "${PORTAGE_BUILDDIR}/image"
mkdir "${PORTAGE_BUILDDIR}/image"
- if [ -d "${S}" ]; then
+ local srcdir
+ if [[ -d $S ]] ; then
cd "${S}"
- else
+ elif hasq $EAPI 0 1 2; then
cd "${WORKDIR}"
+ elif [[ -z ${A} ]] && \
+ ! hasq unpack ${DEFINED_PHASES} && \
+ ! hasq prepare ${DEFINED_PHASES} && \
+ ! hasq configure ${DEFINED_PHASES} && \
+ ! hasq compile ${DEFINED_PHASES} && \
+ ! hasq install ${DEFINED_PHASES}; then
+ cd "${WORKDIR}"
+ else
+ die "The source directory '${S}' doesn't exist"
fi
+
vecho
vecho ">>> Install ${PF} into ${D} category ${CATEGORY}"
#our custom version of libtool uses $S and $D to fix
@@ -2000,13 +2043,6 @@ ebuild_main() {
cp "$EBUILD" "build-info/$PF.ebuild"
fi
- local srcdir
- if [[ -d $S ]] ; then
- srcdir=$S
- else
- srcdir=$WORKDIR
- fi
- cd "$srcdir"
#our custom version of libtool uses $S and $D to fix
#invalid paths in .la files
export S D