1 | # Copyright 1999-2003 Gentoo Technologies, Inc. |
1 | # Copyright 1999-2003 Gentoo Technologies, Inc. |
2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.18 2003/02/16 04:26:21 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.19 2003/02/16 20:12:26 azarah Exp $ |
4 | # |
4 | # |
5 | # Author: Martin Schlemmer <azarah@gentoo.org> |
5 | # Author: Martin Schlemmer <azarah@gentoo.org> |
6 | # |
6 | # |
7 | # This eclass is for general purpose functions that most ebuilds |
7 | # This eclass is for general purpose functions that most ebuilds |
8 | # have to implement themselves. |
8 | # have to implement themselves. |
… | |
… | |
155 | then |
155 | then |
156 | local EPATCH_SOURCE="$1/*.${EPATCH_SUFFIX}" |
156 | local EPATCH_SOURCE="$1/*.${EPATCH_SUFFIX}" |
157 | else |
157 | else |
158 | if [ ! -d ${EPATCH_SOURCE} ] |
158 | if [ ! -d ${EPATCH_SOURCE} ] |
159 | then |
159 | then |
|
|
160 | if [ -n "$1" -a "${EPATCH_SOURCE}" = "${WORKDIR}/patch" ] |
|
|
161 | then |
|
|
162 | EPATCH_SOURCE="$1" |
|
|
163 | fi |
|
|
164 | |
160 | echo |
165 | echo |
161 | eerror "Cannot find \$EPATCH_SOURCE! Value for \$EPATCH_SOURCE is:" |
166 | eerror "Cannot find \$EPATCH_SOURCE! Value for \$EPATCH_SOURCE is:" |
162 | eerror |
167 | eerror |
163 | eerror " ${EPATCH_SOURCE}" |
168 | eerror " ${EPATCH_SOURCE}" |
164 | echo |
169 | echo |
… | |
… | |
257 | count=5 |
262 | count=5 |
258 | break |
263 | break |
259 | fi |
264 | fi |
260 | fi |
265 | fi |
261 | |
266 | |
262 | if patch ${popts} --dry-run -f -p${count} < ${PATCH_TARGET} >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 2>&1 |
267 | if (cat ${PATCH_TARGET} | patch ${popts} --dry-run -f -p${count}) >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 2>&1 |
263 | then |
268 | then |
264 | draw_line "***** ${x##*/} *****" > ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real |
269 | draw_line "***** ${x##*/} *****" > ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real |
265 | echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real |
270 | echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real |
266 | echo "ACTUALLY APPLYING ${x##*/}..." >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real |
271 | echo "ACTUALLY APPLYING ${x##*/}..." >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real |
267 | echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real |
272 | echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real |
268 | draw_line "***** ${x##*/} *****" >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real |
273 | draw_line "***** ${x##*/} *****" >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real |
269 | |
274 | |
270 | patch ${popts} -p${count} < ${PATCH_TARGET} >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 2>&1 |
275 | cat ${PATCH_TARGET} | patch ${popts} -p${count} >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 2>&1 |
271 | |
276 | |
272 | if [ "$?" -ne 0 ] |
277 | if [ "$?" -ne 0 ] |
273 | then |
278 | then |
274 | cat ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} |
279 | cat ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} |
275 | echo |
280 | echo |