From: Mike Frysinger Date: Wed, 19 Oct 2005 03:36:15 +0000 (+0000) Subject: make sure we check the result of cat pipe #106049 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c73bc33831b70dedc45b4d601c4dcdcfa7c91de9;p=gentoo.git make sure we check the result of cat pipe #106049 --- diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index e67eca428718..cb346eeb0c39 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.207 2005/10/12 13:52:01 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.208 2005/10/19 03:36:15 vapier Exp $ # # Author: Martin Schlemmer # @@ -168,6 +168,7 @@ EPATCH_FORCE="no" # (10 Nov 2002) # epatch() { + _epatch_assert() { local _pipestatus=${PIPESTATUS[*]}; [[ ${_pipestatus// /} -eq 0 ]] ; } local PIPE_CMD="" local STDERR_TARGET="${T}/$$.out" local PATCH_TARGET="${T}/$$.patch" @@ -315,7 +316,7 @@ epatch() { fi fi - if (cat ${PATCH_TARGET} | patch -p${count} ${popts} --dry-run -f) >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/} 2>&1 + if (cat ${PATCH_TARGET} | patch -p${count} ${popts} --dry-run -f ; _epatch_assert) >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/} 2>&1 then draw_line "***** ${patchname} *****" > ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}.real echo >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}.real @@ -324,6 +325,7 @@ epatch() { draw_line "***** ${patchname} *****" >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}.real cat ${PATCH_TARGET} | patch -p${count} ${popts} >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}.real 2>&1 + _epatch_assert if [ "$?" -ne 0 ] then