From: Petteri Räty Date: Sat, 16 Feb 2008 20:12:58 +0000 (+0000) Subject: Add possibility to use bash arrays for PATCHES. X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=022bdde1a051e0e9a174f2d109e6f841ace2c371;p=gentoo.git Add possibility to use bash arrays for PATCHES. --- diff --git a/eclass/base.eclass b/eclass/base.eclass index 88af00615d54..2d62c33b4189 100644 --- a/eclass/base.eclass +++ b/eclass/base.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.32 2008/02/12 23:51:51 betelgeuse Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.33 2008/02/16 20:12:58 betelgeuse Exp $ # # Author Dan Armak (nowadays retired) # @@ -34,10 +34,17 @@ base_src_unpack() { debug-print-section autopatch debug-print "$FUNCNAME: autopatch: PATCHES=$PATCHES, PATCHES1=$PATCHES1" cd "${S}" - for x in $PATCHES $PATCHES1; do - debug-print "$FUNCNAME: autopatch: patching from ${x}" - epatch ${x} - done + if [[ ${#PATCHES[@]} -gt 1 ]]; then + for x in "${PATCHES[@]}"; do + debug-print "$FUNCNAME: autopatch: patching from ${x}" + epatch "${x}" + done + else + for x in ${PATCHES} ${PATCHES1}; do + debug-print "$FUNCNAME: autopatch: patching from ${x}" + epatch "${x}" + done + fi ;; all) debug-print-section all