diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-10-18 03:55:54 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-10-18 03:55:54 +0000 |
commit | b4f9db62a5071ecf5c3190c0e1dcf6bddfce5b3c (patch) | |
tree | ca60ddded4f44a5471da98cfb930ed93d8ae687a /bin/ebuild.sh | |
parent | 3c94b33a3d81d1642707040e2cbec34262ff34c1 (diff) | |
download | portage-b4f9db62a5071ecf5c3190c0e1dcf6bddfce5b3c.tar.gz portage-b4f9db62a5071ecf5c3190c0e1dcf6bddfce5b3c.tar.bz2 portage-b4f9db62a5071ecf5c3190c0e1dcf6bddfce5b3c.zip |
Simplify the conditionals from bug #273648. Thanks to Jonathan Callen
<abcd@g.o> for this patch. (trunk r14617)
svn path=/main/branches/2.1.7/; revision=14645
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-x | bin/ebuild.sh | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 6f0c3f179..5f7b68243 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -897,6 +897,15 @@ abort_install() { exit 1 } +has_phase_defined_up_to() { + for phase in unpack prepare configure compile install; do + has ${phase} ${DEFINED_PHASES} && return 0 + [[ ${phase} == $1 ]] && return 1 + done + # We shouldn't actually get here + return 1 +} + dyn_prepare() { if [[ -e $PORTAGE_BUILDDIR/.prepared ]] ; then @@ -909,9 +918,7 @@ dyn_prepare() { cd "${S}" elif hasq $EAPI 0 1 2; then cd "${WORKDIR}" - elif [[ -z ${A} ]] && \ - ! hasq unpack ${DEFINED_PHASES} && \ - ! hasq prepare ${DEFINED_PHASES} ; then + elif [[ -z ${A} ]] && ! has_phase_defined_up_to prepare; then cd "${WORKDIR}" else die "The source directory '${S}' doesn't exist" @@ -942,10 +949,7 @@ dyn_configure() { 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 + elif [[ -z ${A} ]] && ! has_phase_defined_up_to configure; then cd "${WORKDIR}" else die "The source directory '${S}' doesn't exist" @@ -978,11 +982,7 @@ dyn_compile() { 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 + elif [[ -z ${A} ]] && ! has_phase_defined_up_to compile; then cd "${WORKDIR}" else die "The source directory '${S}' doesn't exist" @@ -1060,12 +1060,7 @@ dyn_install() { 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} && \ - ! hasq install ${DEFINED_PHASES}; then + elif [[ -z ${A} ]] && ! has_phase_defined_up_to install; then cd "${WORKDIR}" else die "The source directory '${S}' doesn't exist" |